From 6967407b19706d55895464c568c15b0734216bc0 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Mon, 3 Dec 2018 13:25:30 -0800 Subject: [PATCH 001/223] inspector, trace_events: make sure messages are sent on a main thread Fixes: https://github.com/nodejs/node/issues/23185 PR-URL: https://github.com/nodejs/node/pull/24814 Reviewed-By: James M Snell --- src/inspector/main_thread_interface.cc | 12 ++- src/inspector/main_thread_interface.h | 1 + src/inspector/tracing_agent.cc | 101 +++++++++++++++--- src/inspector/tracing_agent.h | 8 +- src/inspector_agent.cc | 20 ++-- ...-events-dynamic-enable-workers-disabled.js | 1 + 6 files changed, 117 insertions(+), 26 deletions(-) diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc index 2ed6362df53fda..15ffb49d74d1d4 100644 --- a/src/inspector/main_thread_interface.cc +++ b/src/inspector/main_thread_interface.cc @@ -316,15 +316,21 @@ void MainThreadInterface::RemoveObject(int id) { } Deletable* MainThreadInterface::GetObject(int id) { - auto iterator = managed_objects_.find(id); + Deletable* pointer = GetObjectIfExists(id); // This would mean the object is requested after it was disposed, which is // a coding error. - CHECK_NE(managed_objects_.end(), iterator); - Deletable* pointer = iterator->second.get(); CHECK_NE(nullptr, pointer); return pointer; } +Deletable* MainThreadInterface::GetObjectIfExists(int id) { + auto iterator = managed_objects_.find(id); + if (iterator == managed_objects_.end()) { + return nullptr; + } + return iterator->second.get(); +} + std::unique_ptr Utf8ToStringView(const std::string& message) { icu::UnicodeString utf16 = icu::UnicodeString::fromUTF8( icu::StringPiece(message.data(), message.length())); diff --git a/src/inspector/main_thread_interface.h b/src/inspector/main_thread_interface.h index 7092310e553c19..3e8eb13645b009 100644 --- a/src/inspector/main_thread_interface.h +++ b/src/inspector/main_thread_interface.h @@ -84,6 +84,7 @@ class MainThreadInterface { } void AddObject(int handle, std::unique_ptr object); Deletable* GetObject(int id); + Deletable* GetObjectIfExists(int id); void RemoveObject(int handle); private: diff --git a/src/inspector/tracing_agent.cc b/src/inspector/tracing_agent.cc index e8f9d569f8ee69..79fccbf8aa47ac 100644 --- a/src/inspector/tracing_agent.cc +++ b/src/inspector/tracing_agent.cc @@ -1,4 +1,5 @@ #include "tracing_agent.h" +#include "main_thread_interface.h" #include "node_internals.h" #include "env-inl.h" @@ -14,10 +15,76 @@ namespace protocol { namespace { using v8::platform::tracing::TraceWriter; +class DeletableFrontendWrapper : public Deletable { + public: + explicit DeletableFrontendWrapper( + std::weak_ptr frontend) + : frontend_(frontend) {} + + // This should only be called from the main thread, meaning frontend should + // not be destroyed concurrently. + NodeTracing::Frontend* get() { return frontend_.lock().get(); } + + private: + std::weak_ptr frontend_; +}; + +class CreateFrontendWrapperRequest : public Request { + public: + CreateFrontendWrapperRequest(int object_id, + std::weak_ptr frontend) + : object_id_(object_id) { + frontend_wrapper_ = std::make_unique(frontend); + } + + void Call(MainThreadInterface* thread) override { + thread->AddObject(object_id_, std::move(frontend_wrapper_)); + } + + private: + int object_id_; + std::unique_ptr frontend_wrapper_; +}; + +class DestroyFrontendWrapperRequest : public Request { + public: + explicit DestroyFrontendWrapperRequest(int object_id) + : object_id_(object_id) {} + + void Call(MainThreadInterface* thread) override { + thread->RemoveObject(object_id_); + } + + private: + int object_id_; +}; + +class SendMessageRequest : public Request { + public: + explicit SendMessageRequest(int object_id, const std::string& message) + : object_id_(object_id), message_(message) {} + + void Call(MainThreadInterface* thread) override { + DeletableFrontendWrapper* frontend_wrapper = + static_cast( + thread->GetObjectIfExists(object_id_)); + if (frontend_wrapper == nullptr) return; + auto frontend = frontend_wrapper->get(); + if (frontend != nullptr) { + frontend->sendRawNotification(message_); + } + } + + private: + int object_id_; + std::string message_; +}; + class InspectorTraceWriter : public node::tracing::AsyncTraceWriter { public: - explicit InspectorTraceWriter(NodeTracing::Frontend* frontend) - : frontend_(frontend) {} + explicit InspectorTraceWriter(int frontend_object_id, + std::shared_ptr main_thread) + : frontend_object_id_(frontend_object_id), main_thread_(main_thread) {} void AppendTraceEvent( v8::platform::tracing::TraceObject* trace_event) override { @@ -35,27 +102,35 @@ class InspectorTraceWriter : public node::tracing::AsyncTraceWriter { std::ostringstream::ate); result << stream_.str(); result << "}"; - frontend_->sendRawNotification(result.str()); + main_thread_->Post(std::make_unique(frontend_object_id_, + result.str())); stream_.str(""); } private: std::unique_ptr json_writer_; std::ostringstream stream_; - NodeTracing::Frontend* frontend_; + int frontend_object_id_; + std::shared_ptr main_thread_; }; } // namespace -TracingAgent::TracingAgent(Environment* env) - : env_(env) { -} +TracingAgent::TracingAgent(Environment* env, + std::shared_ptr main_thread) + : env_(env), main_thread_(main_thread) {} TracingAgent::~TracingAgent() { trace_writer_.reset(); + main_thread_->Post( + std::make_unique(frontend_object_id_)); } void TracingAgent::Wire(UberDispatcher* dispatcher) { - frontend_.reset(new NodeTracing::Frontend(dispatcher->channel())); + // Note that frontend is still owned by TracingAgent + frontend_ = std::make_shared(dispatcher->channel()); + frontend_object_id_ = main_thread_->newObjectId(); + main_thread_->Post(std::make_unique( + frontend_object_id_, frontend_)); NodeTracing::Dispatcher::wire(dispatcher, this); } @@ -81,11 +156,11 @@ DispatchResponse TracingAgent::start( tracing::AgentWriterHandle* writer = GetTracingAgentWriter(); if (writer != nullptr) { - trace_writer_ = writer->agent()->AddClient( - categories_set, - std::unique_ptr( - new InspectorTraceWriter(frontend_.get())), - tracing::Agent::kIgnoreDefaultCategories); + trace_writer_ = + writer->agent()->AddClient(categories_set, + std::make_unique( + frontend_object_id_, main_thread_), + tracing::Agent::kIgnoreDefaultCategories); } return DispatchResponse::OK(); } diff --git a/src/inspector/tracing_agent.h b/src/inspector/tracing_agent.h index 029fce7c191b42..29587b03c88211 100644 --- a/src/inspector/tracing_agent.h +++ b/src/inspector/tracing_agent.h @@ -10,11 +10,13 @@ namespace node { class Environment; namespace inspector { +class MainThreadHandle; + namespace protocol { class TracingAgent : public NodeTracing::Backend { public: - explicit TracingAgent(Environment*); + explicit TracingAgent(Environment*, std::shared_ptr); ~TracingAgent() override; void Wire(UberDispatcher* dispatcher); @@ -29,8 +31,10 @@ class TracingAgent : public NodeTracing::Backend { void DisconnectTraceClient(); Environment* env_; + std::shared_ptr main_thread_; tracing::AgentWriterHandle trace_writer_; - std::unique_ptr frontend_; + int frontend_object_id_; + std::shared_ptr frontend_; }; diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index dcc256b7f70434..2d919b9210bf65 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -211,14 +211,15 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel, const std::unique_ptr& inspector, std::shared_ptr worker_manager, std::unique_ptr delegate, + std::shared_ptr main_thread_, bool prevent_shutdown) - : delegate_(std::move(delegate)), - prevent_shutdown_(prevent_shutdown) { + : delegate_(std::move(delegate)), prevent_shutdown_(prevent_shutdown) { session_ = inspector->connect(1, this, StringView()); - node_dispatcher_.reset(new protocol::UberDispatcher(this)); - tracing_agent_.reset(new protocol::TracingAgent(env)); + node_dispatcher_ = std::make_unique(this); + tracing_agent_ = + std::make_unique(env, main_thread_); tracing_agent_->Wire(node_dispatcher_.get()); - worker_agent_.reset(new protocol::WorkerAgent(worker_manager)); + worker_agent_ = std::make_unique(worker_manager); worker_agent_->Wire(node_dispatcher_.get()); } @@ -467,9 +468,12 @@ class NodeInspectorClient : public V8InspectorClient { bool prevent_shutdown) { events_dispatched_ = true; int session_id = next_session_id_++; - channels_[session_id] = - std::make_unique(env_, client_, getWorkerManager(), - std::move(delegate), prevent_shutdown); + channels_[session_id] = std::make_unique(env_, + client_, + getWorkerManager(), + std::move(delegate), + getThreadHandle(), + prevent_shutdown); return session_id; } diff --git a/test/parallel/test-trace-events-dynamic-enable-workers-disabled.js b/test/parallel/test-trace-events-dynamic-enable-workers-disabled.js index 87ce617e8e221c..634017f95ad051 100644 --- a/test/parallel/test-trace-events-dynamic-enable-workers-disabled.js +++ b/test/parallel/test-trace-events-dynamic-enable-workers-disabled.js @@ -25,3 +25,4 @@ session.post('NodeTracing.start', { 'Tracing properties can only be changed through main thread sessions' }); })); +session.disconnect(); From 99bc0df74c5e9d2debab5f1fdcc847b992c91c59 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 27 Jan 2019 19:08:35 -0500 Subject: [PATCH 002/223] lib: refactor ERR_SYNTHETIC - Tidy up description in docs. - Remove a second definition in the docs. - Remove unused string input parameter. - Remove duplicate "JavaScript Callstack" in error messages. PR-URL: https://github.com/nodejs/node/pull/25749 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Anto Aravinth Reviewed-By: Gireesh Punathil Reviewed-By: Luigi Pinca --- doc/api/errors.md | 10 ++-------- lib/internal/errors.js | 2 +- lib/internal/process/report.js | 8 +++----- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 39d131b42aab55..e7572b1dbd7978 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1692,8 +1692,8 @@ length. #### ERR_SYNTHETIC -An artificial error object used to capture call stack when diagnostic report -is produced. +An artificial error object used to capture the call stack for diagnostic +reports. ### ERR_SYSTEM_ERROR @@ -2227,12 +2227,6 @@ size. This `Error` is thrown when a read is attempted on a TTY `WriteStream`, such as `process.stdout.on('data')`. - -#### ERR_SYNTHETIC - -An artifical error object used to capture call stack when diagnostic report -is produced. - [`'uncaughtException'`]: process.html#process_event_uncaughtexception [`--force-fips`]: cli.html#cli_force_fips diff --git a/lib/internal/errors.js b/lib/internal/errors.js index f8d7aafeec164d..d8071e00639a6b 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -923,7 +923,7 @@ E('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event', Error); E('ERR_STREAM_WRAP', 'Stream has StringDecoder set or is in objectMode', Error); E('ERR_STREAM_WRITE_AFTER_END', 'write after end', Error); -E('ERR_SYNTHETIC', 'JavaScript Callstack: %s', Error); +E('ERR_SYNTHETIC', 'JavaScript Callstack', Error); E('ERR_SYSTEM_ERROR', 'A system error occurred', SystemError); E('ERR_TLS_CERT_ALTNAME_INVALID', 'Hostname/IP does not match certificate\'s altnames: %s', Error); diff --git a/lib/internal/process/report.js b/lib/internal/process/report.js index 9b66526ce3dc91..5ff1238f40ed78 100644 --- a/lib/internal/process/report.js +++ b/lib/internal/process/report.js @@ -101,13 +101,11 @@ exports.setup = function() { emitExperimentalWarning('report'); if (err == null) { if (file == null) { - return nr.triggerReport(new ERR_SYNTHETIC( - 'JavaScript Callstack').stack); + return nr.triggerReport(new ERR_SYNTHETIC().stack); } if (typeof file !== 'string') throw new ERR_INVALID_ARG_TYPE('file', 'String', file); - return nr.triggerReport(file, new ERR_SYNTHETIC( - 'JavaScript Callstack').stack); + return nr.triggerReport(file, new ERR_SYNTHETIC().stack); } if (typeof err !== 'object') throw new ERR_INVALID_ARG_TYPE('err', 'Object', err); @@ -120,7 +118,7 @@ exports.setup = function() { getReport(err) { emitExperimentalWarning('report'); if (err == null) { - return nr.getReport(new ERR_SYNTHETIC('JavaScript Callstack').stack); + return nr.getReport(new ERR_SYNTHETIC().stack); } else if (typeof err !== 'object') { throw new ERR_INVALID_ARG_TYPE('err', 'Objct', err); } else { From cc22fd7be940b15cee6432abbb9ae9094f47ea8d Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 28 Jan 2019 00:14:40 -0500 Subject: [PATCH 003/223] report: split up osVersion and machine values Prior to this commit, on non-Windows platforms, the "osVersion" value was prepended to the "machine" value. PR-URL: https://github.com/nodejs/node/pull/25755 Reviewed-By: Gireesh Punathil Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Richard Lau --- src/node_report.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/node_report.cc b/src/node_report.cc index 4caa01d3cfbe2f..69ae0ee53eb292 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -426,22 +426,20 @@ static void PrintVersionInformation(JSONWriter* writer) { if (uname(&os_info) >= 0) { #ifdef _AIX buf << os_info.sysname << " " << os_info.version << "." << os_info.release; - writer->json_keyvalue("osVersion", buf.str()); - buf.flush(); #else buf << os_info.sysname << " " << os_info.release << " " << os_info.version; +#endif /* _AIX */ writer->json_keyvalue("osVersion", buf.str()); - buf.flush(); -#endif + buf.str(""); + buf << os_info.nodename << " " << os_info.machine; + writer->json_keyvalue("machine", buf.str()); + const char* (*libc_version)(); *(reinterpret_cast(&libc_version)) = dlsym(RTLD_DEFAULT, "gnu_get_libc_version"); if (libc_version != nullptr) { writer->json_keyvalue("glibc", (*libc_version)()); } - buf << os_info.nodename << " " << os_info.machine; - writer->json_keyvalue("machine", buf.str()); - buf.flush(); } #endif } From d4631816efc63f3cd256467bef5004051bbd5f96 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 28 Jan 2019 01:14:04 +0100 Subject: [PATCH 004/223] report: use consistent format for dumpEventTime Use the same JS-compatible format on both POSIX and Windows. PR-URL: https://github.com/nodejs/node/pull/25751 Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Gireesh Punathil --- src/node_report.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_report.cc b/src/node_report.cc index 69ae0ee53eb292..a9861f931e847c 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -247,7 +247,7 @@ static void WriteNodeReport(Isolate* isolate, #ifdef _WIN32 snprintf(timebuf, sizeof(timebuf), - "%4d/%02d/%02d %02d:%02d:%02d", + "%4d-%02d-%02dT%02d:%02d:%02dZ", tm_struct->wYear, tm_struct->wMonth, tm_struct->wDay, From d9c2690705ee6c1e478c3b1531f352d379668edc Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 27 Jan 2019 21:59:28 +0100 Subject: [PATCH 005/223] src: turn ROUND_UP into an inline function PR-URL: https://github.com/nodejs/node/pull/25743 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Tiancheng "Timothy" Gu --- src/node_http2.cc | 6 +++--- src/spawn_sync.cc | 4 ++-- src/util.h | 8 +++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/node_http2.cc b/src/node_http2.cc index 11698d177ad082..7904c680b89369 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -382,7 +382,7 @@ Headers::Headers(Isolate* isolate, header_string_len); // Make sure the start address is aligned appropriately for an nghttp2_nv*. char* start = reinterpret_cast( - ROUND_UP(reinterpret_cast(*buf_), alignof(nghttp2_nv))); + RoundUp(reinterpret_cast(*buf_), alignof(nghttp2_nv))); char* header_contents = start + (count_ * sizeof(nghttp2_nv)); nghttp2_nv* const nva = reinterpret_cast(start); @@ -438,8 +438,8 @@ Origins::Origins(Isolate* isolate, // Make sure the start address is aligned appropriately for an nghttp2_nv*. char* start = reinterpret_cast( - ROUND_UP(reinterpret_cast(*buf_), - alignof(nghttp2_origin_entry))); + RoundUp(reinterpret_cast(*buf_), + alignof(nghttp2_origin_entry))); char* origin_contents = start + (count_ * sizeof(nghttp2_origin_entry)); nghttp2_origin_entry* const nva = reinterpret_cast(start); diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 962fafa91f30b5..0dbf5f09fc78bf 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -1049,7 +1049,7 @@ Maybe SyncProcessRunner::CopyJsStringArray(Local js_value, Maybe maybe_size = StringBytes::StorageSize(isolate, value, UTF8); if (maybe_size.IsNothing()) return Nothing(); data_size += maybe_size.FromJust() + 1; - data_size = ROUND_UP(data_size, sizeof(void*)); + data_size = RoundUp(data_size, sizeof(void*)); } buffer = new char[list_size + data_size]; @@ -1066,7 +1066,7 @@ Maybe SyncProcessRunner::CopyJsStringArray(Local js_value, value, UTF8); buffer[data_offset++] = '\0'; - data_offset = ROUND_UP(data_offset, sizeof(void*)); + data_offset = RoundUp(data_offset, sizeof(void*)); } list[length] = nullptr; diff --git a/src/util.h b/src/util.h index ea705b800bdf17..f3a174821ab882 100644 --- a/src/util.h +++ b/src/util.h @@ -617,9 +617,11 @@ constexpr size_t arraysize(const T (&)[N]) { return N; } -#ifndef ROUND_UP -#define ROUND_UP(a, b) ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a)) -#endif +// Round up a to the next highest multiple of b. +template +constexpr T RoundUp(T a, T b) { + return a % b != 0 ? a + b - (a % b) : a; +} #ifdef __GNUC__ #define MUST_USE_RESULT __attribute__((warn_unused_result)) From 0949039d263d5d2f0adeffeb182a156a388b513d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 28 Jan 2019 23:15:37 +0100 Subject: [PATCH 006/223] src: add handle scope to `OnFatalError()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For the report generation, we use `Environment::GetCurrent(isolate)` which uses `isolate->GetCurrentContext()` under the hood, thus allocates a handle. Without a `HandleScope`, this is invalid. This might not strictly be allowed inside of `OnFatalError()`, but it won’t make anything worse either. PR-URL: https://github.com/nodejs/node/pull/25775 Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell --- src/node_errors.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node_errors.cc b/src/node_errors.cc index c7a449c8c50a4a..23a65bd2251d62 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -319,6 +319,7 @@ void OnFatalError(const char* location, const char* message) { } #ifdef NODE_REPORT Isolate* isolate = Isolate::GetCurrent(); + HandleScope handle_scope(isolate); Environment* env = Environment::GetCurrent(isolate); if (env != nullptr) { std::shared_ptr options = env->isolate_data()->options(); From 3f080d12f46d6421ece1c9690e7fd3b53f9dedcc Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 28 Jan 2019 23:53:39 +0100 Subject: [PATCH 007/223] src: add debug check for inspector uv_async_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a check to make sure start_io_thread_async is not accidentally re-used or used when uninitialized. (This is a bit of an odd check imo, but it helped me figure out a real issue and it might do so again, so… why not?) PR-URL: https://github.com/nodejs/node/pull/25777 Reviewed-By: Eugene Ostroukhov Reviewed-By: Minwoo Jung Reviewed-By: James M Snell --- src/inspector_agent.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 2d919b9210bf65..fb85a54408e19c 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -51,6 +51,9 @@ using v8_inspector::V8InspectorClient; static uv_sem_t start_io_thread_semaphore; static uv_async_t start_io_thread_async; +// This is just an additional check to make sure start_io_thread_async +// is not accidentally re-used or used when uninitialized. +static std::atomic_bool start_io_thread_async_initialized { false }; class StartIoTask : public Task { public: @@ -88,6 +91,7 @@ static void StartIoThreadWakeup(int signo) { inline void* StartIoThreadMain(void* unused) { for (;;) { uv_sem_wait(&start_io_thread_semaphore); + CHECK(start_io_thread_async_initialized); Agent* agent = static_cast(start_io_thread_async.data); if (agent != nullptr) agent->RequestIoThreadStart(); @@ -141,6 +145,7 @@ static int StartDebugSignalHandler() { #ifdef _WIN32 DWORD WINAPI StartIoThreadProc(void* arg) { + CHECK(start_io_thread_async_initialized); Agent* agent = static_cast(start_io_thread_async.data); if (agent != nullptr) agent->RequestIoThreadStart(); @@ -664,6 +669,7 @@ Agent::Agent(Environment* env) Agent::~Agent() { if (start_io_thread_async.data == this) { + CHECK(start_io_thread_async_initialized.exchange(false)); start_io_thread_async.data = nullptr; // This is global, will never get freed uv_close(reinterpret_cast(&start_io_thread_async), nullptr); @@ -681,6 +687,7 @@ bool Agent::Start(const std::string& path, client_ = std::make_shared(parent_env_, is_main); if (parent_env_->is_main_thread()) { + CHECK_EQ(start_io_thread_async_initialized.exchange(true), false); CHECK_EQ(0, uv_async_init(parent_env_->event_loop(), &start_io_thread_async, StartIoThreadAsyncCallback)); @@ -847,6 +854,7 @@ void Agent::RequestIoThreadStart() { // We need to attempt to interrupt V8 flow (in case Node is running // continuous JS code) and to wake up libuv thread (in case Node is waiting // for IO events) + CHECK(start_io_thread_async_initialized); uv_async_send(&start_io_thread_async); Isolate* isolate = parent_env_->isolate(); v8::Platform* platform = parent_env_->isolate_data()->platform(); @@ -854,6 +862,7 @@ void Agent::RequestIoThreadStart() { platform->GetForegroundTaskRunner(isolate); taskrunner->PostTask(std::make_unique(this)); isolate->RequestInterrupt(StartIoInterrupt, this); + CHECK(start_io_thread_async_initialized); uv_async_send(&start_io_thread_async); } From 35454e000858bff535834713a5588ca7d984118e Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 28 Jan 2019 13:37:13 +0100 Subject: [PATCH 008/223] src: fix indentation in a few node_http2 enums PR-URL: https://github.com/nodejs/node/pull/25761 Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- src/node_http2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node_http2.h b/src/node_http2.h index 4446bf40787371..68c826a6767700 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -236,11 +236,11 @@ struct nghttp2_header : public MemoryRetainer { V(PROXY_CONNECTION, "proxy-connection") enum http_known_headers { -HTTP_KNOWN_HEADER_MIN, + HTTP_KNOWN_HEADER_MIN, #define V(name, value) HTTP_HEADER_##name, -HTTP_KNOWN_HEADERS(V) + HTTP_KNOWN_HEADERS(V) #undef V -HTTP_KNOWN_HEADER_MAX + HTTP_KNOWN_HEADER_MAX }; // While some of these codes are used within the HTTP/2 implementation in @@ -313,7 +313,7 @@ HTTP_KNOWN_HEADER_MAX enum http_status_codes { #define V(name, code) HTTP_STATUS_##name = code, -HTTP_STATUS_CODES(V) + HTTP_STATUS_CODES(V) #undef V }; From be499c3c7b71ccc7a599a276ff1fdf4270027d62 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 27 Jan 2019 22:05:23 +0100 Subject: [PATCH 009/223] src: simplify SlicedArguments Re-use the existing `MaybeStackBuffer` logic for `SlicedArguments`. PR-URL: https://github.com/nodejs/node/pull/25745 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- src/inspector_js_api.cc | 10 +++++----- src/node_perf.cc | 4 ++-- src/util-inl.h | 11 +++++++++++ src/util.h | 27 +-------------------------- 4 files changed, 19 insertions(+), 33 deletions(-) diff --git a/src/inspector_js_api.cc b/src/inspector_js_api.cc index 3547e1022fb615..73493a81cf0573 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -139,7 +139,7 @@ void CallAndPauseOnStart(const FunctionCallbackInfo& args) { env->inspector_agent()->PauseOnNextJavascriptStatement("Break on start"); v8::MaybeLocal retval = args[0].As()->Call(env->context(), args[1], - call_args.size(), call_args.data()); + call_args.length(), call_args.out()); if (!retval.IsEmpty()) { args.GetReturnValue().Set(retval.ToLocalChecked()); } @@ -164,8 +164,8 @@ void InspectorConsoleCall(const FunctionCallbackInfo& info) { v8::True(isolate)).FromJust()); CHECK(!inspector_method.As()->Call(context, info.Holder(), - call_args.size(), - call_args.data()).IsEmpty()); + call_args.length(), + call_args.out()).IsEmpty()); } CHECK(config_object->Delete(context, in_call_key).FromJust()); } @@ -174,8 +174,8 @@ void InspectorConsoleCall(const FunctionCallbackInfo& info) { CHECK(node_method->IsFunction()); node_method.As()->Call(context, info.Holder(), - call_args.size(), - call_args.data()).FromMaybe(Local()); + call_args.length(), + call_args.out()).FromMaybe(Local()); } static void* GetAsyncTask(int64_t asyncId) { diff --git a/src/node_perf.cc b/src/node_perf.cc index 9c0091d2bc9070..cefd0ff26dbf95 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -344,10 +344,10 @@ void TimerFunctionCall(const FunctionCallbackInfo& args) { v8::MaybeLocal ret; if (is_construct_call) { - ret = fn->NewInstance(context, call_args.size(), call_args.data()) + ret = fn->NewInstance(context, call_args.length(), call_args.out()) .FromMaybe(Local()); } else { - ret = fn->Call(context, args.This(), call_args.size(), call_args.data()); + ret = fn->Call(context, args.This(), call_args.length(), call_args.out()); } uint64_t end = PERFORMANCE_NOW(); diff --git a/src/util-inl.h b/src/util-inl.h index 6d612f1eb7c8b7..182c50268d3e0a 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -455,6 +455,17 @@ v8::MaybeLocal ToV8Value(v8::Local context, return v8::Number::New(isolate, static_cast(number)); } +SlicedArguments::SlicedArguments( + const v8::FunctionCallbackInfo& args, size_t start) { + const size_t length = static_cast(args.Length()); + if (start >= length) return; + const size_t size = length - start; + + AllocateSufficientStorage(size); + for (size_t i = 0; i < size; ++i) + (*this)[i] = args[i + start]; +} + } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/src/util.h b/src/util.h index f3a174821ab882..fcb543fcacfaab 100644 --- a/src/util.h +++ b/src/util.h @@ -629,37 +629,12 @@ constexpr T RoundUp(T a, T b) { #define MUST_USE_RESULT #endif -class SlicedArguments { +class SlicedArguments : public MaybeStackBuffer> { public: inline explicit SlicedArguments( const v8::FunctionCallbackInfo& args, size_t start = 0); - inline size_t size() const { return size_; } - inline v8::Local* data() { return data_; } - - private: - size_t size_; - v8::Local* data_; - v8::Local fixed_[64]; - std::vector> dynamic_; }; -SlicedArguments::SlicedArguments( - const v8::FunctionCallbackInfo& args, size_t start) - : size_(0), data_(fixed_) { - const size_t length = static_cast(args.Length()); - if (start >= length) return; - const size_t size = length - start; - - if (size > arraysize(fixed_)) { - dynamic_.resize(size); - data_ = dynamic_.data(); - } - - for (size_t i = 0; i < size; ++i) data_[i] = args[i + start]; - - size_ = size; -} - } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS From b9289f41af33a923916d71dd7f6ec1161af247df Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Mon, 28 Jan 2019 13:58:13 -0500 Subject: [PATCH 010/223] tools: bump cpplint.py to 3d8f6f876d PR-URL: https://github.com/nodejs/node/pull/25771 Fixes: https://github.com/nodejs/node/issues/25760 Refs: https://github.com/cpplint/cpplint/blob/3d8f6f876dd6e3918e5641483298dbc82e65f358/cpplint.py Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Ben Noordhuis --- tools/cpplint.py | 275 ++++++++++++++++++++--------------------------- 1 file changed, 117 insertions(+), 158 deletions(-) diff --git a/tools/cpplint.py b/tools/cpplint.py index 5f5f1400d7ec56..8ca6471179b070 100755 --- a/tools/cpplint.py +++ b/tools/cpplint.py @@ -45,7 +45,6 @@ import copy import getopt import glob -import logging import itertools import math # for log import os @@ -56,10 +55,6 @@ import unicodedata import xml.etree.ElementTree -try: - xrange -except NameError: - xrange = range # if empty, use defaults _header_extensions = set([]) @@ -73,7 +68,7 @@ # option (also supported in CPPLINT.cfg) def GetHeaderExtensions(): if not _header_extensions: - return set(['h', 'hpp', 'hxx', 'h++', 'cuh']) + return set(['h', 'hh', 'hpp', 'hxx', 'h++', 'cuh']) return _header_extensions # The allowed extensions for file names @@ -85,7 +80,6 @@ def GetAllExtensions(): def GetNonHeaderExtensions(): return GetAllExtensions().difference(GetHeaderExtensions()) -logger = logging.getLogger('testrunner') _USAGE = """ @@ -95,7 +89,6 @@ def GetNonHeaderExtensions(): [--root=subdir] [--linelength=digits] [--recursive] [--exclude=path] [--headers=ext1,ext2] - [--logfile=filename] [--extensions=hpp,cpp,...] [file] ... @@ -129,7 +122,7 @@ def GetNonHeaderExtensions(): likely to be false positives. quiet - Suppress output other than linting errors, such as information about + Supress output other than linting errors, such as information about which files have been processed and excluded. filter=-x,+y,... @@ -289,6 +282,7 @@ def GetNonHeaderExtensions(): 'build/forward_decl', 'build/header_guard', 'build/include', + 'build/include_subdir', 'build/include_alpha', 'build/include_order', 'build/include_what_you_use', @@ -359,13 +353,7 @@ def GetNonHeaderExtensions(): # flag. By default all errors are on, so only add here categories that should be # off by default (i.e., categories that must be enabled by the --filter= flags). # All entries here should start with a '-' or '+', as in the --filter= flag. -_DEFAULT_FILTERS = [ - '-build/include', - '-build/include_alpha', - '-build/include_order', - '-build/include_subdir', - '-legal/copyright', - ] +_DEFAULT_FILTERS = ['-build/include_alpha'] # The default list of categories suppressed for C (not C++) files. _DEFAULT_C_SUPPRESSED_CATEGORIES = [ @@ -489,6 +477,18 @@ def GetNonHeaderExtensions(): 'utility', 'valarray', 'vector', + # 17.6.1.2 C++14 headers + 'shared_mutex', + # 17.6.1.2 C++17 headers + 'any', + 'charconv', + 'codecvt', + 'execution', + 'filesystem', + 'memory_resource', + 'optional', + 'string_view', + 'variant', # 17.6.1.2 C++ headers for C library facilities 'cassert', 'ccomplex', @@ -626,12 +626,6 @@ def GetNonHeaderExtensions(): # Match string that indicates we're working on a Linux Kernel file. _SEARCH_KERNEL_FILE = re.compile(r'\b(?:LINT_KERNEL_FILE)') -_NULL_TOKEN_PATTERN = re.compile(r'\bNULL\b') - -_RIGHT_LEANING_POINTER_PATTERN = re.compile(r'[^=|(,\s><);&?:}]' - r'(?= 0 or line.find('*/') >= 0: - return - - for match in _NULL_TOKEN_PATTERN.finditer(line): - error(filename, linenum, 'readability/null_usage', 2, - 'Use nullptr instead of NULL') - -def CheckLeftLeaningPointer(filename, clean_lines, linenum, error): - """Check for left-leaning pointer placement. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # Avoid preprocessor lines - if Match(r'^\s*#', line): - return - - if '/*' in line or '*/' in line: - return - - for match in _RIGHT_LEANING_POINTER_PATTERN.finditer(line): - error(filename, linenum, 'readability/null_usage', 2, - 'Use left leaning pointer instead of right leaning') def GetLineWidth(line): """Determines the width of the line in column positions. @@ -4504,10 +4477,6 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, error(filename, linenum, 'whitespace/tab', 1, 'Tab found; better to use spaces') - if line.find('template<') != -1: - error(filename, linenum, 'whitespace/template', 1, - 'Leave a single space after template, as in `template <...>`') - # One or three blank spaces at the beginning of the line is weird; it's # hard to reconcile that with 2-space indents. # NOTE: here are the conditions rob pike used for his tests. Mine aren't @@ -4601,8 +4570,6 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, CheckSpacingForFunctionCall(filename, clean_lines, linenum, error) CheckCheck(filename, clean_lines, linenum, error) CheckAltTokens(filename, clean_lines, linenum, error) - CheckNullTokens(filename, clean_lines, linenum, error) - CheckLeftLeaningPointer(filename, clean_lines, linenum, error) classinfo = nesting_state.InnermostClass() if classinfo: CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error) @@ -4677,7 +4644,7 @@ def _ClassifyInclude(fileinfo, include, is_system): # Headers with C++ extensions shouldn't be considered C system headers if is_system and os.path.splitext(include)[1] in ['.hpp', '.hxx', '.h++']: - is_system = False + is_system = False if is_system: if is_cpp_h: @@ -4911,8 +4878,6 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, if match: include_state.ResetSection(match.group(1)) - # Make Windows paths like Unix. - fullname = os.path.abspath(filename).replace('\\', '/') # Perform other checks now that we are sure that this is not an include line CheckCasts(filename, clean_lines, linenum, error) @@ -5565,12 +5530,15 @@ def ExpectingFunctionArgs(clean_lines, linenum): ('', ('numeric_limits',)), ('', ('list',)), ('', ('map', 'multimap',)), - ('', ('allocator',)), + ('', ('allocator', 'make_shared', 'make_unique', 'shared_ptr', + 'unique_ptr', 'weak_ptr')), ('', ('queue', 'priority_queue',)), ('', ('set', 'multiset',)), ('', ('stack',)), ('', ('char_traits', 'basic_string',)), ('', ('tuple',)), + ('', ('unordered_map', 'unordered_multimap')), + ('', ('unordered_set', 'unordered_multiset')), ('', ('pair',)), ('', ('vector',)), @@ -5585,7 +5553,7 @@ def ExpectingFunctionArgs(clean_lines, linenum): ('', ('copy', 'max', 'min', 'min_element', 'sort', 'transform', )), - ('', ('swap',)), + ('', ('forward', 'make_pair', 'move', 'swap')), ) _RE_PATTERN_STRING = re.compile(r'\bstring\b') @@ -5716,7 +5684,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, required = {} # A map of header name to linenumber and the template entity. # Example of required: { '': (1219, 'less<>') } - for linenum in xrange(clean_lines.NumLines()): + for linenum in range(clean_lines.NumLines()): line = clean_lines.elided[linenum] if not line or line[0] == '#': continue @@ -5739,8 +5707,13 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, continue for pattern, template, header in _re_pattern_templates: - if pattern.search(line): - required[header] = (linenum, template) + matched = pattern.search(line) + if matched: + # Don't warn about IWYU in non-STL namespaces: + # (We check only the first match per line; good enough.) + prefix = line[:matched.start()] + if prefix.endswith('std::') or not prefix.endswith('::'): + required[header] = (linenum, template) # The policy is that if you #include something in foo.h you don't need to # include it again in foo.cc. Here, we will look at possible includes. @@ -6120,7 +6093,7 @@ def ProcessFileData(filename, file_extension, lines, error, if file_extension in GetHeaderExtensions(): CheckForHeaderGuard(filename, clean_lines, error) - for line in xrange(clean_lines.NumLines()): + for line in range(clean_lines.NumLines()): ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions) @@ -6139,8 +6112,6 @@ def ProcessFileData(filename, file_extension, lines, error, CheckForNewlineAtEOF(filename, lines, error) - CheckInlineHeader(filename, include_state, error) - def ProcessConfigOverrides(filename): """ Loads the configuration files and processes the config overrides. @@ -6190,7 +6161,7 @@ def ProcessConfigOverrides(filename): if pattern.match(base_name): _cpplint_state.PrintInfo('Ignoring "%s": file excluded by ' '"%s". File path component "%s" matches pattern "%s"\n' % - (filename, cfg_file, base_name, val)) + (filename, cfg_file, base_name, val)) return False elif name == 'linelength': global _line_length @@ -6363,7 +6334,6 @@ def ParseArguments(args): (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=', 'counting=', 'filter=', - 'logfile=', 'root=', 'repository=', 'linelength=', @@ -6385,9 +6355,9 @@ def ParseArguments(args): if opt == '--help': PrintUsage(None) elif opt == '--output': - if val not in ('emacs', 'vs7', 'eclipse', 'junit', 'tap'): - PrintUsage( - 'The only allowed output formats are emacs, vs7, eclipse, junit and tap.') + if val not in ('emacs', 'vs7', 'eclipse', 'junit'): + PrintUsage('The only allowed output formats are emacs, vs7, eclipse ' + 'and junit.') output_format = val elif opt == '--verbose': verbosity = int(val) @@ -6408,9 +6378,9 @@ def ParseArguments(args): elif opt == '--linelength': global _line_length try: - _line_length = int(val) + _line_length = int(val) except ValueError: - PrintUsage('Line length must be digits.') + PrintUsage('Line length must be digits.') elif opt == '--exclude': global _excludes if not _excludes: @@ -6419,7 +6389,7 @@ def ParseArguments(args): elif opt == '--extensions': global _valid_extensions try: - _valid_extensions = set(val.split(',')) + _valid_extensions = set(val.split(',')) except ValueError: PrintUsage('Extensions must be comma seperated list.') elif opt == '--headers': @@ -6430,8 +6400,6 @@ def ParseArguments(args): PrintUsage('Extensions must be comma seperated list.') elif opt == '--recursive': recursive = True - elif opt == '--logfile': - logger.addHandler(logging.FileHandler(val, mode='wb')) elif opt == '--quiet': global _quiet _quiet = True @@ -6497,22 +6465,13 @@ def main(): try: # Change stderr to write with replacement characters so we don't die # if we try to print something containing non-ASCII characters. - sys.stderr = codecs.StreamReaderWriter(sys.stderr, - codecs.getreader('utf8'), - codecs.getwriter('utf8'), - 'replace') - - logger.addHandler(logging.StreamHandler(sys.stdout)) - logger.setLevel(logging.INFO) + sys.stderr = codecs.StreamReader(sys.stderr, 'replace') _cpplint_state.ResetErrorCounts() for filename in filenames: - ProcessFile(filename.decode('utf-8'), _cpplint_state.verbose_level) + ProcessFile(filename, _cpplint_state.verbose_level) _cpplint_state.PrintErrorCounts() - if _cpplint_state.output_format == 'tap': - logger.info('TAP version 13') - if _cpplint_state.output_format == 'junit': sys.stderr.write(_cpplint_state.FormatJUnitXML()) From 454278a7013dd95a1f766b3c7054669c6f2d47e5 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Mon, 28 Jan 2019 18:34:46 -0500 Subject: [PATCH 011/223] tools: refloat Node.js patches to cpplint.py * Preserve 3 node-core checks * Preserve patch to `FileInfo.RepositoryName` * Remove TAP to logfile (unused) PR-URL: https://github.com/nodejs/node/pull/25771 Fixes: https://github.com/nodejs/node/issues/25760 Refs: https://github.com/cpplint/cpplint/blob/3d8f6f876dd6e3918e5641483298dbc82e65f358/cpplint.py Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Ben Noordhuis --- tools/cpplint.py | 138 +++++++++++++++++++++++++++++------------------ 1 file changed, 87 insertions(+), 51 deletions(-) diff --git a/tools/cpplint.py b/tools/cpplint.py index 8ca6471179b070..17f341a61d7a2c 100755 --- a/tools/cpplint.py +++ b/tools/cpplint.py @@ -122,7 +122,7 @@ def GetNonHeaderExtensions(): likely to be false positives. quiet - Supress output other than linting errors, such as information about + Suppress output other than linting errors, such as information about which files have been processed and excluded. filter=-x,+y,... @@ -298,11 +298,13 @@ def GetNonHeaderExtensions(): 'readability/constructors', 'readability/fn_size', 'readability/inheritance', + 'readability/pointer_notation', 'readability/multiline_comment', 'readability/multiline_string', 'readability/namespace', 'readability/nolint', 'readability/nul', + 'readability/null_usage', 'readability/strings', 'readability/todo', 'readability/utf8', @@ -353,7 +355,11 @@ def GetNonHeaderExtensions(): # flag. By default all errors are on, so only add here categories that should be # off by default (i.e., categories that must be enabled by the --filter= flags). # All entries here should start with a '-' or '+', as in the --filter= flag. -_DEFAULT_FILTERS = ['-build/include_alpha'] +_DEFAULT_FILTERS = [ + '-build/include', + '-build/include_subdir', + '-legal/copyright', + ] # The default list of categories suppressed for C (not C++) files. _DEFAULT_C_SUPPRESSED_CATEGORIES = [ @@ -626,6 +632,12 @@ def GetNonHeaderExtensions(): # Match string that indicates we're working on a Linux Kernel file. _SEARCH_KERNEL_FILE = re.compile(r'\b(?:LINT_KERNEL_FILE)') +_NULL_TOKEN_PATTERN = re.compile(r'\bNULL\b') + +_RIGHT_LEANING_POINTER_PATTERN = re.compile(r'[^=|(,\s><);&?:}]' + r'(?= 0 or line.find('*/') >= 0: + return + + for match in _NULL_TOKEN_PATTERN.finditer(line): + error(filename, linenum, 'readability/null_usage', 2, + 'Use nullptr instead of NULL') + +def CheckLeftLeaningPointer(filename, clean_lines, linenum, error): + """Check for left-leaning pointer placement. + + Args: + filename: The name of the current file. + clean_lines: A CleansedLines instance containing the file. + linenum: The number of the line to check. + error: The function to call with any errors found. + """ + line = clean_lines.elided[linenum] + + # Avoid preprocessor lines + if Match(r'^\s*#', line): + return + + if '/*' in line or '*/' in line: + return + + for match in _RIGHT_LEANING_POINTER_PATTERN.finditer(line): + error(filename, linenum, 'readability/pointer_notation', 2, + 'Use left leaning pointer instead of right leaning') def GetLineWidth(line): """Determines the width of the line in column positions. @@ -4477,6 +4505,10 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, error(filename, linenum, 'whitespace/tab', 1, 'Tab found; better to use spaces') + if line.find('template<') != -1: + error(filename, linenum, 'whitespace/template', 1, + 'Leave a single space after template, as in `template <...>`') + # One or three blank spaces at the beginning of the line is weird; it's # hard to reconcile that with 2-space indents. # NOTE: here are the conditions rob pike used for his tests. Mine aren't @@ -4570,6 +4602,8 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, CheckSpacingForFunctionCall(filename, clean_lines, linenum, error) CheckCheck(filename, clean_lines, linenum, error) CheckAltTokens(filename, clean_lines, linenum, error) + CheckNullTokens(filename, clean_lines, linenum, error) + CheckLeftLeaningPointer(filename, clean_lines, linenum, error) classinfo = nesting_state.InnermostClass() if classinfo: CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error) @@ -6112,6 +6146,8 @@ def ProcessFileData(filename, file_extension, lines, error, CheckForNewlineAtEOF(filename, lines, error) + CheckInlineHeader(filename, include_state, error) + def ProcessConfigOverrides(filename): """ Loads the configuration files and processes the config overrides. From cc253b5f2d6f43763206ec6b129ddf426d1eaf10 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 27 Jan 2019 16:03:14 -0500 Subject: [PATCH 012/223] process: simplify report uncaught exception logic This commit combines two if statements into a single if statement. Another if statement is replaced with a ternary. PR-URL: https://github.com/nodejs/node/pull/25744 Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan Reviewed-By: Ruben Bridgewater Reviewed-By: Richard Lau --- lib/internal/process/execution.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/internal/process/execution.js b/lib/internal/process/execution.js index b11f54b35d6253..3691f8f9189453 100644 --- a/lib/internal/process/execution.js +++ b/lib/internal/process/execution.js @@ -105,19 +105,14 @@ function createFatalException() { if (er == null || er.domain == null) { try { const report = internalBinding('report'); - if (report != null) { - if (require('internal/options').getOptionValue( - '--experimental-report')) { - const config = {}; - report.syncConfig(config, false); - if (Array.isArray(config.events) && - config.events.includes('exception')) { - if (er) { - report.onUnCaughtException(er.stack); - } else { - report.onUnCaughtException(undefined); - } - } + if (report != null && + require('internal/options') + .getOptionValue('--experimental-report')) { + const config = {}; + report.syncConfig(config, false); + if (Array.isArray(config.events) && + config.events.includes('exception')) { + report.onUnCaughtException(er ? er.stack : undefined); } } } catch {} // NOOP, node_report unavailable. From fd98d62909da63f843525873cd961bc957352127 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 28 Jan 2019 15:43:34 -0800 Subject: [PATCH 013/223] doc: revise style guide Use italics for words-as-words within style guide. Other minor improvements. PR-URL: https://github.com/nodejs/node/pull/25778 Reviewed-By: Vse Mozhet Byt Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- doc/STYLE_GUIDE.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/STYLE_GUIDE.md b/doc/STYLE_GUIDE.md index c274f6023ede02..c046d12397ec2f 100644 --- a/doc/STYLE_GUIDE.md +++ b/doc/STYLE_GUIDE.md @@ -10,14 +10,15 @@ * A [plugin][] is available for some editors to automatically apply these rules. * Changes to documentation should be checked with `make lint-md`. -* American English spelling is preferred. "Capitalize" vs. "Capitalise", - "color" vs. "colour", etc. +* American English spelling is preferred. + * OK: _capitalize_, _color_ + * NOT OK: _capitalise_, _colour_ * Use [serial commas][]. -* Avoid personal pronouns in reference documentation ("I", "you", "we"). +* Avoid personal pronouns (_I_, _you_, _we_) in reference documentation. * Personal pronouns are acceptable in colloquial documentation such as guides. * Use gender-neutral pronouns and gender-neutral plural nouns. - * OK: "they", "their", "them", "folks", "people", "developers" - * NOT OK: "his", "hers", "him", "her", "guys", "dudes" + * OK: _they_, _their_, _them_, _folks_, _people_, _developers_ + * NOT OK: _his_, _hers_, _him_, _her_, _guys_, _dudes_ * When combining wrapping elements (parentheses and quotes), terminal punctuation should be placed: * Inside the wrapping element if the wrapping element contains a complete From accb8aec35beb0eaff747434394f5292e6be3050 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 28 Jan 2019 16:07:31 -0800 Subject: [PATCH 014/223] doc: revise inspect security info in cli.md Revise inspect security information in cli.md. * Reword sentence for brevity. * Use bulleted list for clarity of options. * Eliminate personal pronoun (_you_) per style guide. PR-URL: https://github.com/nodejs/node/pull/25779 Reviewed-By: Vse Mozhet Byt Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- doc/api/cli.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 776bfa085bce5c..06de886c69499a 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -246,9 +246,10 @@ Binding the inspector to a public IP (including `0.0.0.0`) with an open port is insecure, as it allows external hosts to connect to the inspector and perform a [remote code execution][] attack. -If you specify a host, make sure that at least one of the following is true: -either the host is not public, or the port is properly firewalled to disallow -unwanted connections. +If specifying a host, make sure that either: + +* The host is not accessible from public networks. +* A firewall disallows unwanted connections on the port. **More specifically, `--inspect=0.0.0.0` is insecure if the port (`9229` by default) is not firewall-protected.** From f5db5090bce5a165c43c6789b2e958a94cb3146b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 28 Jan 2019 17:03:14 -0800 Subject: [PATCH 015/223] doc: remove outdated COLLABORATOR_GUIDE sentence about breaking changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The TSC has delegated authority over LTS and Current branches to the Release WG. Remove the bullet point about TSC having authority to determine that a breaking change is necessary on LTS and Current release branches. Retaining that authority would require de-chartering the Release WG. Fixes: https://github.com/nodejs/TSC/issues/660 PR-URL: https://github.com/nodejs/node/pull/25780 Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Michaël Zasso Reviewed-By: Richard Lau Reviewed-By: Myles Borins --- COLLABORATOR_GUIDE.md | 1 - 1 file changed, 1 deletion(-) diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 25fab70575ad46..acc8538219cf9b 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -282,7 +282,6 @@ providing a Public API in such cases. * Resolving critical security issues. * Fixing a critical bug (e.g. fixing a memory leak) requires a breaking change. - * There is TSC consensus that the change is required. * If a breaking commit does accidentally land in a Current or LTS branch, an attempt to fix the issue will be made before the next release; If no fix is provided then the commit will be reverted. From 0b014d5299317a98838294260229109b9d7dd86d Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Mon, 28 Jan 2019 20:20:53 +0800 Subject: [PATCH 016/223] src: make deleted functions public in node.h Signed-off-by: gengjiawen PR-URL: https://github.com/nodejs/node/pull/25764 Reviewed-By: Matheus Marchini Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann --- src/node.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node.h b/src/node.h index fbf9128be42429..43795e0e391b9c 100644 --- a/src/node.h +++ b/src/node.h @@ -653,14 +653,14 @@ class NODE_EXTERN CallbackScope { async_context asyncContext); ~CallbackScope(); - private: - InternalCallbackScope* private_; - v8::TryCatch try_catch_; - void operator=(const CallbackScope&) = delete; void operator=(CallbackScope&&) = delete; CallbackScope(const CallbackScope&) = delete; CallbackScope(CallbackScope&&) = delete; + + private: + InternalCallbackScope* private_; + v8::TryCatch try_catch_; }; /* An API specific to emit before/after callbacks is unnecessary because From b779c072d05c8deb4bf53a048b610ede6b38073d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 26 Jan 2019 00:13:01 +0100 Subject: [PATCH 017/223] src: make `StreamPipe::Unpipe()` more resilient Clean up `StreamPipe::Unpipe()` to be more resilient against unexpected exceptions, in particular while executing its `MakeCallback()` line (which can fail in the presence of termination exceptions), and clean up the getter/setter part of the code to match that pattern as well (even though it should not fail as part of regular operations). PR-URL: https://github.com/nodejs/node/pull/25716 Reviewed-By: Joyee Cheung Reviewed-By: Daniel Bevenius --- src/stream_pipe.cc | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/stream_pipe.cc b/src/stream_pipe.cc index e58aa929e4b30e..19d732d6592aaa 100644 --- a/src/stream_pipe.cc +++ b/src/stream_pipe.cc @@ -4,6 +4,7 @@ using v8::Context; using v8::External; +using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; using v8::Local; @@ -77,8 +78,12 @@ void StreamPipe::Unpipe() { Context::Scope context_scope(env->context()); Local object = pipe->object(); - if (object->Has(env->context(), env->onunpipe_string()).FromJust()) { - pipe->MakeCallback(env->onunpipe_string(), 0, nullptr).ToLocalChecked(); + Local onunpipe; + if (!object->Get(env->context(), env->onunpipe_string()).ToLocal(&onunpipe)) + return; + if (onunpipe->IsFunction() && + pipe->MakeCallback(onunpipe.As(), 0, nullptr).IsEmpty()) { + return; } // Set all the links established in the constructor to `null`. @@ -86,21 +91,22 @@ void StreamPipe::Unpipe() { Local source_v; Local sink_v; - source_v = object->Get(env->context(), env->source_string()) - .ToLocalChecked(); - sink_v = object->Get(env->context(), env->sink_string()) - .ToLocalChecked(); - CHECK(source_v->IsObject()); - CHECK(sink_v->IsObject()); - - object->Set(env->context(), env->source_string(), null).FromJust(); - object->Set(env->context(), env->sink_string(), null).FromJust(); - source_v.As()->Set(env->context(), - env->pipe_target_string(), - null).FromJust(); - sink_v.As()->Set(env->context(), - env->pipe_source_string(), - null).FromJust(); + if (!object->Get(env->context(), env->source_string()).ToLocal(&source_v) || + !object->Get(env->context(), env->sink_string()).ToLocal(&sink_v) || + !source_v->IsObject() || !sink_v->IsObject()) { + return; + } + + if (object->Set(env->context(), env->source_string(), null).IsNothing() || + object->Set(env->context(), env->sink_string(), null).IsNothing() || + source_v.As() + ->Set(env->context(), env->pipe_target_string(), null) + .IsNothing() || + sink_v.As() + ->Set(env->context(), env->pipe_source_string(), null) + .IsNothing()) { + return; + } }, static_cast(this), object()); } From 25c19eb1d8877041a5a1ab711b43b1f85a2e72f1 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Mon, 14 Jan 2019 09:14:13 +0100 Subject: [PATCH 018/223] http: make timeout event work with agent timeout The `'timeout'` event is currently not emitted on the `ClientRequest` instance when the socket timeout expires if only the `timeout` option of the agent is set. This happens because, under these circumstances, `listenSocketTimeout()` is not called. This commit fixes the issue by calling it also when only the agent `timeout` option is set. PR-URL: https://github.com/nodejs/node/pull/25488 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- lib/_http_client.js | 5 +++- .../test-http-agent-timeout-option.js | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-http-agent-timeout-option.js diff --git a/lib/_http_client.js b/lib/_http_client.js index 603d37de9b19a6..c4259184a6c5b3 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -655,7 +655,10 @@ function tickOnSocket(req, socket) { socket.on('end', socketOnEnd); socket.on('close', socketCloseListener); - if (req.timeout !== undefined) { + if ( + req.timeout !== undefined || + (req.agent && req.agent.options && req.agent.options.timeout) + ) { listenSocketTimeout(req); } req.emit('socket', socket); diff --git a/test/parallel/test-http-agent-timeout-option.js b/test/parallel/test-http-agent-timeout-option.js new file mode 100644 index 00000000000000..4fcfc1f1da54b1 --- /dev/null +++ b/test/parallel/test-http-agent-timeout-option.js @@ -0,0 +1,23 @@ +'use strict'; + +const { expectsError, mustCall } = require('../common'); +const { Agent, get } = require('http'); + +// Test that the `'timeout'` event is emitted on the `ClientRequest` instance +// when the socket timeout set via the `timeout` option of the `Agent` expires. + +const request = get({ + agent: new Agent({ timeout: 500 }), + // Non-routable IP address to prevent the connection from being established. + host: '192.0.2.1' +}); + +request.on('error', expectsError({ + type: Error, + code: 'ECONNRESET', + message: 'socket hang up' +})); + +request.on('timeout', mustCall(() => { + request.abort(); +})); From 579220815adfbf2043e950923fe6b457a96fe667 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 22 Jan 2019 03:09:45 +0800 Subject: [PATCH 019/223] test: pull html/webappapis/timers WPT Using ``` git node wpt html/webappapis/timers ``` PR-URL: https://github.com/nodejs/node/pull/25618 Reviewed-By: James M Snell --- test/fixtures/wpt/README.md | 1 + .../webappapis/timers/evil-spec-example.html | 23 +++++++++++++ .../timers/missing-timeout-setinterval.any.js | 34 +++++++++++++++++++ .../timers/negative-setinterval.html | 17 ++++++++++ .../timers/negative-settimeout.html | 8 +++++ .../timers/type-long-setinterval.html | 13 +++++++ .../timers/type-long-settimeout.html | 8 +++++ test/fixtures/wpt/versions.json | 4 +++ 8 files changed, 108 insertions(+) create mode 100644 test/fixtures/wpt/html/webappapis/timers/evil-spec-example.html create mode 100644 test/fixtures/wpt/html/webappapis/timers/missing-timeout-setinterval.any.js create mode 100644 test/fixtures/wpt/html/webappapis/timers/negative-setinterval.html create mode 100644 test/fixtures/wpt/html/webappapis/timers/negative-settimeout.html create mode 100644 test/fixtures/wpt/html/webappapis/timers/type-long-setinterval.html create mode 100644 test/fixtures/wpt/html/webappapis/timers/type-long-settimeout.html diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index 457a05f07d5306..51450f918bd1b8 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -16,6 +16,7 @@ Last update: - resources: https://github.com/web-platform-tests/wpt/tree/679a364421/resources - interfaces: https://github.com/web-platform-tests/wpt/tree/712c9f275e/interfaces - html/webappapis/microtask-queuing: https://github.com/web-platform-tests/wpt/tree/0c3bed38df/html/webappapis/microtask-queuing +- html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/ddfe9c089b/html/webappapis/timers [Web Platform Tests]: https://github.com/web-platform-tests/wpt [`git node wpt`]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-wpt diff --git a/test/fixtures/wpt/html/webappapis/timers/evil-spec-example.html b/test/fixtures/wpt/html/webappapis/timers/evil-spec-example.html new file mode 100644 index 00000000000000..77a8746908d742 --- /dev/null +++ b/test/fixtures/wpt/html/webappapis/timers/evil-spec-example.html @@ -0,0 +1,23 @@ + +Interaction of setTimeout and WebIDL + + + + + + +
+ diff --git a/test/fixtures/wpt/html/webappapis/timers/missing-timeout-setinterval.any.js b/test/fixtures/wpt/html/webappapis/timers/missing-timeout-setinterval.any.js new file mode 100644 index 00000000000000..33a1cc073c8c1f --- /dev/null +++ b/test/fixtures/wpt/html/webappapis/timers/missing-timeout-setinterval.any.js @@ -0,0 +1,34 @@ +function timeout_trampoline(t, timeout, message) { + t.step_timeout(function() { + // Yield in case we managed to be called before the second interval callback. + t.step_timeout(function() { + assert_unreached(message); + }, timeout); + }, timeout); +} + +async_test(function(t) { + let ctr = 0; + let h = setInterval(t.step_func(function() { + if (++ctr == 2) { + clearInterval(h); + t.done(); + return; + } + }) /* no interval */); + + timeout_trampoline(t, 100, "Expected setInterval callback to be called two times"); +}, "Calling setInterval with no interval should be the same as if called with 0 interval"); + +async_test(function(t) { + let ctr = 0; + let h = setInterval(t.step_func(function() { + if (++ctr == 2) { + clearInterval(h); + t.done(); + return; + } + }), undefined); + + timeout_trampoline(t, 100, "Expected setInterval callback to be called two times"); +}, "Calling setInterval with undefined interval should be the same as if called with 0 interval"); diff --git a/test/fixtures/wpt/html/webappapis/timers/negative-setinterval.html b/test/fixtures/wpt/html/webappapis/timers/negative-setinterval.html new file mode 100644 index 00000000000000..430d13c58aab69 --- /dev/null +++ b/test/fixtures/wpt/html/webappapis/timers/negative-setinterval.html @@ -0,0 +1,17 @@ + +Negative timeout in setInterval + + + diff --git a/test/fixtures/wpt/html/webappapis/timers/negative-settimeout.html b/test/fixtures/wpt/html/webappapis/timers/negative-settimeout.html new file mode 100644 index 00000000000000..57e88ee701d807 --- /dev/null +++ b/test/fixtures/wpt/html/webappapis/timers/negative-settimeout.html @@ -0,0 +1,8 @@ + +Negative timeout in setTimeout + + + diff --git a/test/fixtures/wpt/html/webappapis/timers/type-long-setinterval.html b/test/fixtures/wpt/html/webappapis/timers/type-long-setinterval.html new file mode 100644 index 00000000000000..af029959984668 --- /dev/null +++ b/test/fixtures/wpt/html/webappapis/timers/type-long-setinterval.html @@ -0,0 +1,13 @@ + +Type long timeout for setInterval + + + diff --git a/test/fixtures/wpt/html/webappapis/timers/type-long-settimeout.html b/test/fixtures/wpt/html/webappapis/timers/type-long-settimeout.html new file mode 100644 index 00000000000000..31fa4f1264211e --- /dev/null +++ b/test/fixtures/wpt/html/webappapis/timers/type-long-settimeout.html @@ -0,0 +1,8 @@ + +Type long timeout for setTimeout + + + diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index 4ca402a3491d4c..7bd65d90237370 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -22,5 +22,9 @@ "html/webappapis/microtask-queuing": { "commit": "0c3bed38df6d9dcd1441873728fb5c1bb59c92df", "path": "html/webappapis/microtask-queuing" + }, + "html/webappapis/timers": { + "commit": "ddfe9c089bab565a9d3aa37bdef63d8012c1a94c", + "path": "html/webappapis/timers" } } \ No newline at end of file From 5bffcf62465db170525df924f1662a62044f7e85 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 22 Jan 2019 03:12:14 +0800 Subject: [PATCH 020/223] test: run html/webappapis/timers WPT PR-URL: https://github.com/nodejs/node/pull/25618 Reviewed-By: James M Snell --- test/wpt/status/html/webappapis/timers.json | 1 + test/wpt/test-timers.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 test/wpt/status/html/webappapis/timers.json create mode 100644 test/wpt/test-timers.js diff --git a/test/wpt/status/html/webappapis/timers.json b/test/wpt/status/html/webappapis/timers.json new file mode 100644 index 00000000000000..0967ef424bce67 --- /dev/null +++ b/test/wpt/status/html/webappapis/timers.json @@ -0,0 +1 @@ +{} diff --git a/test/wpt/test-timers.js b/test/wpt/test-timers.js new file mode 100644 index 00000000000000..a9fc262d3b1beb --- /dev/null +++ b/test/wpt/test-timers.js @@ -0,0 +1,18 @@ +'use strict'; + +// Flags: --expose-internals + +require('../common'); +const { WPTRunner } = require('../common/wpt'); + +const runner = new WPTRunner('html/webappapis/timers'); + +// Copy global descriptors from the global object +runner.copyGlobalsFromObject(global, [ + 'setInterval', + 'clearInterval', + 'setTimeout', + 'clearTimeout' +]); + +runner.runJsTests(); From f6c8820b46a164545dd03fb4a8c8e2c65c167d3b Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 28 Jan 2019 20:23:52 -0500 Subject: [PATCH 021/223] report: fix typo in error message PR-URL: https://github.com/nodejs/node/pull/25782 Reviewed-By: Richard Lau Reviewed-By: Rich Trott Reviewed-By: Gireesh Punathil Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- lib/internal/process/report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/process/report.js b/lib/internal/process/report.js index 5ff1238f40ed78..f83282ca1920b9 100644 --- a/lib/internal/process/report.js +++ b/lib/internal/process/report.js @@ -120,7 +120,7 @@ exports.setup = function() { if (err == null) { return nr.getReport(new ERR_SYNTHETIC().stack); } else if (typeof err !== 'object') { - throw new ERR_INVALID_ARG_TYPE('err', 'Objct', err); + throw new ERR_INVALID_ARG_TYPE('err', 'Object', err); } else { return nr.getReport(err.stack); } From b1e0c43abdc1ec69a03fa265d152b2f9f690c673 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 28 Jan 2019 20:08:10 -0500 Subject: [PATCH 022/223] report: disambiguate glibc versions - Give the glibc version entries more specific names. - Group all of the glibc version reporting together. PR-URL: https://github.com/nodejs/node/pull/25781 Reviewed-By: Richard Lau Reviewed-By: Gireesh Punathil Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- doc/api/report.md | 4 ++-- src/node_report.cc | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/api/report.md b/doc/api/report.md index ecf44b20cf0bc2..cc099993057e2e 100644 --- a/doc/api/report.md +++ b/doc/api/report.md @@ -36,7 +36,8 @@ is provided below for reference. "child" ], "nodejsVersion": "v12.0.0-pre", - "glibcVersion": "2.17", + "glibcVersionRuntime": "2.17", + "glibcVersionCompiler": "2.17", "wordSize": "64 bit", "componentVersions": { "node": "12.0.0-pre", @@ -55,7 +56,6 @@ is provided below for reference. "release": "node" }, "osVersion": "Linux 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018", - "glibc": "2.17", "machine": "Linux 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018test_machine x86_64" }, "javascriptStack": { diff --git a/src/node_report.cc b/src/node_report.cc index a9861f931e847c..381a40e7861f2a 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -323,11 +323,22 @@ static void PrintVersionInformation(JSONWriter* writer) { buf << "v" << NODE_VERSION_STRING; writer->json_keyvalue("nodejsVersion", buf.str()); buf.str(""); + +#ifndef _WIN32 + // Report compiler and runtime glibc versions where possible. + const char* (*libc_version)(); + *(reinterpret_cast(&libc_version)) = + dlsym(RTLD_DEFAULT, "gnu_get_libc_version"); + if (libc_version != nullptr) + writer->json_keyvalue("glibcVersionRuntime", (*libc_version)()); +#endif /* _WIN32 */ + #ifdef __GLIBC__ buf << __GLIBC__ << "." << __GLIBC_MINOR__; - writer->json_keyvalue("glibcVersion", buf.str()); + writer->json_keyvalue("glibcVersionCompiler", buf.str()); buf.str(""); #endif + // Report Process word size writer->json_keyvalue("wordSize", sizeof(void*) * 8); @@ -433,13 +444,6 @@ static void PrintVersionInformation(JSONWriter* writer) { buf.str(""); buf << os_info.nodename << " " << os_info.machine; writer->json_keyvalue("machine", buf.str()); - - const char* (*libc_version)(); - *(reinterpret_cast(&libc_version)) = - dlsym(RTLD_DEFAULT, "gnu_get_libc_version"); - if (libc_version != nullptr) { - writer->json_keyvalue("glibc", (*libc_version)()); - } } #endif } From 998cea567fae82a30cb17b4e1462eb9d99b3ad7e Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Tue, 18 Dec 2018 09:55:56 -0500 Subject: [PATCH 023/223] src: workaround MSVC compiler bug PR-URL: https://github.com/nodejs/node/pull/25596 Fixes: https://github.com/nodejs/node/issues/25593 Refs: https://developercommunity.visualstudio.com/content/problem/432157/dynamic-initializers-out-of-order.html Reviewed-By: Bartosz Sosnowski Reviewed-By: Anna Henningsen --- src/node_options.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/node_options.cc b/src/node_options.cc index cc8bf61928be77..cbedb966aa2cd9 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -107,6 +107,20 @@ void EnvironmentOptions::CheckOptions(std::vector* errors) { namespace options_parser { +// Explicitly access the singelton instances in their dependancy order. +// This was moved here to workaround a compiler bug. +// Refs: https://github.com/nodejs/node/issues/25593 + +#if HAVE_INSPECTOR +const DebugOptionsParser DebugOptionsParser::instance; +#endif // HAVE_INSPECTOR + +const EnvironmentOptionsParser EnvironmentOptionsParser::instance; + +const PerIsolateOptionsParser PerIsolateOptionsParser::instance; + +const PerProcessOptionsParser PerProcessOptionsParser::instance; + // XXX: If you add an option here, please also add it to doc/node.1 and // doc/api/cli.md // TODO(addaleax): Make that unnecessary. @@ -143,10 +157,6 @@ DebugOptionsParser::DebugOptionsParser() { AddAlias("--debug-brk=", { "--inspect-port", "--debug-brk" }); } -#if HAVE_INSPECTOR -const DebugOptionsParser DebugOptionsParser::instance; -#endif // HAVE_INSPECTOR - EnvironmentOptionsParser::EnvironmentOptionsParser() { AddOption("--experimental-modules", "experimental ES Module support and caching modules", @@ -275,8 +285,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { #endif // HAVE_INSPECTOR } -const EnvironmentOptionsParser EnvironmentOptionsParser::instance; - PerIsolateOptionsParser::PerIsolateOptionsParser() { AddOption("--track-heap-objects", "track heap object allocations for heap snapshots", @@ -334,8 +342,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser() { &PerIsolateOptions::get_per_env_options); } -const PerIsolateOptionsParser PerIsolateOptionsParser::instance; - PerProcessOptionsParser::PerProcessOptionsParser() { AddOption("--title", "the process title to use on startup", @@ -442,8 +448,6 @@ PerProcessOptionsParser::PerProcessOptionsParser() { &PerProcessOptions::get_per_isolate_options); } -const PerProcessOptionsParser PerProcessOptionsParser::instance; - inline std::string RemoveBrackets(const std::string& host) { if (!host.empty() && host.front() == '[' && host.back() == ']') return host.substr(1, host.size() - 2); From 7a1f166cfa3c5bc48f31e4abefeb28d94cf896c7 Mon Sep 17 00:00:00 2001 From: Kei Ito Date: Tue, 29 Jan 2019 19:40:45 +0900 Subject: [PATCH 024/223] doc: add documentation for request.path The field has been added in v0.4.0. PR-URL: https://github.com/nodejs/node/pull/25788 Refs: https://github.com/nodejs/node/commit/b09c5889bee8388a6710ecf75d76ca242e0684bd#diff-1c0f1c434b17b7f8795d44a51a14320aR814 Refs: https://github.com/nodejs/node/blob/380929ec0c4c4004b522bed5e3800ebce2b68bfd/test/parallel/test-http-client-defaults.js Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- doc/api/http.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/api/http.md b/doc/api/http.md index 592d2a1609dbb1..7f0b39cbb1cd9a 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -633,6 +633,13 @@ const cookie = request.getHeader('Cookie'); Limits maximum response headers count. If set to 0, no limit will be applied. +### request.path + + +* {string} The request path. Read-only. + ### request.removeHeader(name) + +* `session` {Buffer} + +The `'session'` event is emitted on a client `tls.TLSSocket` when a new session +or TLS ticket is available. This may or may not be before the handshake is +complete, depending on the TLS protocol version that was negotiated. The event +is not emitted on the server, or if a new session was not created, for example, +when the connection was resumed. For some TLS protocol versions the event may be +emitted multiple times, in which case all the sessions can be used for +resumption. + +On the client, the `session` can be provided to the `session` option of +[`tls.connect()`][] to resume the connection. + +See [Session Resumption][] for more information. + +Note: For TLS1.2 and below, [`tls.TLSSocket.getSession()`][] can be called once +the handshake is complete. For TLS1.3, only ticket based resumption is allowed +by the protocol, multiple tickets are sent, and the tickets aren't sent until +later, after the handshake completes, so it is necessary to wait for the +`'session'` event to get a resumable session. Future-proof applications are +recommended to use the `'session'` event instead of `getSession()` to ensure +they will work for all TLS protocol versions. Applications that only expect to +get or use 1 session should listen for this event only once: + +```js +tlsSocket.once('session', (session) => { + // The session can be used immediately or later. + tls.connect({ + session: session, + // Other connect options... + }); +}); +``` + ### tlsSocket.address() ` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // ` + +* `options` {Object} + * `resolution` {number} The sampling rate in milliseconds. Must be greater + than zero. Defaults to `10`. +* Returns: {Histogram} + +Creates a `Histogram` object that samples and reports the event loop delay +over time. + +Using a timer to detect approximate event loop delay works because the +execution of timers is tied specifically to the lifecycle of the libuv +event loop. That is, a delay in the loop will cause a delay in the execution +of the timer, and those delays are specifically what this API is intended to +detect. + +```js +const { monitorEventLoopDelay } = require('perf_hooks'); +const h = monitorEventLoopDelay({ resolution: 20 }); +h.enable(); +// Do something +h.disable(); +console.log(h.min); +console.log(h.max); +console.log(h.mean); +console.log(h.stddev); +console.log(h.percentiles); +console.log(h.percentile(50)); +console.log(h.percentile(99)); +``` + +### Class: Histogram + +Tracks the event loop delay at a given sampling rate. + +#### histogram.disable() + + +* Returns: {boolean} + +Disables the event loop delay sample timer. Returns `true` if the timer was +stopped, `false` if it was already stopped. + +#### histogram.enable() + + +* Returns: {boolean} + +Enables the event loop delay sample timer. Returns `true` if the timer was +started, `false` if it was already started. + +#### histogram.exceeds + +* Value: {number} + +The number of times the event loop delay exceeded the maximum 1 hour event +loop delay threshold. + +#### histogram.max + +* Value: {number} + +The maximum recorded event loop delay. + +#### histogram.mean + +* Value: {number} + +The mean of the recorded event loop delays. + +#### histogram.min + + +* Value: {number} + +The minimum recorded event loop delay. + +#### histogram.percentile(percentile) + +* `percentile` {number} A percentile value between 1 and 100. + +Returns the value at the given percentile. + +#### histogram.percentiles + +* Value: {Map} + +Returns a `Map` object detailing the accumulated percentile distribution. + +#### histogram.reset() + + +Resets the collected histogram data. + +#### histogram.stddev + +* Value: {number} + +The standard deviation of the recorded event loop delays. + ## Examples ### Measuring the duration of async operations diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index 041bbf68f2f6c4..02c617dfdf9e0f 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -1,6 +1,7 @@ 'use strict'; const { + ELDHistogram: _ELDHistogram, PerformanceEntry, mark: _mark, clearMark: _clearMark, @@ -36,6 +37,8 @@ const L = require('internal/linkedlist'); const kInspect = require('internal/util').customInspectSymbol; const { inherits } = require('util'); +const kHandle = Symbol('handle'); +const kMap = Symbol('map'); const kCallback = Symbol('callback'); const kTypes = Symbol('types'); const kEntries = Symbol('entries'); @@ -547,9 +550,73 @@ function sortedInsert(list, entry) { list.splice(location, 0, entry); } +class ELDHistogram { + constructor(handle) { + this[kHandle] = handle; + this[kMap] = new Map(); + } + + reset() { this[kHandle].reset(); } + enable() { return this[kHandle].enable(); } + disable() { return this[kHandle].disable(); } + + get exceeds() { return this[kHandle].exceeds(); } + get min() { return this[kHandle].min(); } + get max() { return this[kHandle].max(); } + get mean() { return this[kHandle].mean(); } + get stddev() { return this[kHandle].stddev(); } + percentile(percentile) { + if (typeof percentile !== 'number') { + const errors = lazyErrors(); + throw new errors.ERR_INVALID_ARG_TYPE('percentile', 'number', percentile); + } + if (percentile <= 0 || percentile > 100) { + const errors = lazyErrors(); + throw new errors.ERR_INVALID_ARG_VALUE.RangeError('percentile', + percentile); + } + return this[kHandle].percentile(percentile); + } + get percentiles() { + this[kMap].clear(); + this[kHandle].percentiles(this[kMap]); + return this[kMap]; + } + + [kInspect]() { + return { + min: this.min, + max: this.max, + mean: this.mean, + stddev: this.stddev, + percentiles: this.percentiles, + exceeds: this.exceeds + }; + } +} + +function monitorEventLoopDelay(options = {}) { + if (typeof options !== 'object' || options === null) { + const errors = lazyErrors(); + throw new errors.ERR_INVALID_ARG_TYPE('options', 'Object', options); + } + const { resolution = 10 } = options; + if (typeof resolution !== 'number') { + const errors = lazyErrors(); + throw new errors.ERR_INVALID_ARG_TYPE('options.resolution', + 'number', resolution); + } + if (resolution <= 0 || !Number.isSafeInteger(resolution)) { + const errors = lazyErrors(); + throw new errors.ERR_INVALID_OPT_VALUE.RangeError('resolution', resolution); + } + return new ELDHistogram(new _ELDHistogram(resolution)); +} + module.exports = { performance, - PerformanceObserver + PerformanceObserver, + monitorEventLoopDelay }; Object.defineProperty(module.exports, 'constants', { diff --git a/node.gyp b/node.gyp index 9a417d60fd7fbf..8f974b020b8e75 100644 --- a/node.gyp +++ b/node.gyp @@ -252,8 +252,9 @@ ], 'include_dirs': [ 'src', - 'deps/v8/include', + 'deps/v8/include' ], + 'dependencies': [ 'deps/histogram/histogram.gyp:histogram' ], # - "C4244: conversion from 'type1' to 'type2', possible loss of data" # Ususaly safe. Disable for `dep`, enable for `src` @@ -351,6 +352,7 @@ 'src', '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h ], + 'dependencies': [ 'deps/histogram/histogram.gyp:histogram' ], 'sources': [ 'src/async_wrap.cc', @@ -445,6 +447,8 @@ 'src/env.h', 'src/env-inl.h', 'src/handle_wrap.h', + 'src/histogram.h', + 'src/histogram-inl.h', 'src/http_parser_adaptor.h', 'src/js_stream.h', 'src/memory_tracker.h', @@ -952,6 +956,7 @@ '<(node_lib_target_name)', 'rename_node_bin_win', 'deps/gtest/gtest.gyp:gtest', + 'deps/histogram/histogram.gyp:histogram', 'node_dtrace_header', 'node_dtrace_ustack', 'node_dtrace_provider', diff --git a/node.gypi b/node.gypi index 689138c15b5705..c07b5ea70431ff 100644 --- a/node.gypi +++ b/node.gypi @@ -237,6 +237,7 @@ [ 'OS=="aix"', { 'defines': [ '_LINUX_SOURCE_COMPAT', + '__STDC_FORMAT_MACROS' ], 'conditions': [ [ 'force_load=="true"', { diff --git a/src/histogram-inl.h b/src/histogram-inl.h new file mode 100644 index 00000000000000..3135041f7387a9 --- /dev/null +++ b/src/histogram-inl.h @@ -0,0 +1,63 @@ +#ifndef SRC_HISTOGRAM_INL_H_ +#define SRC_HISTOGRAM_INL_H_ + +#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#include "histogram.h" +#include "node_internals.h" + +namespace node { + +inline Histogram::Histogram(int64_t lowest, int64_t highest, int figures) { + CHECK_EQ(0, hdr_init(lowest, highest, figures, &histogram_)); +} + +inline Histogram::~Histogram() { + hdr_close(histogram_); +} + +inline void Histogram::Reset() { + hdr_reset(histogram_); +} + +inline bool Histogram::Record(int64_t value) { + return hdr_record_value(histogram_, value); +} + +inline int64_t Histogram::Min() { + return hdr_min(histogram_); +} + +inline int64_t Histogram::Max() { + return hdr_max(histogram_); +} + +inline double Histogram::Mean() { + return hdr_mean(histogram_); +} + +inline double Histogram::Stddev() { + return hdr_stddev(histogram_); +} + +inline double Histogram::Percentile(double percentile) { + CHECK_GT(percentile, 0); + CHECK_LE(percentile, 100); + return hdr_value_at_percentile(histogram_, percentile); +} + +inline void Histogram::Percentiles(std::function fn) { + hdr_iter iter; + hdr_iter_percentile_init(&iter, histogram_, 1); + while (hdr_iter_next(&iter)) { + double key = iter.specifics.percentiles.percentile; + double value = iter.value; + fn(key, value); + } +} + +} // namespace node + +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#endif // SRC_HISTOGRAM_INL_H_ diff --git a/src/histogram.h b/src/histogram.h new file mode 100644 index 00000000000000..eb94af5da2a997 --- /dev/null +++ b/src/histogram.h @@ -0,0 +1,38 @@ +#ifndef SRC_HISTOGRAM_H_ +#define SRC_HISTOGRAM_H_ + +#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#include "hdr_histogram.h" +#include +#include + +namespace node { + +class Histogram { + public: + inline Histogram(int64_t lowest, int64_t highest, int figures = 3); + inline virtual ~Histogram(); + + inline bool Record(int64_t value); + inline void Reset(); + inline int64_t Min(); + inline int64_t Max(); + inline double Mean(); + inline double Stddev(); + inline double Percentile(double percentile); + inline void Percentiles(std::function fn); + + size_t GetMemorySize() const { + return hdr_get_memory_size(histogram_); + } + + private: + hdr_histogram* histogram_; +}; + +} // namespace node + +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#endif // SRC_HISTOGRAM_H_ diff --git a/src/node_perf.cc b/src/node_perf.cc index 33dd1d2051872c..b9c0183a83d930 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -1,5 +1,10 @@ +#include "aliased_buffer.h" #include "node_internals.h" #include "node_perf.h" +#include "node_buffer.h" +#include "node_process.h" + +#include #ifdef __POSIX__ #include // gettimeofday @@ -20,6 +25,7 @@ using v8::HandleScope; using v8::Integer; using v8::Isolate; using v8::Local; +using v8::Map; using v8::MaybeLocal; using v8::Name; using v8::NewStringType; @@ -387,6 +393,168 @@ void Timerify(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(wrap); } +// Event Loop Timing Histogram +namespace { +static void ELDHistogramMin(const FunctionCallbackInfo& args) { + ELDHistogram* histogram; + ASSIGN_OR_RETURN_UNWRAP(&histogram, args.Holder()); + double value = static_cast(histogram->Min()); + args.GetReturnValue().Set(value); +} + +static void ELDHistogramMax(const FunctionCallbackInfo& args) { + ELDHistogram* histogram; + ASSIGN_OR_RETURN_UNWRAP(&histogram, args.Holder()); + double value = static_cast(histogram->Max()); + args.GetReturnValue().Set(value); +} + +static void ELDHistogramMean(const FunctionCallbackInfo& args) { + ELDHistogram* histogram; + ASSIGN_OR_RETURN_UNWRAP(&histogram, args.Holder()); + args.GetReturnValue().Set(histogram->Mean()); +} + +static void ELDHistogramExceeds(const FunctionCallbackInfo& args) { + ELDHistogram* histogram; + ASSIGN_OR_RETURN_UNWRAP(&histogram, args.Holder()); + double value = static_cast(histogram->Exceeds()); + args.GetReturnValue().Set(value); +} + +static void ELDHistogramStddev(const FunctionCallbackInfo& args) { + ELDHistogram* histogram; + ASSIGN_OR_RETURN_UNWRAP(&histogram, args.Holder()); + args.GetReturnValue().Set(histogram->Stddev()); +} + +static void ELDHistogramPercentile(const FunctionCallbackInfo& args) { + ELDHistogram* histogram; + ASSIGN_OR_RETURN_UNWRAP(&histogram, args.Holder()); + CHECK(args[0]->IsNumber()); + double percentile = args[0].As()->Value(); + args.GetReturnValue().Set(histogram->Percentile(percentile)); +} + +static void ELDHistogramPercentiles(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + ELDHistogram* histogram; + ASSIGN_OR_RETURN_UNWRAP(&histogram, args.Holder()); + CHECK(args[0]->IsMap()); + Local map = args[0].As(); + histogram->Percentiles([&](double key, double value) { + map->Set(env->context(), + Number::New(env->isolate(), key), + Number::New(env->isolate(), value)).IsEmpty(); + }); +} + +static void ELDHistogramEnable(const FunctionCallbackInfo& args) { + ELDHistogram* histogram; + ASSIGN_OR_RETURN_UNWRAP(&histogram, args.Holder()); + args.GetReturnValue().Set(histogram->Enable()); +} + +static void ELDHistogramDisable(const FunctionCallbackInfo& args) { + ELDHistogram* histogram; + ASSIGN_OR_RETURN_UNWRAP(&histogram, args.Holder()); + args.GetReturnValue().Set(histogram->Disable()); +} + +static void ELDHistogramReset(const FunctionCallbackInfo& args) { + ELDHistogram* histogram; + ASSIGN_OR_RETURN_UNWRAP(&histogram, args.Holder()); + histogram->ResetState(); +} + +static void ELDHistogramNew(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + CHECK(args.IsConstructCall()); + int32_t resolution = args[0]->IntegerValue(env->context()).FromJust(); + CHECK_GT(resolution, 0); + new ELDHistogram(env, args.This(), resolution); +} +} // namespace + +ELDHistogram::ELDHistogram( + Environment* env, + Local wrap, + int32_t resolution) : BaseObject(env, wrap), + Histogram(1, 3.6e12), + resolution_(resolution) { + MakeWeak(); + timer_ = new uv_timer_t(); + uv_timer_init(env->event_loop(), timer_); + timer_->data = this; +} + +void ELDHistogram::CloseTimer() { + if (timer_ == nullptr) + return; + + env()->CloseHandle(timer_, [](uv_timer_t* handle) { delete handle; }); + timer_ = nullptr; +} + +ELDHistogram::~ELDHistogram() { + Disable(); + CloseTimer(); +} + +void ELDHistogramDelayInterval(uv_timer_t* req) { + ELDHistogram* histogram = + reinterpret_cast(req->data); + histogram->RecordDelta(); + TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop), + "min", histogram->Min()); + TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop), + "max", histogram->Max()); + TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop), + "mean", histogram->Mean()); + TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop), + "stddev", histogram->Stddev()); +} + +bool ELDHistogram::RecordDelta() { + uint64_t time = uv_hrtime(); + bool ret = true; + if (prev_ > 0) { + int64_t delta = time - prev_; + if (delta > 0) { + ret = Record(delta); + TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop), + "delay", delta); + if (!ret) { + if (exceeds_ < 0xFFFFFFFF) + exceeds_++; + ProcessEmitWarning( + env(), + "Event loop delay exceeded 1 hour: %" PRId64 " nanoseconds", + delta); + } + } + } + prev_ = time; + return ret; +} + +bool ELDHistogram::Enable() { + if (enabled_) return false; + enabled_ = true; + uv_timer_start(timer_, + ELDHistogramDelayInterval, + resolution_, + resolution_); + uv_unref(reinterpret_cast(timer_)); + return true; +} + +bool ELDHistogram::Disable() { + if (!enabled_) return false; + enabled_ = false; + uv_timer_stop(timer_); + return true; +} void Initialize(Local target, Local unused, @@ -456,6 +624,24 @@ void Initialize(Local target, env->constants_string(), constants, attr).ToChecked(); + + Local eldh_classname = FIXED_ONE_BYTE_STRING(isolate, "ELDHistogram"); + Local eldh = + env->NewFunctionTemplate(ELDHistogramNew); + eldh->SetClassName(eldh_classname); + eldh->InstanceTemplate()->SetInternalFieldCount(1); + env->SetProtoMethod(eldh, "exceeds", ELDHistogramExceeds); + env->SetProtoMethod(eldh, "min", ELDHistogramMin); + env->SetProtoMethod(eldh, "max", ELDHistogramMax); + env->SetProtoMethod(eldh, "mean", ELDHistogramMean); + env->SetProtoMethod(eldh, "stddev", ELDHistogramStddev); + env->SetProtoMethod(eldh, "percentile", ELDHistogramPercentile); + env->SetProtoMethod(eldh, "percentiles", ELDHistogramPercentiles); + env->SetProtoMethod(eldh, "enable", ELDHistogramEnable); + env->SetProtoMethod(eldh, "disable", ELDHistogramDisable); + env->SetProtoMethod(eldh, "reset", ELDHistogramReset); + target->Set(context, eldh_classname, + eldh->GetFunction(env->context()).ToLocalChecked()).FromJust(); } } // namespace performance diff --git a/src/node_perf.h b/src/node_perf.h index e3ef69c0fb48e2..a8e43dc3476cc2 100644 --- a/src/node_perf.h +++ b/src/node_perf.h @@ -7,6 +7,7 @@ #include "node_perf_common.h" #include "env.h" #include "base_object-inl.h" +#include "histogram-inl.h" #include "v8.h" #include "uv.h" @@ -124,6 +125,41 @@ class GCPerformanceEntry : public PerformanceEntry { PerformanceGCKind gckind_; }; +class ELDHistogram : public BaseObject, public Histogram { + public: + ELDHistogram(Environment* env, + Local wrap, + int32_t resolution); + + ~ELDHistogram() override; + + bool RecordDelta(); + bool Enable(); + bool Disable(); + void ResetState() { + Reset(); + exceeds_ = 0; + prev_ = 0; + } + int64_t Exceeds() { return exceeds_; } + + void MemoryInfo(MemoryTracker* tracker) const override { + tracker->TrackFieldWithSize("histogram", GetMemorySize()); + } + + SET_MEMORY_INFO_NAME(ELDHistogram) + SET_SELF_SIZE(ELDHistogram) + + private: + void CloseTimer(); + + bool enabled_ = false; + int32_t resolution_ = 0; + int64_t exceeds_ = 0; + uint64_t prev_ = 0; + uv_timer_t* timer_; +}; + } // namespace performance } // namespace node diff --git a/test/sequential/test-performance-eventloopdelay.js b/test/sequential/test-performance-eventloopdelay.js new file mode 100644 index 00000000000000..82f47b6fb29c47 --- /dev/null +++ b/test/sequential/test-performance-eventloopdelay.js @@ -0,0 +1,99 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const { + monitorEventLoopDelay +} = require('perf_hooks'); + +{ + const histogram = monitorEventLoopDelay(); + assert(histogram); + assert(histogram.enable()); + assert(!histogram.enable()); + histogram.reset(); + assert(histogram.disable()); + assert(!histogram.disable()); +} + +{ + [null, 'a', 1, false, Infinity].forEach((i) => { + common.expectsError( + () => monitorEventLoopDelay(i), + { + type: TypeError, + code: 'ERR_INVALID_ARG_TYPE' + } + ); + }); + + [null, 'a', false, {}, []].forEach((i) => { + common.expectsError( + () => monitorEventLoopDelay({ resolution: i }), + { + type: TypeError, + code: 'ERR_INVALID_ARG_TYPE' + } + ); + }); + + [-1, 0, Infinity].forEach((i) => { + common.expectsError( + () => monitorEventLoopDelay({ resolution: i }), + { + type: RangeError, + code: 'ERR_INVALID_OPT_VALUE' + } + ); + }); +} + +{ + const histogram = monitorEventLoopDelay({ resolution: 1 }); + histogram.enable(); + let m = 5; + function spinAWhile() { + common.busyLoop(1000); + if (--m > 0) { + setTimeout(spinAWhile, common.platformTimeout(500)); + } else { + histogram.disable(); + // The values are non-deterministic, so we just check that a value is + // present, as opposed to a specific value. + assert(histogram.min > 0); + assert(histogram.max > 0); + assert(histogram.stddev > 0); + assert(histogram.mean > 0); + assert(histogram.percentiles.size > 0); + for (let n = 1; n < 100; n = n + 0.1) { + assert(histogram.percentile(n) >= 0); + } + histogram.reset(); + assert.strictEqual(histogram.min, 9223372036854776000); + assert.strictEqual(histogram.max, 0); + assert(Number.isNaN(histogram.stddev)); + assert(Number.isNaN(histogram.mean)); + assert.strictEqual(histogram.percentiles.size, 1); + + ['a', false, {}, []].forEach((i) => { + common.expectsError( + () => histogram.percentile(i), + { + type: TypeError, + code: 'ERR_INVALID_ARG_TYPE' + } + ); + }); + [-1, 0, 101].forEach((i) => { + common.expectsError( + () => histogram.percentile(i), + { + type: RangeError, + code: 'ERR_INVALID_ARG_VALUE' + } + ); + }); + } + } + spinAWhile(); +} diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 96dd98737f9564..ffbec9115c272e 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -16,7 +16,7 @@ const jsPrimitives = { const jsGlobalObjectsUrl = `${jsDocPrefix}Reference/Global_Objects/`; const jsGlobalTypes = [ 'Array', 'ArrayBuffer', 'DataView', 'Date', 'Error', 'EvalError', 'Function', - 'Object', 'Promise', 'RangeError', 'ReferenceError', 'RegExp', 'Set', + 'Map', 'Object', 'Promise', 'RangeError', 'ReferenceError', 'RegExp', 'Set', 'SharedArrayBuffer', 'SyntaxError', 'TypeError', 'TypedArray', 'URIError', 'Uint8Array', ]; @@ -75,6 +75,8 @@ const customTypesMap = { 'fs.Stats': 'fs.html#fs_class_fs_stats', 'fs.WriteStream': 'fs.html#fs_class_fs_writestream', + 'Histogram': 'perf_hooks.html#perf_hooks_class_histogram', + 'http.Agent': 'http.html#http_class_http_agent', 'http.ClientRequest': 'http.html#http_class_http_clientrequest', 'http.IncomingMessage': 'http.html#http_class_http_incomingmessage', diff --git a/tools/license-builder.sh b/tools/license-builder.sh index 1c884508e3f5e9..be808f00d1be49 100755 --- a/tools/license-builder.sh +++ b/tools/license-builder.sh @@ -95,4 +95,6 @@ addlicense "large_pages" "src/large_pages" "$(sed -e '/SPDX-License-Identifier/, # brotli addlicense "brotli" "deps/brotli" "$(cat ${rootdir}/deps/brotli/LICENSE)" +addlicense "HdrHistogram" "deps/histogram" "$(cat ${rootdir}/deps/histogram/LICENSE.txt)" + mv $tmplicense $licensefile From 823fd5b4933cd67c1965a29a2fa2743635dd4d9b Mon Sep 17 00:00:00 2001 From: jasnell Date: Fri, 8 Feb 2019 09:18:29 -0800 Subject: [PATCH 133/223] deps: float fix for building HdrHistogram on Win x86 From: https://github.com/mcollina/native-hdr-histogram/commit/c63e97151dcff9b9aed1d8ea5e4f5964c69be32fideps: PR-URL: https://github.com/nodejs/node/pull/25378 Reviewed-By: Matteo Collina Reviewed-By: Gireesh Punathil Reviewed-By: Stephen Belanger Reviewed-By: Richard Lau Reviewed-By: Anna Henningsen --- deps/histogram/src/hdr_histogram.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/deps/histogram/src/hdr_histogram.c b/deps/histogram/src/hdr_histogram.c index 1d7343442d3b67..d9565b802e3564 100644 --- a/deps/histogram/src/hdr_histogram.c +++ b/deps/histogram/src/hdr_histogram.c @@ -91,14 +91,29 @@ static int64_t power(int64_t base, int64_t exp) } #if defined(_MSC_VER) -#pragma intrinsic(_BitScanReverse64) +# if defined(_WIN64) +# pragma intrinsic(_BitScanReverse64) +# else +# pragma intrinsic(_BitScanReverse) +# endif #endif static int32_t get_bucket_index(const struct hdr_histogram* h, int64_t value) { #if defined(_MSC_VER) uint32_t leading_zero = 0; - _BitScanReverse64(&leading_zero, value | h->sub_bucket_mask); + int64_t masked_value = value | h->sub_bucket_mask; +# if defined(_WIN64) + _BitScanReverse64(&leading_zero, masked_value); +# else + uint32_t high = masked_value >> 32; + if (_BitScanReverse(&leading_zero, high)) { + leading_zero += 32; + } else { + uint32_t low = masked_value & 0x00000000FFFFFFFF; + _BitScanReverse(&leading_zero, low); + } +# endif int32_t pow2ceiling = 64 - (63 - leading_zero); /* smallest power of 2 containing value */ #else int32_t pow2ceiling = 64 - __builtin_clzll(value | h->sub_bucket_mask); /* smallest power of 2 containing value */ From e3fd7520d0671f639fc59e0470cb0909166480c3 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 30 Jan 2019 18:42:25 +0100 Subject: [PATCH 134/223] src: pass along errors from tls object creation PR-URL: https://github.com/nodejs/node/pull/25822 Reviewed-By: Gireesh Punathil --- src/tls_wrap.cc | 15 ++++++++++----- src/tls_wrap.h | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 7349c5c68da710..3f39e7a91ce611 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -48,13 +48,11 @@ using v8::String; using v8::Value; TLSWrap::TLSWrap(Environment* env, + Local obj, Kind kind, StreamBase* stream, SecureContext* sc) - : AsyncWrap(env, - env->tls_wrap_constructor_function() - ->NewInstance(env->context()).ToLocalChecked(), - AsyncWrap::PROVIDER_TLSWRAP), + : AsyncWrap(env, obj, AsyncWrap::PROVIDER_TLSWRAP), SSLWrap(env, sc, kind), StreamBase(env), sc_(sc) { @@ -159,7 +157,14 @@ void TLSWrap::Wrap(const FunctionCallbackInfo& args) { StreamBase* stream = static_cast(stream_obj->Value()); CHECK_NOT_NULL(stream); - TLSWrap* res = new TLSWrap(env, kind, stream, Unwrap(sc)); + Local obj; + if (!env->tls_wrap_constructor_function() + ->NewInstance(env->context()) + .ToLocal(&obj)) { + return; + } + + TLSWrap* res = new TLSWrap(env, obj, kind, stream, Unwrap(sc)); args.GetReturnValue().Set(res->object()); } diff --git a/src/tls_wrap.h b/src/tls_wrap.h index d3cbb992bafb29..be694526abf203 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -108,6 +108,7 @@ class TLSWrap : public AsyncWrap, static const int kSimultaneousBufferCount = 10; TLSWrap(Environment* env, + v8::Local obj, Kind kind, StreamBase* stream, crypto::SecureContext* sc); From 0672c24dc313f8fd53bc628683ba10ec46f98c08 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 30 Jan 2019 18:43:05 +0100 Subject: [PATCH 135/223] src: pass along errors from http2 object creation PR-URL: https://github.com/nodejs/node/pull/25822 Reviewed-By: Gireesh Punathil --- src/node_http2.cc | 125 ++++++++++++++++++++++++++-------------------- src/node_http2.h | 24 ++++++--- 2 files changed, 87 insertions(+), 62 deletions(-) diff --git a/src/node_http2.cc b/src/node_http2.cc index 7904c680b89369..0d349df060a5b4 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -228,27 +228,18 @@ void Http2Session::Http2Settings::Init() { count_ = n; } -Http2Session::Http2Settings::Http2Settings(Environment* env, - Http2Session* session, uint64_t start_time) - : AsyncWrap(env, - env->http2settings_constructor_template() - ->NewInstance(env->context()) - .ToLocalChecked(), - PROVIDER_HTTP2SETTINGS), - session_(session), - startTime_(start_time) { - Init(); -} - - -Http2Session::Http2Settings::Http2Settings(Environment* env) - : Http2Settings(env, nullptr, 0) {} - // The Http2Settings class is used to configure a SETTINGS frame that is // to be sent to the connected peer. The settings are set using a TypedArray // that is shared with the JavaScript side. -Http2Session::Http2Settings::Http2Settings(Http2Session* session) - : Http2Settings(session->env(), session, uv_hrtime()) {} +Http2Session::Http2Settings::Http2Settings(Environment* env, + Http2Session* session, + Local obj, + uint64_t start_time) + : AsyncWrap(env, obj, PROVIDER_HTTP2SETTINGS), + session_(session), + startTime_(start_time) { + Init(); +} // Generates a Buffer that contains the serialized payload of a SETTINGS // frame. This can be used, for instance, to create the Base64-encoded @@ -918,13 +909,14 @@ int Http2Session::OnBeginHeadersCallback(nghttp2_session* handle, // The common case is that we're creating a new stream. The less likely // case is that we're receiving a set of trailers if (LIKELY(stream == nullptr)) { - if (UNLIKELY(!session->CanAddStream())) { + if (UNLIKELY(!session->CanAddStream() || + Http2Stream::New(session, id, frame->headers.cat) == + nullptr)) { // Too many concurrent streams being opened nghttp2_submit_rst_stream(**session, NGHTTP2_FLAG_NONE, id, NGHTTP2_ENHANCE_YOUR_CALM); return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; } - new Http2Stream(session, id, frame->headers.cat); } else if (!stream->IsDestroyed()) { stream->StartHeaders(frame->headers.cat); } @@ -1771,7 +1763,7 @@ Http2Stream* Http2Session::SubmitRequest( *ret = nghttp2_submit_request(session_, prispec, nva, len, *prov, nullptr); CHECK_NE(*ret, NGHTTP2_ERR_NOMEM); if (LIKELY(*ret > 0)) - stream = new Http2Stream(this, *ret, NGHTTP2_HCAT_HEADERS, options); + stream = Http2Stream::New(this, *ret, NGHTTP2_HCAT_HEADERS, options); return stream; } @@ -1857,20 +1849,30 @@ void Http2Session::Consume(Local external) { Debug(this, "i/o stream consumed"); } - -Http2Stream::Http2Stream( - Http2Session* session, - int32_t id, - nghttp2_headers_category category, - int options) : AsyncWrap(session->env(), - session->env()->http2stream_constructor_template() - ->NewInstance(session->env()->context()) - .ToLocalChecked(), - AsyncWrap::PROVIDER_HTTP2STREAM), - StreamBase(session->env()), - session_(session), - id_(id), - current_headers_category_(category) { +Http2Stream* Http2Stream::New(Http2Session* session, + int32_t id, + nghttp2_headers_category category, + int options) { + Local obj; + if (!session->env() + ->http2stream_constructor_template() + ->NewInstance(session->env()->context()) + .ToLocal(&obj)) { + return nullptr; + } + return new Http2Stream(session, obj, id, category, options); +} + +Http2Stream::Http2Stream(Http2Session* session, + Local obj, + int32_t id, + nghttp2_headers_category category, + int options) + : AsyncWrap(session->env(), obj, AsyncWrap::PROVIDER_HTTP2STREAM), + StreamBase(session->env()), + session_(session), + id_(id), + current_headers_category_(category) { MakeWeak(); statistics_.start_time = uv_hrtime(); @@ -2113,7 +2115,7 @@ Http2Stream* Http2Stream::SubmitPushPromise(nghttp2_nv* nva, CHECK_NE(*ret, NGHTTP2_ERR_NOMEM); Http2Stream* stream = nullptr; if (*ret > 0) - stream = new Http2Stream(session_, *ret, NGHTTP2_HCAT_HEADERS, options); + stream = Http2Stream::New(session_, *ret, NGHTTP2_HCAT_HEADERS, options); return stream; } @@ -2335,7 +2337,14 @@ void HttpErrorString(const FunctionCallbackInfo& args) { // output for an HTTP2-Settings header field. void PackSettings(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - Http2Session::Http2Settings settings(env); + // TODO(addaleax): We should not be creating a full AsyncWrap for this. + Local obj; + if (!env->http2settings_constructor_template() + ->NewInstance(env->context()) + .ToLocal(&obj)) { + return; + } + Http2Session::Http2Settings settings(env, nullptr, obj); args.GetReturnValue().Set(settings.Pack()); } @@ -2464,7 +2473,7 @@ void Http2Session::Request(const FunctionCallbackInfo& args) { session->Http2Session::SubmitRequest(*priority, *list, list.length(), &ret, options); - if (ret <= 0) { + if (ret <= 0 || stream == nullptr) { Debug(session, "could not submit request: %s", nghttp2_strerror(ret)); return args.GetReturnValue().Set(ret); } @@ -2637,7 +2646,7 @@ void Http2Stream::PushPromise(const FunctionCallbackInfo& args) { int32_t ret = 0; Http2Stream* stream = parent->SubmitPushPromise(*list, list.length(), &ret, options); - if (ret <= 0) { + if (ret <= 0 || stream == nullptr) { Debug(parent, "failed to create push stream: %d", ret); return args.GetReturnValue().Set(ret); } @@ -2773,9 +2782,15 @@ void Http2Session::Ping(const FunctionCallbackInfo& args) { CHECK_EQ(Buffer::Length(args[0]), 8); } - Http2Session::Http2Ping* ping = new Http2Ping(session); - Local obj = ping->object(); - obj->Set(env->context(), env->ondone_string(), args[1]).FromJust(); + Local obj; + if (!env->http2ping_constructor_template() + ->NewInstance(env->context()) + .ToLocal(&obj)) { + return; + } + if (obj->Set(env->context(), env->ondone_string(), args[1]).IsNothing()) + return; + Http2Session::Http2Ping* ping = new Http2Ping(session, obj); // To prevent abuse, we strictly limit the number of unacknowledged PING // frames that may be sent at any given time. This is configurable in the @@ -2799,10 +2814,17 @@ void Http2Session::Settings(const FunctionCallbackInfo& args) { Http2Session* session; ASSIGN_OR_RETURN_UNWRAP(&session, args.Holder()); - Http2Session::Http2Settings* settings = new Http2Settings(session); - Local obj = settings->object(); - obj->Set(env->context(), env->ondone_string(), args[0]).FromJust(); + Local obj; + if (!env->http2settings_constructor_template() + ->NewInstance(env->context()) + .ToLocal(&obj)) { + return; + } + if (obj->Set(env->context(), env->ondone_string(), args[0]).IsNothing()) + return; + Http2Session::Http2Settings* settings = + new Http2Settings(session->env(), session, obj, 0); if (!session->AddSettings(settings)) { settings->Done(false); return args.GetReturnValue().Set(false); @@ -2849,15 +2871,10 @@ bool Http2Session::AddSettings(Http2Session::Http2Settings* settings) { return true; } -Http2Session::Http2Ping::Http2Ping( - Http2Session* session) - : AsyncWrap(session->env(), - session->env()->http2ping_constructor_template() - ->NewInstance(session->env()->context()) - .ToLocalChecked(), - AsyncWrap::PROVIDER_HTTP2PING), - session_(session), - startTime_(uv_hrtime()) { } +Http2Session::Http2Ping::Http2Ping(Http2Session* session, Local obj) + : AsyncWrap(session->env(), obj, AsyncWrap::PROVIDER_HTTP2PING), + session_(session), + startTime_(uv_hrtime()) {} void Http2Session::Http2Ping::Send(uint8_t* payload) { uint8_t data[8]; diff --git a/src/node_http2.h b/src/node_http2.h index e6953f6fc19802..fb90e3ed85111c 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -451,10 +451,11 @@ class Http2StreamListener : public StreamListener { class Http2Stream : public AsyncWrap, public StreamBase { public: - Http2Stream(Http2Session* session, - int32_t id, - nghttp2_headers_category category = NGHTTP2_HCAT_HEADERS, - int options = 0); + static Http2Stream* New( + Http2Session* session, + int32_t id, + nghttp2_headers_category category = NGHTTP2_HCAT_HEADERS, + int options = 0); ~Http2Stream() override; nghttp2_stream* operator*(); @@ -611,6 +612,12 @@ class Http2Stream : public AsyncWrap, Statistics statistics_ = {}; private: + Http2Stream(Http2Session* session, + v8::Local obj, + int32_t id, + nghttp2_headers_category category, + int options); + Http2Session* session_ = nullptr; // The Parent HTTP/2 Session int32_t id_ = 0; // The Stream Identifier int32_t code_ = NGHTTP2_NO_ERROR; // The RST_STREAM code (if any) @@ -1076,7 +1083,7 @@ class Http2StreamPerformanceEntry : public PerformanceEntry { class Http2Session::Http2Ping : public AsyncWrap { public: - explicit Http2Ping(Http2Session* session); + explicit Http2Ping(Http2Session* session, v8::Local obj); void MemoryInfo(MemoryTracker* tracker) const override { tracker->TrackField("session", session_); @@ -1100,8 +1107,10 @@ class Http2Session::Http2Ping : public AsyncWrap { // structs. class Http2Session::Http2Settings : public AsyncWrap { public: - explicit Http2Settings(Environment* env); - explicit Http2Settings(Http2Session* session); + Http2Settings(Environment* env, + Http2Session* session, + v8::Local obj, + uint64_t start_time = uv_hrtime()); void MemoryInfo(MemoryTracker* tracker) const override { tracker->TrackField("session", session_); @@ -1125,7 +1134,6 @@ class Http2Session::Http2Settings : public AsyncWrap { get_setting fn); private: - Http2Settings(Environment* env, Http2Session* session, uint64_t start_time); void Init(); Http2Session* session_; uint64_t startTime_; From d6f3b8785fcd5e4700f851f376a8f17861a7971f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 30 Jan 2019 19:11:11 +0100 Subject: [PATCH 136/223] src: pass along errors from fs object creations PR-URL: https://github.com/nodejs/node/pull/25822 Reviewed-By: Gireesh Punathil --- src/node_file.cc | 66 ++++++++++++++++++++++++++++++++++-------------- src/node_file.h | 42 +++++++++++++++++------------- 2 files changed, 71 insertions(+), 37 deletions(-) diff --git a/src/node_file.cc b/src/node_file.cc index 35c8e01a28c0b5..5513be3d7c77c1 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -110,20 +110,29 @@ typedef void(*uv_fs_callback_t)(uv_fs_t*); // The FileHandle object wraps a file descriptor and will close it on garbage // collection if necessary. If that happens, a process warning will be // emitted (or a fatal exception will occur if the fd cannot be closed.) -FileHandle::FileHandle(Environment* env, int fd, Local obj) - : AsyncWrap(env, - obj.IsEmpty() ? env->fd_constructor_template() - ->NewInstance(env->context()).ToLocalChecked() : obj, - AsyncWrap::PROVIDER_FILEHANDLE), +FileHandle::FileHandle(Environment* env, Local obj, int fd) + : AsyncWrap(env, obj, AsyncWrap::PROVIDER_FILEHANDLE), StreamBase(env), fd_(fd) { MakeWeak(); +} + +FileHandle* FileHandle::New(Environment* env, int fd, Local obj) { + if (obj.IsEmpty() && !env->fd_constructor_template() + ->NewInstance(env->context()) + .ToLocal(&obj)) { + return nullptr; + } v8::PropertyAttribute attr = static_cast(v8::ReadOnly | v8::DontDelete); - object()->DefineOwnProperty(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "fd"), - Integer::New(env->isolate(), fd), - attr).FromJust(); + if (obj->DefineOwnProperty(env->context(), + env->fd_string(), + Integer::New(env->isolate(), fd), + attr) + .IsNothing()) { + return nullptr; + } + return new FileHandle(env, obj, fd); } void FileHandle::New(const FunctionCallbackInfo& args) { @@ -132,7 +141,8 @@ void FileHandle::New(const FunctionCallbackInfo& args) { CHECK(args[0]->IsInt32()); FileHandle* handle = - new FileHandle(env, args[0].As()->Value(), args.This()); + FileHandle::New(env, args[0].As()->Value(), args.This()); + if (handle == nullptr) return; if (args[1]->IsNumber()) handle->read_offset_ = args[1]->IntegerValue(env->context()).FromJust(); if (args[2]->IsNumber()) @@ -232,7 +242,14 @@ inline MaybeLocal FileHandle::ClosePromise() { CHECK(!reading_); if (!closed_ && !closing_) { closing_ = true; - CloseReq* req = new CloseReq(env(), promise, object()); + Local close_req_obj; + if (!env() + ->fdclose_constructor_template() + ->NewInstance(env()->context()) + .ToLocal(&close_req_obj)) { + return MaybeLocal(); + } + CloseReq* req = new CloseReq(env(), close_req_obj, promise, object()); auto AfterClose = uv_fs_callback_t{[](uv_fs_t* req) { std::unique_ptr close(CloseReq::from_req(req)); CHECK_NOT_NULL(close); @@ -260,7 +277,9 @@ inline MaybeLocal FileHandle::ClosePromise() { void FileHandle::Close(const FunctionCallbackInfo& args) { FileHandle* fd; ASSIGN_OR_RETURN_UNWRAP(&fd, args.Holder()); - args.GetReturnValue().Set(fd->ClosePromise().ToLocalChecked()); + Local ret; + if (!fd->ClosePromise().ToLocal(&ret)) return; + args.GetReturnValue().Set(ret); } @@ -318,8 +337,13 @@ int FileHandle::ReadStart() { read_wrap->AsyncReset(); read_wrap->file_handle_ = this; } else { - Local wrap_obj = env()->filehandlereadwrap_template() - ->NewInstance(env()->context()).ToLocalChecked(); + Local wrap_obj; + if (!env() + ->filehandlereadwrap_template() + ->NewInstance(env()->context()) + .ToLocal(&wrap_obj)) { + return UV_EBUSY; + } read_wrap.reset(new FileHandleReadWrap(this, wrap_obj)); } } @@ -520,7 +544,8 @@ void AfterOpenFileHandle(uv_fs_t* req) { FSReqAfterScope after(req_wrap, req); if (after.Proceed()) { - FileHandle* fd = new FileHandle(req_wrap->env(), req->result); + FileHandle* fd = FileHandle::New(req_wrap->env(), req->result); + if (fd == nullptr) return; req_wrap->Resolve(fd->object()); } } @@ -724,15 +749,18 @@ inline int SyncCall(Environment* env, Local ctx, FSReqWrapSync* req_wrap, return err; } +// TODO(addaleax): Currently, callers check the return value and assume +// that nullptr indicates a synchronous call, rather than a failure. +// Failure conditions should be disambiguated and handled appropriately. inline FSReqBase* GetReqWrap(Environment* env, Local value, bool use_bigint = false) { if (value->IsObject()) { return Unwrap(value.As()); } else if (value->StrictEquals(env->fs_use_promises_symbol())) { if (use_bigint) { - return new FSReqPromise(env, use_bigint); + return FSReqPromise::New(env, use_bigint); } else { - return new FSReqPromise(env, use_bigint); + return FSReqPromise::New(env, use_bigint); } } return nullptr; @@ -1562,8 +1590,8 @@ static void OpenFileHandle(const FunctionCallbackInfo& args) { if (result < 0) { return; // syscall failed, no need to continue, error info is in ctx } - HandleScope scope(isolate); - FileHandle* fd = new FileHandle(env, result); + FileHandle* fd = FileHandle::New(env, result); + if (fd == nullptr) return; args.GetReturnValue().Set(fd->object()); } } diff --git a/src/node_file.h b/src/node_file.h index e2f8bdc55e6ad1..5ae01df9ef6106 100644 --- a/src/node_file.h +++ b/src/node_file.h @@ -237,17 +237,19 @@ inline Local FillGlobalStatsArray(Environment* env, template class FSReqPromise : public FSReqBase { public: - explicit FSReqPromise(Environment* env, bool use_bigint) - : FSReqBase(env, - env->fsreqpromise_constructor_template() - ->NewInstance(env->context()).ToLocalChecked(), - AsyncWrap::PROVIDER_FSREQPROMISE, - use_bigint), - stats_field_array_(env->isolate(), kFsStatsFieldsNumber) { - const auto resolver = - Promise::Resolver::New(env->context()).ToLocalChecked(); - USE(object()->Set(env->context(), env->promise_string(), - resolver).FromJust()); + static FSReqPromise* New(Environment* env, bool use_bigint) { + v8::Local obj; + if (!env->fsreqpromise_constructor_template() + ->NewInstance(env->context()) + .ToLocal(&obj)) { + return nullptr; + } + v8::Local resolver; + if (!v8::Promise::Resolver::New(env->context()).ToLocal(&resolver) || + obj->Set(env->context(), env->promise_string(), resolver).IsNothing()) { + return nullptr; + } + return new FSReqPromise(env, obj, use_bigint); } ~FSReqPromise() override { @@ -304,6 +306,10 @@ class FSReqPromise : public FSReqBase { FSReqPromise& operator=(const FSReqPromise&&) = delete; private: + FSReqPromise(Environment* env, v8::Local obj, bool use_bigint) + : FSReqBase(env, obj, AsyncWrap::PROVIDER_FSREQPROMISE, use_bigint), + stats_field_array_(env->isolate(), kFsStatsFieldsNumber) {} + bool finished_ = false; AliasedBuffer stats_field_array_; }; @@ -356,9 +362,9 @@ class FileHandleReadWrap : public ReqWrap { // the object is garbage collected class FileHandle : public AsyncWrap, public StreamBase { public: - FileHandle(Environment* env, - int fd, - v8::Local obj = v8::Local()); + static FileHandle* New(Environment* env, + int fd, + v8::Local obj = v8::Local()); virtual ~FileHandle(); static void New(const v8::FunctionCallbackInfo& args); @@ -404,6 +410,8 @@ class FileHandle : public AsyncWrap, public StreamBase { FileHandle& operator=(const FileHandle&&) = delete; private: + FileHandle(Environment* env, v8::Local obj, int fd); + // Synchronous close that emits a warning void Close(); void AfterClose(); @@ -411,12 +419,10 @@ class FileHandle : public AsyncWrap, public StreamBase { class CloseReq : public ReqWrap { public: CloseReq(Environment* env, + Local obj, Local promise, Local ref) - : ReqWrap(env, - env->fdclose_constructor_template() - ->NewInstance(env->context()).ToLocalChecked(), - AsyncWrap::PROVIDER_FILEHANDLECLOSEREQ) { + : ReqWrap(env, obj, AsyncWrap::PROVIDER_FILEHANDLECLOSEREQ) { promise_.Reset(env->isolate(), promise); ref_.Reset(env->isolate(), ref); } From 469cdacd59cefedca763c16f09b4a4f9e262178e Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 30 Jan 2019 19:15:58 +0100 Subject: [PATCH 137/223] src: pass along errors from StreamBase req obj creations PR-URL: https://github.com/nodejs/node/pull/25822 Reviewed-By: Gireesh Punathil --- src/stream_base-inl.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 7e2bbaa1730f2e..7db8403ced832b 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -163,9 +163,11 @@ inline int StreamBase::Shutdown(v8::Local req_wrap_obj) { HandleScope handle_scope(env->isolate()); if (req_wrap_obj.IsEmpty()) { - req_wrap_obj = - env->shutdown_wrap_template() - ->NewInstance(env->context()).ToLocalChecked(); + if (!env->shutdown_wrap_template() + ->NewInstance(env->context()) + .ToLocal(&req_wrap_obj)) { + return UV_EBUSY; + } StreamReq::ResetObject(req_wrap_obj); } @@ -211,9 +213,11 @@ inline StreamWriteResult StreamBase::Write( HandleScope handle_scope(env->isolate()); if (req_wrap_obj.IsEmpty()) { - req_wrap_obj = - env->write_wrap_template() - ->NewInstance(env->context()).ToLocalChecked(); + if (!env->write_wrap_template() + ->NewInstance(env->context()) + .ToLocal(&req_wrap_obj)) { + return StreamWriteResult { false, UV_EBUSY, nullptr, 0 }; + } StreamReq::ResetObject(req_wrap_obj); } From 508a2e7f0f7399a6de0bab277f0e421b9de2b70b Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 5 Feb 2019 21:47:08 +0100 Subject: [PATCH 138/223] worker: use correct ctor for error serialization When serializing errors, use the error constructor that is closest to the object itself in the prototype chain. The previous practice of walking downwards meant that `Error` would usually be the first constructor that is used, even when a more specific one would be available/appropriate, because it is the base class of the other common error types. PR-URL: https://github.com/nodejs/node/pull/25951 Reviewed-By: James M Snell Reviewed-By: Gus Caplan Reviewed-By: Benjamin Gruenbaum Reviewed-By: Minwoo Jung Reviewed-By: Colin Ihrig --- lib/internal/error-serdes.js | 2 +- test/parallel/test-worker-syntax-error-file.js | 1 + test/parallel/test-worker-syntax-error.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/error-serdes.js b/lib/internal/error-serdes.js index 9da1a864171607..d6e15ac77397cf 100644 --- a/lib/internal/error-serdes.js +++ b/lib/internal/error-serdes.js @@ -80,7 +80,7 @@ function serializeError(error) { if (typeof error === 'object' && ObjectPrototypeToString(error) === '[object Error]') { const constructors = GetConstructors(error); - for (var i = constructors.length - 1; i >= 0; i--) { + for (var i = 0; i < constructors.length; i++) { const name = GetName(constructors[i]); if (errorConstructorNames.has(name)) { try { error.stack; } catch {} diff --git a/test/parallel/test-worker-syntax-error-file.js b/test/parallel/test-worker-syntax-error-file.js index 87ed6c3c92dc64..ca42c174808500 100644 --- a/test/parallel/test-worker-syntax-error-file.js +++ b/test/parallel/test-worker-syntax-error-file.js @@ -10,6 +10,7 @@ if (!process.env.HAS_STARTED_WORKER) { const w = new Worker(fixtures.path('syntax', 'bad_syntax.js')); w.on('message', common.mustNotCall()); w.on('error', common.mustCall((err) => { + assert.strictEqual(err.constructor, SyntaxError); assert(/SyntaxError/.test(err)); })); } else { diff --git a/test/parallel/test-worker-syntax-error.js b/test/parallel/test-worker-syntax-error.js index 86c20ab29d7bf1..5c91eb2d251204 100644 --- a/test/parallel/test-worker-syntax-error.js +++ b/test/parallel/test-worker-syntax-error.js @@ -9,6 +9,7 @@ if (!process.env.HAS_STARTED_WORKER) { const w = new Worker('abc)', { eval: true }); w.on('message', common.mustNotCall()); w.on('error', common.mustCall((err) => { + assert.strictEqual(err.constructor, SyntaxError); assert(/SyntaxError/.test(err)); })); } else { From b280d9027990c9618dba45c50bb829da158a3db0 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sat, 5 Jan 2019 06:02:33 +0800 Subject: [PATCH 139/223] src: simplify NativeModule caching and remove redundant data - Remove `NativeModule._source` - the compilation is now entirely done in C++ and `process.binding('natives')` is implemented directly in the binding loader so there is no need to store additional source code strings. - Instead of using an object as `NativeModule._cached` and insert into it after compilation of each native module, simply prebuild a JS map filled with all the native modules and infer the state of compilation through `mod.loading`/`mod.loaded`. - Rename `NativeModule.nonInternalExists` to `NativeModule.canBeRequiredByUsers` and precompute that property for all the native modules during bootstrap instead of branching in every require call during runtime. This also fixes the bug where `worker_threads` can be made available with `--expose-internals`. - Rename `NativeModule.requireForDeps` to `NativeModule.requireWithFallbackInDeps`. - Add a test to make sure we do not accidentally leak any module to the global namespace. Backport-PR-URL: https://github.com/nodejs/node/pull/25964 PR-URL: https://github.com/nodejs/node/pull/25352 Reviewed-By: Anna Henningsen --- lib/internal/bootstrap/cache.js | 24 ++-- lib/internal/bootstrap/loaders.js | 112 +++++++----------- lib/internal/modules/cjs/loader.js | 14 ++- lib/internal/modules/esm/default_resolve.js | 2 +- lib/internal/modules/esm/translators.js | 2 +- src/node_native_module.cc | 20 +++- src/node_native_module.h | 9 +- test/code-cache/test-code-cache.js | 5 +- test/parallel/test-internal-module-require.js | 112 ++++++++++++++++++ 9 files changed, 199 insertions(+), 101 deletions(-) create mode 100644 test/parallel/test-internal-module-require.js diff --git a/lib/internal/bootstrap/cache.js b/lib/internal/bootstrap/cache.js index d65a7192932657..e706ccb20dc813 100644 --- a/lib/internal/bootstrap/cache.js +++ b/lib/internal/bootstrap/cache.js @@ -7,14 +7,10 @@ const { NativeModule } = require('internal/bootstrap/loaders'); const { - source, getCodeCache, compileFunction + getCodeCache, compileFunction } = internalBinding('native_module'); const { hasTracing, hasInspector } = process.binding('config'); -const depsModule = Object.keys(source).filter( - (key) => NativeModule.isDepsModule(key) || key.startsWith('internal/deps') -); - // Modules with source code compiled in js2c that // cannot be compiled with the code cache. const cannotUseCache = [ @@ -29,7 +25,7 @@ const cannotUseCache = [ // the code cache is also used when compiling these two files. 'internal/bootstrap/loaders', 'internal/bootstrap/node' -].concat(depsModule); +]; // Skip modules that cannot be required when they are not // built into the binary. @@ -69,11 +65,19 @@ if (!process.versions.openssl) { ); } +const cachableBuiltins = []; +for (const id of NativeModule.map.keys()) { + if (id.startsWith('internal/deps') || + id.startsWith('v8/') || id.startsWith('node-inspect/')) { + cannotUseCache.push(id); + } + if (!cannotUseCache.includes(id)) { + cachableBuiltins.push(id); + } +} + module.exports = { - cachableBuiltins: Object.keys(source).filter( - (key) => !cannotUseCache.includes(key) - ), - getSource(id) { return source[id]; }, + cachableBuiltins, getCodeCache, compileFunction, cannotUseCache diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 813ea8b82d7b4f..4554526298b0a0 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -158,6 +158,12 @@ let internalBinding; // Create this WeakMap in js-land because V8 has no C++ API for WeakMap. internalBinding('module_wrap').callbackMap = new WeakMap(); +// Think of this as module.exports in this file even though it is not +// written in CommonJS style. +const loaderExports = { internalBinding, NativeModule }; +const loaderId = 'internal/bootstrap/loaders'; +const config = internalBinding('config'); + // Set up NativeModule. function NativeModule(id) { this.filename = `${id}.js`; @@ -167,34 +173,35 @@ function NativeModule(id) { this.exportKeys = undefined; this.loaded = false; this.loading = false; + if (id === loaderId) { + // Do not expose this to user land even with --expose-internals. + this.canBeRequiredByUsers = false; + } else if (id.startsWith('internal/')) { + this.canBeRequiredByUsers = config.exposeInternals; + } else { + this.canBeRequiredByUsers = true; + } } const { - source, + moduleIds, compileFunction } = internalBinding('native_module'); -NativeModule._source = source; -NativeModule._cache = {}; - -const config = internalBinding('config'); - -// Think of this as module.exports in this file even though it is not -// written in CommonJS style. -const loaderExports = { internalBinding, NativeModule }; -const loaderId = 'internal/bootstrap/loaders'; +NativeModule.map = new Map(); +for (var i = 0; i < moduleIds.length; ++i) { + const id = moduleIds[i]; + const mod = new NativeModule(id); + NativeModule.map.set(id, mod); +} NativeModule.require = function(id) { if (id === loaderId) { return loaderExports; } - const cached = NativeModule.getCached(id); - if (cached && (cached.loaded || cached.loading)) { - return cached.exports; - } - - if (!NativeModule.exists(id)) { + const mod = NativeModule.map.get(id); + if (!mod) { // Model the error off the internal/errors.js model, but // do not use that module given that it could actually be // the one causing the error if there's a bug in Node.js. @@ -205,62 +212,31 @@ NativeModule.require = function(id) { throw err; } - moduleLoadList.push(`NativeModule ${id}`); - - const nativeModule = new NativeModule(id); - - nativeModule.cache(); - nativeModule.compile(); - - return nativeModule.exports; -}; - -NativeModule.isDepsModule = function(id) { - return id.startsWith('node-inspect/') || id.startsWith('v8/'); -}; - -NativeModule.requireForDeps = function(id) { - if (!NativeModule.exists(id) || - // TODO(TimothyGu): remove when DEP0084 reaches end of life. - NativeModule.isDepsModule(id)) { - id = `internal/deps/${id}`; + if (mod.loaded || mod.loading) { + return mod.exports; } - return NativeModule.require(id); -}; -NativeModule.getCached = function(id) { - return NativeModule._cache[id]; + moduleLoadList.push(`NativeModule ${id}`); + mod.compile(); + return mod.exports; }; NativeModule.exists = function(id) { - return NativeModule._source.hasOwnProperty(id); + return NativeModule.map.has(id); }; -if (config.exposeInternals) { - NativeModule.nonInternalExists = function(id) { - // Do not expose this to user land even with --expose-internals. - if (id === loaderId) { - return false; - } - return NativeModule.exists(id); - }; - - NativeModule.isInternal = function(id) { - // Do not expose this to user land even with --expose-internals. - return id === loaderId; - }; -} else { - NativeModule.nonInternalExists = function(id) { - return NativeModule.exists(id) && !NativeModule.isInternal(id); - }; - - NativeModule.isInternal = function(id) { - return id.startsWith('internal/'); - }; -} +NativeModule.canBeRequiredByUsers = function(id) { + const mod = NativeModule.map.get(id); + return mod && mod.canBeRequiredByUsers; +}; -NativeModule.getSource = function(id) { - return NativeModule._source[id]; +// Allow internal modules from dependencies to require +// other modules from dependencies by providing fallbacks. +NativeModule.requireWithFallbackInDeps = function(request) { + if (!NativeModule.map.has(request)) { + request = `internal/deps/${request}`; + } + return NativeModule.require(request); }; const getOwn = (target, property, receiver) => { @@ -334,13 +310,13 @@ NativeModule.prototype.compile = function() { try { const requireFn = this.id.startsWith('internal/deps/') ? - NativeModule.requireForDeps : + NativeModule.requireWithFallbackInDeps : NativeModule.require; const fn = compileFunction(id); fn(this.exports, requireFn, this, process, internalBinding); - if (config.experimentalModules && !NativeModule.isInternal(this.id)) { + if (config.experimentalModules && this.canBeRequiredByUsers) { this.proxifyExports(); } @@ -350,10 +326,6 @@ NativeModule.prototype.compile = function() { } }; -NativeModule.prototype.cache = function() { - NativeModule._cache[this.id] = this; -}; - // Coverage must be turned on early, so that we can collect // it for Node.js' own internal libraries. if (process.env.NODE_V8_COVERAGE) { diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 04d2ea8a55e45a..0da026843f6232 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -113,8 +113,12 @@ function Module(id, parent) { this.children = []; } -const builtinModules = Object.keys(NativeModule._source) - .filter(NativeModule.nonInternalExists); +const builtinModules = []; +for (const [id, mod] of NativeModule.map) { + if (mod.canBeRequiredByUsers) { + builtinModules.push(id); + } +} Object.freeze(builtinModules); Module.builtinModules = builtinModules; @@ -423,7 +427,7 @@ if (isWindows) { var indexChars = [ 105, 110, 100, 101, 120, 46 ]; var indexLen = indexChars.length; Module._resolveLookupPaths = function(request, parent, newReturn) { - if (NativeModule.nonInternalExists(request)) { + if (NativeModule.canBeRequiredByUsers(request)) { debug('looking for %j in []', request); return (newReturn ? null : [request, []]); } @@ -540,7 +544,7 @@ Module._load = function(request, parent, isMain) { return cachedModule.exports; } - if (NativeModule.nonInternalExists(filename)) { + if (NativeModule.canBeRequiredByUsers(filename)) { debug('load native module %s', request); return NativeModule.require(filename); } @@ -573,7 +577,7 @@ function tryModuleLoad(module, filename) { } Module._resolveFilename = function(request, parent, isMain, options) { - if (NativeModule.nonInternalExists(request)) { + if (NativeModule.canBeRequiredByUsers(request)) { return request; } diff --git a/lib/internal/modules/esm/default_resolve.js b/lib/internal/modules/esm/default_resolve.js index 9aa54d09a1b07c..2cf9014a672ce0 100644 --- a/lib/internal/modules/esm/default_resolve.js +++ b/lib/internal/modules/esm/default_resolve.js @@ -53,7 +53,7 @@ const extensionFormatMap = { }; function resolve(specifier, parentURL) { - if (NativeModule.nonInternalExists(specifier)) { + if (NativeModule.canBeRequiredByUsers(specifier)) { return { url: specifier, format: 'builtin' diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index 6bfc4c8a98ed83..776b8d584df21f 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -81,7 +81,7 @@ translators.set('builtin', async (url) => { // slice 'node:' scheme const id = url.slice(5); NativeModule.require(id); - const module = NativeModule.getCached(id); + const module = NativeModule.map.get(id); return createDynamicModule( [...module.exportKeys, 'default'], url, (reflect) => { debug(`Loading BuiltinModule ${url}`); diff --git a/src/node_native_module.cc b/src/node_native_module.cc index bc911795fba8c7..187c7c600f01fd 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -83,11 +83,21 @@ void NativeModuleLoader::GetCacheUsage( args.GetReturnValue().Set(result); } -void NativeModuleLoader::SourceObjectGetter( +void NativeModuleLoader::ModuleIdsGetter( Local property, const PropertyCallbackInfo& info) { Local context = info.GetIsolate()->GetCurrentContext(); - info.GetReturnValue().Set( - per_process::native_module_loader.GetSourceObject(context)); + Isolate* isolate = info.GetIsolate(); + + const NativeModuleRecordMap& source_ = + per_process::native_module_loader.source_; + std::vector> ids; + ids.reserve(source_.size()); + + for (auto const& x : source_) { + ids.push_back(OneByteString(isolate, x.first.c_str(), x.first.size())); + } + + info.GetReturnValue().Set(Array::New(isolate, ids.data(), ids.size())); } void NativeModuleLoader::ConfigStringGetter( @@ -306,8 +316,8 @@ void NativeModuleLoader::Initialize(Local target, .FromJust()); CHECK(target ->SetAccessor(env->context(), - env->source_string(), - SourceObjectGetter, + FIXED_ONE_BYTE_STRING(env->isolate(), "moduleIds"), + ModuleIdsGetter, nullptr, MaybeLocal(), DEFAULT, diff --git a/src/node_native_module.h b/src/node_native_module.h index 9aea8bed574876..62c417a0b61474 100644 --- a/src/node_native_module.h +++ b/src/node_native_module.h @@ -58,11 +58,10 @@ class NativeModuleLoader { private: static void GetCacheUsage(const v8::FunctionCallbackInfo& args); - // Passing map of builtin module source code into JS land as - // internalBinding('native_module').source - static void SourceObjectGetter( - v8::Local property, - const v8::PropertyCallbackInfo& info); + // Passing ids of builtin module source code into JS land as + // internalBinding('native_module').moduleIds + static void ModuleIdsGetter(v8::Local property, + const v8::PropertyCallbackInfo& info); // Passing config.gypi into JS land as internalBinding('native_module').config static void ConfigStringGetter( v8::Local property, diff --git a/test/code-cache/test-code-cache.js b/test/code-cache/test-code-cache.js index 367e72168a6b67..54bd0b0e2a66be 100644 --- a/test/code-cache/test-code-cache.js +++ b/test/code-cache/test-code-cache.js @@ -5,15 +5,12 @@ // and the cache is used when built in modules are compiled. // Otherwise, verifies that no cache is used when compiling builtins. -require('../common'); +const { isMainThread } = require('../common'); const assert = require('assert'); const { cachableBuiltins, cannotUseCache } = require('internal/bootstrap/cache'); -const { - isMainThread -} = require('worker_threads'); const { internalBinding diff --git a/test/parallel/test-internal-module-require.js b/test/parallel/test-internal-module-require.js new file mode 100644 index 00000000000000..17559d228774f7 --- /dev/null +++ b/test/parallel/test-internal-module-require.js @@ -0,0 +1,112 @@ +'use strict'; + +// Flags: --expose-internals +// This verifies that +// 1. We do not leak internal modules unless the --require-internals option +// is on. +// 2. We do not accidentally leak any modules to the public global scope. +// 3. Deprecated modules are properly deprecated. + +const common = require('../common'); + +if (!common.isMainThread) { + common.skip('Cannot test the existence of --expose-internals from worker'); +} + +const assert = require('assert'); +const fork = require('child_process').fork; + +const expectedPublicModules = new Set([ + '_http_agent', + '_http_client', + '_http_common', + '_http_incoming', + '_http_outgoing', + '_http_server', + '_stream_duplex', + '_stream_passthrough', + '_stream_readable', + '_stream_transform', + '_stream_wrap', + '_stream_writable', + '_tls_common', + '_tls_wrap', + 'assert', + 'async_hooks', + 'buffer', + 'child_process', + 'cluster', + 'console', + 'constants', + 'crypto', + 'dgram', + 'dns', + 'domain', + 'events', + 'fs', + 'http', + 'http2', + 'https', + 'inspector', + 'module', + 'net', + 'os', + 'path', + 'perf_hooks', + 'process', + 'punycode', + 'querystring', + 'readline', + 'repl', + 'stream', + 'string_decoder', + 'sys', + 'timers', + 'tls', + 'trace_events', + 'tty', + 'url', + 'util', + 'v8', + 'vm', + 'worker_threads', + 'zlib' +]); + +if (process.argv[2] === 'child') { + assert(!process.execArgv.includes('--expose-internals')); + process.once('message', ({ allBuiltins }) => { + const publicModules = new Set(); + for (const id of allBuiltins) { + if (id.startsWith('internal/')) { + common.expectsError(() => { + require(id); + }, { + code: 'MODULE_NOT_FOUND', + message: `Cannot find module '${id}'` + }); + } else { + require(id); + publicModules.add(id); + } + } + assert(allBuiltins.length > publicModules.size); + // Make sure all the public modules are available through + // require('module').builtinModules + assert.deepStrictEqual( + publicModules, + new Set(require('module').builtinModules) + ); + assert.deepStrictEqual(publicModules, expectedPublicModules); + }); +} else { + assert(process.execArgv.includes('--expose-internals')); + const child = fork(__filename, ['child'], { + execArgv: [] + }); + const { builtinModules } = require('module'); + // When --expose-internals is on, require('module').builtinModules + // contains internal modules. + const message = { allBuiltins: builtinModules }; + child.send(message); +} From 76687dedcea367598389efe16067298a0d0a2787 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 13 Jan 2019 17:03:06 -0500 Subject: [PATCH 140/223] src: remove unused variable PR-URL: https://github.com/nodejs/node/pull/25481 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Anatoli Papirovski Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- src/node_native_module.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/node_native_module.cc b/src/node_native_module.cc index 187c7c600f01fd..27456dd54606e4 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -85,7 +85,6 @@ void NativeModuleLoader::GetCacheUsage( void NativeModuleLoader::ModuleIdsGetter( Local property, const PropertyCallbackInfo& info) { - Local context = info.GetIsolate()->GetCurrentContext(); Isolate* isolate = info.GetIsolate(); const NativeModuleRecordMap& source_ = From f4cfbf4c9e397572368e34f5c99a1cc05e3ccf09 Mon Sep 17 00:00:00 2001 From: Anto Aravinth Date: Sun, 10 Feb 2019 11:33:40 +0530 Subject: [PATCH 141/223] process: move setup of process warnings into node.js To clarify the side effects and conditions of the warning setup during bootstrap. PR-URL: https://github.com/nodejs/node/pull/25263 Reviewed-By: Gus Caplan Reviewed-By: Anna Henningsen Reviewed-By: Minwoo Jung Backport-PR-URL: https://github.com/nodejs/node/pull/26025 --- lib/internal/bootstrap/node.js | 10 ++- lib/internal/process/warning.js | 149 ++++++++++++++++---------------- 2 files changed, 83 insertions(+), 76 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 45cae2ac59fd4f..27eb50f8d60ebf 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -112,7 +112,15 @@ function startup() { process.exit = wrapped.exit; } - NativeModule.require('internal/process/warning').setup(); + const { + onWarning, + emitWarning + } = NativeModule.require('internal/process/warning'); + if (!process.noProcessWarnings && process.env.NODE_NO_WARNINGS !== '1') { + process.on('warning', onWarning); + } + process.emitWarning = emitWarning; + const { nextTick, runNextTicks diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index 9416f15383b088..eb90a7092959d8 100644 --- a/lib/internal/process/warning.js +++ b/lib/internal/process/warning.js @@ -3,8 +3,6 @@ const prefix = `(${process.release.name}:${process.pid}) `; const { ERR_INVALID_ARG_TYPE } = require('internal/errors').codes; -exports.setup = setupProcessWarnings; - let options; function lazyOption(name) { if (!options) { @@ -85,79 +83,80 @@ function doEmitWarning(warning) { }; } -function setupProcessWarnings() { - if (!process.noProcessWarnings && process.env.NODE_NO_WARNINGS !== '1') { - process.on('warning', (warning) => { - if (!(warning instanceof Error)) return; - const isDeprecation = warning.name === 'DeprecationWarning'; - if (isDeprecation && process.noDeprecation) return; - const trace = process.traceProcessWarnings || - (isDeprecation && process.traceDeprecation); - var msg = prefix; - if (warning.code) - msg += `[${warning.code}] `; - if (trace && warning.stack) { - msg += `${warning.stack}`; - } else { - const toString = - typeof warning.toString === 'function' ? - warning.toString : Error.prototype.toString; - msg += `${toString.apply(warning)}`; - } - if (typeof warning.detail === 'string') { - msg += `\n${warning.detail}`; - } - output(msg); - }); +function onWarning(warning) { + if (!(warning instanceof Error)) return; + const isDeprecation = warning.name === 'DeprecationWarning'; + if (isDeprecation && process.noDeprecation) return; + const trace = process.traceProcessWarnings || + (isDeprecation && process.traceDeprecation); + var msg = prefix; + if (warning.code) + msg += `[${warning.code}] `; + if (trace && warning.stack) { + msg += `${warning.stack}`; + } else { + const toString = + typeof warning.toString === 'function' ? + warning.toString : Error.prototype.toString; + msg += `${toString.apply(warning)}`; } + if (typeof warning.detail === 'string') { + msg += `\n${warning.detail}`; + } + output(msg); +} - // process.emitWarning(error) - // process.emitWarning(str[, type[, code]][, ctor]) - // process.emitWarning(str[, options]) - process.emitWarning = (warning, type, code, ctor, now) => { - let detail; - if (type !== null && typeof type === 'object' && !Array.isArray(type)) { - ctor = type.ctor; - code = type.code; - if (typeof type.detail === 'string') - detail = type.detail; - type = type.type || 'Warning'; - } else if (typeof type === 'function') { - ctor = type; - code = undefined; - type = 'Warning'; - } - if (type !== undefined && typeof type !== 'string') { - throw new ERR_INVALID_ARG_TYPE('type', 'string', type); - } - if (typeof code === 'function') { - ctor = code; - code = undefined; - } else if (code !== undefined && typeof code !== 'string') { - throw new ERR_INVALID_ARG_TYPE('code', 'string', code); - } - if (typeof warning === 'string') { - // Improve error creation performance by skipping the error frames. - // They are added in the `captureStackTrace()` function below. - const tmpStackLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; - // eslint-disable-next-line no-restricted-syntax - warning = new Error(warning); - Error.stackTraceLimit = tmpStackLimit; - warning.name = String(type || 'Warning'); - if (code !== undefined) warning.code = code; - if (detail !== undefined) warning.detail = detail; - Error.captureStackTrace(warning, ctor || process.emitWarning); - } else if (!(warning instanceof Error)) { - throw new ERR_INVALID_ARG_TYPE('warning', ['Error', 'string'], warning); - } - if (warning.name === 'DeprecationWarning') { - if (process.noDeprecation) - return; - if (process.throwDeprecation) - throw warning; - } - if (now) process.emit('warning', warning); - else process.nextTick(doEmitWarning(warning)); - }; +// process.emitWarning(error) +// process.emitWarning(str[, type[, code]][, ctor]) +// process.emitWarning(str[, options]) +function emitWarning(warning, type, code, ctor, now) { + let detail; + if (type !== null && typeof type === 'object' && !Array.isArray(type)) { + ctor = type.ctor; + code = type.code; + if (typeof type.detail === 'string') + detail = type.detail; + type = type.type || 'Warning'; + } else if (typeof type === 'function') { + ctor = type; + code = undefined; + type = 'Warning'; + } + if (type !== undefined && typeof type !== 'string') { + throw new ERR_INVALID_ARG_TYPE('type', 'string', type); + } + if (typeof code === 'function') { + ctor = code; + code = undefined; + } else if (code !== undefined && typeof code !== 'string') { + throw new ERR_INVALID_ARG_TYPE('code', 'string', code); + } + if (typeof warning === 'string') { + // Improve error creation performance by skipping the error frames. + // They are added in the `captureStackTrace()` function below. + const tmpStackLimit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + // eslint-disable-next-line no-restricted-syntax + warning = new Error(warning); + Error.stackTraceLimit = tmpStackLimit; + warning.name = String(type || 'Warning'); + if (code !== undefined) warning.code = code; + if (detail !== undefined) warning.detail = detail; + Error.captureStackTrace(warning, ctor || process.emitWarning); + } else if (!(warning instanceof Error)) { + throw new ERR_INVALID_ARG_TYPE('warning', ['Error', 'string'], warning); + } + if (warning.name === 'DeprecationWarning') { + if (process.noDeprecation) + return; + if (process.throwDeprecation) + throw warning; + } + if (now) process.emit('warning', warning); + else process.nextTick(doEmitWarning(warning)); } + +module.exports = { + onWarning, + emitWarning +}; From a225f99ea869252540a71ab6d67f64b79a90178c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 6 Feb 2019 20:36:37 -0800 Subject: [PATCH 142/223] doc: revise Introducing New Modules Revise "Introducing New Modules" in the Collaborator Guide: * Improve clarity. * Remove passive voice. * Keep sentences short for ease of reading/scanning. PR-URL: https://github.com/nodejs/node/pull/25975 Reviewed-By: Luigi Pinca Reviewed-By: Daniel Bevenius Reviewed-By: Jeremiah Senkpiel Reviewed-By: Michael Dawson --- COLLABORATOR_GUIDE.md | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 9bfc97147b994b..12b990091491e8 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -292,25 +292,23 @@ metadata. Raise a Pull Request like any other change. ### Introducing New Modules -Semver-minor commits that introduce new core modules should be treated with -extra care. +Treat commits that introduce new core modules with extra care. -The name of the new core module should not conflict with any existing -module in the ecosystem unless a written agreement with the owner of those -modules is reached to transfer ownership. +Check if the module's name conflicts with an existing ecosystem module. If it +does, choose a different name unless the module owner has agreed in writing to +transfer it. -If the new module name is free, a Collaborator should register a placeholder -in the module registry as soon as possible, linking to the pull request that -introduces the new core module. +If the new module name is free, register a placeholder in the module registry as +soon as possible. Link to the pull request that introduces the new core module +in the placeholder's `README`. -Pull requests introducing new core modules: +For pull requests introducing new core modules: -* Must be left open for at least one week for review. -* Must be labeled using the `tsc-review` label. -* Must have signoff from at least two TSC members. - -New core modules must be landed with a [Stability Index][] of Experimental, -and must remain Experimental until a semver-major release. +* Allow at least one week for review. +* Label with the `tsc-review` label. +* Land only after sign-off from at least two TSC members. +* Land with a [Stability Index][] of Experimental. The module must remain + Experimental until a semver-major release. ### Additions to N-API From eb4b5ea2339521f09cb2fa7adfaeaf2a44e7ce45 Mon Sep 17 00:00:00 2001 From: Andrew Moss Date: Sun, 27 Jan 2019 23:09:17 +0000 Subject: [PATCH 143/223] doc: clarify http timeouts Socket timeouts set using the `'connection'` event are replaced by `server.keepAliveTimeout` when a response is handled. PR-URL: https://github.com/nodejs/node/pull/25748 Reviewed-By: Luigi Pinca Reviewed-By: Matteo Collina --- doc/api/http.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/http.md b/doc/api/http.md index 7f0b39cbb1cd9a..fc80ca8513355b 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -908,6 +908,10 @@ also be accessed at `request.connection`. This event can also be explicitly emitted by users to inject connections into the HTTP server. In that case, any [`Duplex`][] stream can be passed. +If `socket.setTimeout()` is called here, the timeout will be replaced with +`server.keepAliveTimeout` when the socket has served a request (if +`server.keepAliveTimeout` is non-zero). + ### Event: 'request' + +* {Object} + +`process.report` is an object whose methods are used to generate diagnostic +reports for the current process. Additional documentation is available in the +[report documentation][]. ### process.report.getReport([err]) -* `err` {Object} -* Returns: {Object} Returns the diagnostics report as an `Object`. +* `err` {Error} A custom error used for reporting the JavsScript stack. +* Returns: {string} -Generates a JSON-formatted diagnostic report summary of the running process. -The report includes JavaScript and native stack traces, heap statistics, -platform information, resource usage etc. +Returns a JSON-formatted diagnostic report for the running process. The report's +JavaScript stack trace is taken from `err`, if present. ```js const data = process.report.getReport(); console.log(data); ``` -Additional documentation on diagnostic report is available -at [report documentation][]. +Additional documentation is available in the [report documentation][]. ### process.report.setDiagnosticReportOptions([options]); -Set the runtime configuration of diagnostic report data capture. Upon invocation -of this function, the runtime is reconfigured to generate report based on -the new input. - * `options` {Object} * `events` {string[]} - * `signal`: generate a report in response to a signal raised on the process. - * `exception`: generate a report on unhandled exceptions. - * `fatalerror`: generate a report on internal fault + * `signal`: Generate a report in response to a signal raised on the process. + * `exception`: Generate a report on unhandled exceptions. + * `fatalerror`: Generate a report on internal fault (such as out of memory errors or native assertions). - * `signal` {string} sets or resets the signal for report generation + * `signal` {string} Sets or resets the signal for report generation (not supported on Windows). **Default:** `'SIGUSR2'`. - * `filename` {string} name of the file to which the report will be written. - * `path` {string} drectory at which the report will be generated. + * `filename` {string} Name of the file where the report is written. + * `path` {string} Directory where the report is written. **Default:** the current working directory of the Node.js process. - * `verbose` {boolean} flag that controls additional verbose information on + * `verbose` {boolean} Flag that controls additional verbose information on report generation. **Default:** `false`. +Configures the diagnostic reporting behavior. Upon invocation, the runtime +is reconfigured to generate reports based on `options`. Several usage examples +are shown below. + ```js -// Trigger a report upon uncaught exceptions or fatal erros. -process.report.setDiagnosticReportOptions( - { events: ['exception', 'fatalerror'] }); +// Trigger a report on uncaught exceptions or fatal errors. +process.report.setDiagnosticReportOptions({ + events: ['exception', 'fatalerror'] +}); // Change the default path and filename of the report. -process.report.setDiagnosticReportOptions( - { filename: 'foo.json', path: '/home' }); +process.report.setDiagnosticReportOptions({ + filename: 'foo.json', + path: '/home' +}); // Produce the report onto stdout, when generated. Special meaning is attached // to `stdout` and `stderr`. Usage of these will result in report being written // to the associated standard streams. URLs are not supported. -process.report.setDiagnosticReportOptions( - { filename: 'stdout' }); +process.report.setDiagnosticReportOptions({ filename: 'stdout' }); // Enable verbose option on report generation. -process.report.setDiagnosticReportOptions( - { verbose: true }); - +process.report.setDiagnosticReportOptions({ verbose: true }); ``` Signal based report generation is not supported on Windows. -Additional documentation on diagnostic report is available -at [report documentation][]. +Additional documentation is available in the [report documentation][]. ### process.report.triggerReport([filename][, err]) -* `filename` {string} The file to write into. The `filename` should be -a relative path, that will be appended to the directory specified by -`process.report.setDiagnosticReportOptions`, or current working directory -of the Node.js process, if unspecified. -* `err` {Object} A custom object which will be used for reporting -JavsScript stack. +* `filename` {string} Name of the file where the report is written. This + should be a relative path, that will be appended to the directory specified in + `process.report.setDiagnosticReportOptions`, or the current working directory + of the Node.js process, if unspecified. +* `err` {Error} A custom error used for reporting the JavsScript stack. * Returns: {string} Returns the filename of the generated report. -If both `filename` and `err` object are passed to `triggerReport()` the -`err` object must be the second parameter. - -Triggers and produces the report (a JSON-formatted file with the internal -state of Node.js runtime) synchronously, and writes into a file. +Writes a diagnostic report to a file. If `filename` is not provided, the default +filename includes the date, time, PID, and a sequence number. The report's +JavaScript stack trace is taken from `err`, if present. ```js process.report.triggerReport(); ``` -When a report is triggered, start and end messages are issued to stderr and the -filename of the report is returned to the caller. The default filename includes -the date, time, PID and a sequence number. Alternatively, a filename and error -object can be specified as parameters on the `triggerReport()` call. - -Additional documentation on diagnostic report is available -at [report documentation][]. +Additional documentation is available in the [report documentation][]. ## process.send(message[, sendHandle[, options]][, callback]) * `statusCode` {number} * `statusMessage` {string} * `headers` {Object} +* Returns: {http2.Http2ServerResponse} Sends a response header to the request. The status code is a 3-digit HTTP status code, like `404`. The last argument, `headers`, are the response headers. +Returns a reference to the `Http2ServerResponse`, so that calls can be chained. + For compatibility with [HTTP/1][], a human-readable `statusMessage` may be passed as the second argument. However, because the `statusMessage` has no meaning within HTTP/2, the argument will have no effect and a process warning diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index 23c4e2e0f08893..faecf2441ce4c8 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -568,10 +568,8 @@ class Http2ServerResponse extends Stream { if (this[kStream].headersSent) throw new ERR_HTTP2_HEADERS_SENT(); - // If the stream is destroyed, we return false, - // like require('http'). if (this.stream.destroyed) - return false; + return this; if (typeof statusMessage === 'string') statusMessageWarn(); @@ -596,6 +594,8 @@ class Http2ServerResponse extends Stream { state.statusCode = statusCode; this[kBeginSend](); + + return this; } write(chunk, encoding, cb) { diff --git a/test/parallel/test-http2-compat-serverresponse-writehead-array.js b/test/parallel/test-http2-compat-serverresponse-writehead-array.js index e024f8ab3952f0..d856165d090f46 100644 --- a/test/parallel/test-http2-compat-serverresponse-writehead-array.js +++ b/test/parallel/test-http2-compat-serverresponse-writehead-array.js @@ -12,10 +12,11 @@ const server = h2.createServer(); server.listen(0, common.mustCall(() => { const port = server.address().port; server.once('request', common.mustCall((request, response) => { - response.writeHead(200, [ + const returnVal = response.writeHead(200, [ ['foo', 'bar'], ['ABC', 123] ]); + assert.strictEqual(returnVal, response); response.end(common.mustCall(() => { server.close(); })); })); diff --git a/test/parallel/test-http2-compat-serverresponse-writehead.js b/test/parallel/test-http2-compat-serverresponse-writehead.js index 5fd787e100350c..aabcf18ad9e0cf 100644 --- a/test/parallel/test-http2-compat-serverresponse-writehead.js +++ b/test/parallel/test-http2-compat-serverresponse-writehead.js @@ -13,7 +13,11 @@ server.listen(0, common.mustCall(function() { const port = server.address().port; server.once('request', common.mustCall(function(request, response) { response.setHeader('foo-bar', 'def456'); - response.writeHead(418, { 'foo-bar': 'abc123' }); // Override + + // Override + const returnVal = response.writeHead(418, { 'foo-bar': 'abc123' }); + + assert.strictEqual(returnVal, response); common.expectsError(() => { response.writeHead(300); }, { code: 'ERR_HTTP2_HEADERS_SENT' From 779a5773cf13ed200ee72f1939cb59da786d193e Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Sat, 9 Feb 2019 23:09:05 +0800 Subject: [PATCH 148/223] src: refactor macro to std::min in node_buffer.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/25919 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Сковорода Никита Андреевич --- src/node_buffer.cc | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 8e3745f2b465a7..31526054c8a410 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -34,8 +34,6 @@ #include #include -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - #define THROW_AND_RETURN_UNLESS_BUFFER(env, obj) \ THROW_AND_RETURN_IF_NOT_BUFFER(env, obj, "argument") \ @@ -516,9 +514,9 @@ void Copy(const FunctionCallbackInfo &args) { if (source_end - source_start > target_length - target_start) source_end = source_start + target_length - target_start; - uint32_t to_copy = MIN(MIN(source_end - source_start, - target_length - target_start), - ts_obj_length - source_start); + uint32_t to_copy = std::min( + std::min(source_end - source_start, target_length - target_start), + ts_obj_length - source_start); memmove(target_data + target_start, ts_obj_data + source_start, to_copy); args.GetReturnValue().Set(to_copy); @@ -549,7 +547,8 @@ void Fill(const FunctionCallbackInfo& args) { if (Buffer::HasInstance(args[1])) { SPREAD_BUFFER_ARG(args[1], fill_obj); str_length = fill_obj_length; - memcpy(ts_obj_data + start, fill_obj_data, MIN(str_length, fill_length)); + memcpy( + ts_obj_data + start, fill_obj_data, std::min(str_length, fill_length)); goto start_fill; } @@ -570,7 +569,7 @@ void Fill(const FunctionCallbackInfo& args) { if (enc == UTF8) { str_length = str_obj->Utf8Length(env->isolate()); node::Utf8Value str(env->isolate(), args[1]); - memcpy(ts_obj_data + start, *str, MIN(str_length, fill_length)); + memcpy(ts_obj_data + start, *str, std::min(str_length, fill_length)); } else if (enc == UCS2) { str_length = str_obj->Length() * sizeof(uint16_t); @@ -578,7 +577,7 @@ void Fill(const FunctionCallbackInfo& args) { if (IsBigEndian()) SwapBytes16(reinterpret_cast(&str[0]), str_length); - memcpy(ts_obj_data + start, *str, MIN(str_length, fill_length)); + memcpy(ts_obj_data + start, *str, std::min(str_length, fill_length)); } else { // Write initial String to Buffer, then use that memory to copy remainder @@ -643,7 +642,7 @@ void StringWrite(const FunctionCallbackInfo& args) { THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[2], ts_obj_length - offset, &max_length)); - max_length = MIN(ts_obj_length - offset, max_length); + max_length = std::min(ts_obj_length - offset, max_length); if (max_length == 0) return args.GetReturnValue().Set(0); @@ -712,9 +711,9 @@ void CompareOffset(const FunctionCallbackInfo &args) { CHECK_LE(source_start, source_end); CHECK_LE(target_start, target_end); - size_t to_cmp = MIN(MIN(source_end - source_start, - target_end - target_start), - ts_obj_length - source_start); + size_t to_cmp = + std::min(std::min(source_end - source_start, target_end - target_start), + ts_obj_length - source_start); int val = normalizeCompareVal(to_cmp > 0 ? memcmp(ts_obj_data + source_start, @@ -734,7 +733,7 @@ void Compare(const FunctionCallbackInfo &args) { SPREAD_BUFFER_ARG(args[0], obj_a); SPREAD_BUFFER_ARG(args[1], obj_b); - size_t cmp_length = MIN(obj_a_length, obj_b_length); + size_t cmp_length = std::min(obj_a_length, obj_b_length); int val = normalizeCompareVal(cmp_length > 0 ? memcmp(obj_a_data, obj_b_data, cmp_length) : 0, From 85d5f67efe902b3c6609a57d1434c2132372443d Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Tue, 5 Feb 2019 09:03:04 +0800 Subject: [PATCH 149/223] src: fix return type in Hash PR-URL: https://github.com/nodejs/node/pull/25936 Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- src/heap_utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/heap_utils.cc b/src/heap_utils.cc index a1ca118e6c1f93..e71a65e600631e 100644 --- a/src/heap_utils.cc +++ b/src/heap_utils.cc @@ -42,7 +42,7 @@ class JSGraphJSNode : public EmbedderGraph::Node { struct Hash { inline size_t operator()(JSGraphJSNode* n) const { - return n->IdentityHash(); + return static_cast(n->IdentityHash()); } }; From 8c9800ce2792f23df0e9e7a0bf548cd1b8e1ea31 Mon Sep 17 00:00:00 2001 From: Amit Zur Date: Wed, 16 Jan 2019 13:04:14 +0200 Subject: [PATCH 150/223] crypto: include 'Buffer' in error output of Hash.update method Fixes: https://github.com/nodejs/node/issues/25487 PR-URL: https://github.com/nodejs/node/pull/25533 Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Sam Roberts Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Benjamin Gruenbaum --- lib/internal/crypto/hash.js | 6 +++++- test/parallel/test-crypto-hash.js | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js index 7c697eb4772a19..3284604495026e 100644 --- a/lib/internal/crypto/hash.js +++ b/lib/internal/crypto/hash.js @@ -62,7 +62,11 @@ Hash.prototype.update = function update(data, encoding) { if (typeof data !== 'string' && !isArrayBufferView(data)) { throw new ERR_INVALID_ARG_TYPE('data', - ['string', 'TypedArray', 'DataView'], data); + ['string', + 'Buffer', + 'TypedArray', + 'DataView'], + data); } if (!this[kHandle].update(data, encoding || getDefaultEncoding())) diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js index 5cc622b48c76c4..60904cf08fec3d 100644 --- a/test/parallel/test-crypto-hash.js +++ b/test/parallel/test-crypto-hash.js @@ -122,6 +122,17 @@ common.expectsError( message: 'boom' }); +// Issue https://github.com/nodejs/node/issues/25487: error message for invalid +// arg type to update method should include all possible types +common.expectsError( + () => crypto.createHash('sha256').update(), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError, + message: 'The "data" argument must be one of type string, Buffer, ' + + 'TypedArray, or DataView. Received type undefined' + }); + // Default UTF-8 encoding const hutf8 = crypto.createHash('sha512').update('УТФ-8 text').digest('hex'); assert.strictEqual( From 5d2e0649739d2202c531977676e0d3f1dbc2490e Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 1 Feb 2019 06:27:04 -0800 Subject: [PATCH 151/223] worker: no throw on property access/postMessage after termination PR-URL: https://github.com/nodejs/node/pull/25871 Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan Reviewed-By: Luigi Pinca Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig Reviewed-By: Yuta Hiroto Reviewed-By: James M Snell --- lib/internal/worker.js | 8 +++++ test/parallel/test-worker-safe-getters.js | 38 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 test/parallel/test-worker-safe-getters.js diff --git a/lib/internal/worker.js b/lib/internal/worker.js index 1640a9dd88a2ba..da663798148441 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -184,6 +184,8 @@ class Worker extends EventEmitter { } postMessage(...args) { + if (this[kPublicPort] === null) return; + this[kPublicPort].postMessage(...args); } @@ -219,14 +221,20 @@ class Worker extends EventEmitter { } get stdin() { + if (this[kParentSideStdio] === null) return null; + return this[kParentSideStdio].stdin; } get stdout() { + if (this[kParentSideStdio] === null) return null; + return this[kParentSideStdio].stdout; } get stderr() { + if (this[kParentSideStdio] === null) return null; + return this[kParentSideStdio].stderr; } } diff --git a/test/parallel/test-worker-safe-getters.js b/test/parallel/test-worker-safe-getters.js new file mode 100644 index 00000000000000..23c8de7c7b0cfb --- /dev/null +++ b/test/parallel/test-worker-safe-getters.js @@ -0,0 +1,38 @@ +'use strict'; + +const common = require('../common'); + +const assert = require('assert'); +const { Worker, isMainThread } = require('worker_threads'); + +if (isMainThread) { + const w = new Worker(__filename, { + stdin: true, + stdout: true, + stderr: true + }); + + w.on('exit', common.mustCall((code) => { + assert.strictEqual(code, 0); + + // `postMessage` should not throw after termination + // (this mimics the browser behavior). + w.postMessage('foobar'); + w.ref(); + w.unref(); + + // Although not browser specific, probably wise to + // make sure the stream getters don't throw either. + w.stdin; + w.stdout; + w.stderr; + + // Sanity check. + assert.strictEqual(w.threadId, -1); + assert.strictEqual(w.stdin, null); + assert.strictEqual(w.stdout, null); + assert.strictEqual(w.stderr, null); + })); +} else { + process.exit(0); +} From 29c195e17f7c95ded72b353e7b62cd82c6ac1280 Mon Sep 17 00:00:00 2001 From: ZYSzys <17367077526@163.com> Date: Fri, 21 Dec 2018 16:07:22 +0800 Subject: [PATCH 152/223] fs: remove useless internalFS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/25161 Reviewed-By: Michaël Zasso Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: James M Snell --- lib/fs.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/fs.js b/lib/fs.js index fcedb4eb07844f..16bd80998e0552 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -52,7 +52,6 @@ const { } = errors.codes; const { FSReqCallback, statValues } = binding; -const internalFS = require('internal/fs/utils'); const { toPathIfFileURL } = require('internal/url'); const internalUtil = require('internal/util'); const { @@ -72,7 +71,7 @@ const { validateOffsetLengthRead, validateOffsetLengthWrite, validatePath -} = internalFS; +} = require('internal/fs/utils'); const { CHAR_FORWARD_SLASH, CHAR_BACKWARD_SLASH, From d123f944a250148e18f95f13efec83d300965315 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 7 Feb 2019 10:17:16 -0500 Subject: [PATCH 153/223] test: remove extraneous report validation argument The second argument passed to validate() and validateContent() is not used for anything. PR-URL: https://github.com/nodejs/node/pull/25986 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca --- test/node-report/test-api-getreport.js | 5 +---- test/node-report/test-api-nohooks.js | 4 +--- test/node-report/test-api-pass-error.js | 5 +---- test/node-report/test-api-uvhandles.js | 4 +--- test/node-report/test-api.js | 4 +--- test/node-report/test-exception.js | 4 +--- test/node-report/test-fatal-error.js | 8 +------- test/node-report/test-signal.js | 4 +--- 8 files changed, 8 insertions(+), 30 deletions(-) diff --git a/test/node-report/test-api-getreport.js b/test/node-report/test-api-getreport.js index 178469412d11fd..49e84d68a67ba9 100644 --- a/test/node-report/test-api-getreport.js +++ b/test/node-report/test-api-getreport.js @@ -21,8 +21,5 @@ if (process.argv[2] === 'child') { ' experimental feature. This feature could change at any time'), std_msg); const reportFiles = helper.findReports(child.pid, tmpdir.path); assert.deepStrictEqual(reportFiles, [], report_msg); - helper.validateContent(child.stdout, { pid: child.pid, - commandline: process.execPath + - ' ' + args.join(' ') - }); + helper.validateContent(child.stdout); } diff --git a/test/node-report/test-api-nohooks.js b/test/node-report/test-api-nohooks.js index 8b497e0663aa86..67d843c2701c17 100644 --- a/test/node-report/test-api-nohooks.js +++ b/test/node-report/test-api-nohooks.js @@ -23,8 +23,6 @@ if (process.argv[2] === 'child') { const reports = helper.findReports(child.pid, tmpdir.path); assert.strictEqual(reports.length, 1, report_msg); const report = reports[0]; - helper.validate(report, { pid: child.pid, - commandline: child.spawnargs.join(' ') - }); + helper.validate(report); })); } diff --git a/test/node-report/test-api-pass-error.js b/test/node-report/test-api-pass-error.js index caac6c7e8676d5..13e92570a72ead 100644 --- a/test/node-report/test-api-pass-error.js +++ b/test/node-report/test-api-pass-error.js @@ -25,9 +25,6 @@ if (process.argv[2] === 'child') { const reports = helper.findReports(child.pid, tmpdir.path); assert.strictEqual(reports.length, 1, report_msg); const report = reports[0]; - helper.validate(report, { pid: child.pid, - commandline: child.spawnargs.join(' '), - expectedException: 'Testing error handling', - }); + helper.validate(report); })); } diff --git a/test/node-report/test-api-uvhandles.js b/test/node-report/test-api-uvhandles.js index 52f58b6e135521..570fa42aa2f265 100644 --- a/test/node-report/test-api-uvhandles.js +++ b/test/node-report/test-api-uvhandles.js @@ -126,8 +126,6 @@ if (process.argv[2] === 'child') { assert.deepStrictEqual(udp, 1, udp_msg); // Common report tests. - helper.validateContent(stdout, { pid: child.pid, - commandline: child.spawnargs.join(' ') - }); + helper.validateContent(stdout); })); } diff --git a/test/node-report/test-api.js b/test/node-report/test-api.js index 9ffa66bb40c7b1..232fa1581f35ed 100644 --- a/test/node-report/test-api.js +++ b/test/node-report/test-api.js @@ -22,8 +22,6 @@ if (process.argv[2] === 'child') { const reports = helper.findReports(child.pid, tmpdir.path); assert.strictEqual(reports.length, 1, report_msg); const report = reports[0]; - helper.validate(report, { pid: child.pid, - commandline: child.spawnargs.join(' ') - }); + helper.validate(report); })); } diff --git a/test/node-report/test-exception.js b/test/node-report/test-exception.js index 9e423ec29cd8ec..e2c801afb9216e 100644 --- a/test/node-report/test-exception.js +++ b/test/node-report/test-exception.js @@ -37,8 +37,6 @@ if (process.argv[2] === 'child') { const reports = helper.findReports(child.pid, tmpdir.path); assert.strictEqual(reports.length, 1, report_msg); const report = reports[0]; - helper.validate(report, { pid: child.pid, - commandline: child.spawnargs.join(' ') - }); + helper.validate(report); })); } diff --git a/test/node-report/test-fatal-error.js b/test/node-report/test-fatal-error.js index 3d830aa72f0f8d..b6cf792725c9be 100644 --- a/test/node-report/test-fatal-error.js +++ b/test/node-report/test-fatal-error.js @@ -33,12 +33,6 @@ if (process.argv[2] === 'child') { const reports = helper.findReports(child.pid, tmpdir.path); assert.strictEqual(reports.length, 1); const report = reports[0]; - const options = { pid: child.pid }; - // Node.js currently overwrites the command line on AIX - // https://github.com/nodejs/node/issues/10607 - if (!(common.isAIX || common.isSunOS)) { - options.commandline = child.spawnargs.join(' '); - } - helper.validate(report, options); + helper.validate(report); })); } diff --git a/test/node-report/test-signal.js b/test/node-report/test-signal.js index 7368bb51c349c9..129933b5461cb9 100644 --- a/test/node-report/test-signal.js +++ b/test/node-report/test-signal.js @@ -73,8 +73,6 @@ if (process.argv[2] === 'child') { const reports = helper.findReports(child.pid, tmpdir.path); assert.deepStrictEqual(reports.length, 1, report_msg); const report = reports[0]; - helper.validate(report, { pid: child.pid, - commandline: child.spawnargs.join(' ') - }); + helper.validate(report); })); } From 2b48a381b9d2af8441cb43daefa1e1e4be68da05 Mon Sep 17 00:00:00 2001 From: ZYSzys <17367077526@163.com> Date: Fri, 21 Dec 2018 16:03:50 +0800 Subject: [PATCH 154/223] fs: remove redundant callback check PR-URL: https://github.com/nodejs/node/pull/25160 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- lib/fs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fs.js b/lib/fs.js index 16bd80998e0552..dc311ee1b1ac38 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -1539,7 +1539,7 @@ realpathSync.native = (path, options) => { function realpath(p, options, callback) { - callback = maybeCallback(typeof options === 'function' ? options : callback); + callback = typeof options === 'function' ? options : maybeCallback(callback); if (!options) options = emptyObj; else From 756558617e7420ac5c3b3911fb0fb565fe5d0338 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 13 Jan 2019 01:01:27 +0800 Subject: [PATCH 155/223] src: pass cli options to bootstrap/loaders.js lexically Instead of using `internalBinding('config')` which should be used to carry information about build-time options, directly pass the run-time cli options into bootstrap/loaders.js lexically via function arguments. PR-URL: https://github.com/nodejs/node/pull/25463 Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann Backport-PR-URL: https://github.com/nodejs/node/pull/26027 --- lib/internal/bootstrap/loaders.js | 7 +++---- src/node.cc | 13 +++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 4554526298b0a0..6eed9eab267fa4 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -42,7 +42,7 @@ // This file is compiled as if it's wrapped in a function with arguments // passed by node::LoadEnvironment() /* global process, getBinding, getLinkedBinding, getInternalBinding */ -/* global debugBreak */ +/* global debugBreak, experimentalModules, exposeInternals */ if (debugBreak) debugger; // eslint-disable-line no-debugger @@ -162,7 +162,6 @@ internalBinding('module_wrap').callbackMap = new WeakMap(); // written in CommonJS style. const loaderExports = { internalBinding, NativeModule }; const loaderId = 'internal/bootstrap/loaders'; -const config = internalBinding('config'); // Set up NativeModule. function NativeModule(id) { @@ -177,7 +176,7 @@ function NativeModule(id) { // Do not expose this to user land even with --expose-internals. this.canBeRequiredByUsers = false; } else if (id.startsWith('internal/')) { - this.canBeRequiredByUsers = config.exposeInternals; + this.canBeRequiredByUsers = exposeInternals; } else { this.canBeRequiredByUsers = true; } @@ -316,7 +315,7 @@ NativeModule.prototype.compile = function() { const fn = compileFunction(id); fn(this.exports, requireFn, this, process, internalBinding); - if (config.experimentalModules && this.canBeRequiredByUsers) { + if (experimentalModules && this.canBeRequiredByUsers) { this.proxifyExports(); } diff --git a/src/node.cc b/src/node.cc index 1c5d2cceb4d86f..881ace6e425a77 100644 --- a/src/node.cc +++ b/src/node.cc @@ -678,7 +678,12 @@ void RunBootstrapping(Environment* env) { FIXED_ONE_BYTE_STRING(isolate, "getBinding"), FIXED_ONE_BYTE_STRING(isolate, "getLinkedBinding"), FIXED_ONE_BYTE_STRING(isolate, "getInternalBinding"), - FIXED_ONE_BYTE_STRING(isolate, "debugBreak")}; + // --inspect-brk-node + FIXED_ONE_BYTE_STRING(isolate, "debugBreak"), + // --experimental-modules + FIXED_ONE_BYTE_STRING(isolate, "experimentalModules"), + // --expose-internals + FIXED_ONE_BYTE_STRING(isolate, "exposeInternals")}; std::vector> loaders_args = { process, env->NewFunctionTemplate(binding::GetBinding) @@ -691,7 +696,11 @@ void RunBootstrapping(Environment* env) { ->GetFunction(context) .ToLocalChecked(), Boolean::New(isolate, - env->options()->debug_options().break_node_first_line)}; + env->options()->debug_options().break_node_first_line), + Boolean::New(isolate, + env->options()->experimental_modules), + Boolean::New(isolate, + env->options()->expose_internals)}; MaybeLocal loader_exports; // Bootstrap internal loaders From d342707fa75b09d4f702b845fc3e021ca4ae6074 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 13 Jan 2019 01:03:49 +0800 Subject: [PATCH 156/223] src: remove unused `internalBinding('config')` properties Remove the following properties: - `preserveSymlinks` - `preserveSymlinksMain` - `experimentalModules` - `userLoader` - `experimentalVMModules` - `experimentalREPLAwait` - `exposeInternals` We used to use them to pass cli option values from C++ into JS, but now the values are obtained in JS land using `require('internal/options').getOptionValue` instead so they are unused. Also removes `test/parallel/test-internal-modules-expose.js` which tests `--expose-internals`. We already have hundreds of tests depending on `--expose-internals`, they are more than enough to test the functionality of the flag. PR-URL: https://github.com/nodejs/node/pull/25463 Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann Backport-PR-URL: https://github.com/nodejs/node/pull/26027 --- src/node_config.cc | 22 ------------------- test/parallel/test-internal-modules-expose.js | 12 ---------- 2 files changed, 34 deletions(-) delete mode 100644 test/parallel/test-internal-modules-expose.js diff --git a/src/node_config.cc b/src/node_config.cc index 45233eea129e99..1f851ef91cdd45 100644 --- a/src/node_config.cc +++ b/src/node_config.cc @@ -73,28 +73,6 @@ static void Initialize(Local target, #endif // NODE_HAVE_I18N_SUPPORT - if (env->options()->preserve_symlinks) - READONLY_TRUE_PROPERTY(target, "preserveSymlinks"); - if (env->options()->preserve_symlinks_main) - READONLY_TRUE_PROPERTY(target, "preserveSymlinksMain"); - - if (env->options()->experimental_modules) { - READONLY_TRUE_PROPERTY(target, "experimentalModules"); - const std::string& userland_loader = env->options()->userland_loader; - if (!userland_loader.empty()) { - READONLY_STRING_PROPERTY(target, "userLoader", userland_loader); - } - } - - if (env->options()->experimental_vm_modules) - READONLY_TRUE_PROPERTY(target, "experimentalVMModules"); - - if (env->options()->experimental_repl_await) - READONLY_TRUE_PROPERTY(target, "experimentalREPLAwait"); - - if (env->options()->expose_internals) - READONLY_TRUE_PROPERTY(target, "exposeInternals"); - READONLY_PROPERTY(target, "bits", Number::New(env->isolate(), 8 * sizeof(intptr_t))); diff --git a/test/parallel/test-internal-modules-expose.js b/test/parallel/test-internal-modules-expose.js deleted file mode 100644 index 5229032573088e..00000000000000 --- a/test/parallel/test-internal-modules-expose.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// Flags: --expose_internals - -require('../common'); -const assert = require('assert'); -const { internalBinding } = require('internal/test/binding'); -const config = internalBinding('config'); - -console.log(config, process.argv); - -assert.strictEqual(typeof require('internal/freelist').FreeList, 'function'); -assert.strictEqual(config.exposeInternals, true); From e6a4fb6d016f098d3846b2fd6604d562dbcc6f01 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 15 Jan 2019 23:12:21 +0800 Subject: [PATCH 157/223] process: split execution into main scripts This patch splits the execution mode selection from the environment setup in `lib/internal/bootstrap/node.js`, and split the entry point of different execution mode into main scripts under `lib/internal/main`: - `check_syntax.js`: used when `-c`/`--check` which only checks the syntax of the input instead of executing it. - `eval_stdin.js`: used when `-e` is passed without value and stdin is not a TTY (e.g. something is piped). - `eval_string`: used when `-e` is passed along with a string argument - `inspect.js`: for `node inspect`/`node debug` - `print_bash_completion.js`: for `--completion-bash` - `print_help.js`: for `--help` - `prof_process.js`: for `--prof-process` - `repl.js`: for the REPL - `run_main_module.js`: used when a main module is passed - `run_third_party_main.js`: for the legacy `_third_party_main.js` support - `worker_thread.js`: for workers This makes the entry points easier to navigate and paves the way for customized v8 snapshots (that do not need to deserialize execution mode setup) and better embedder APIs. As an example, after this patch, for the most common case where Node.js executes a user module as an entry point, it essentially goes through: - `lib/internal/per_context.js` to setup the v8 Context (which is also run when setting up contexts for the `vm` module) - `lib/internal/bootstrap/loaders.js` to set up internal binding and builtin module loaders (that are separate from the loaders accessible in the user land). - `lib/internal/bootstrap/node.js`: to set up the rest of the environment, including various globals and the process object - `lib/internal/main/run_main_module.js`: which is selected from C++ to prepare execution of the user module. This patch also removes `NativeModuleLoader::CompileAndCall` and exposes `NativeModuleLoader::LookupAndCompile` directly so that we can handle syntax errors and runtime errors of bootstrap scripts differently. PR-URL: https://github.com/nodejs/node/pull/25667 Reviewed-By: Anna Henningsen Backport-PR-URL: https://github.com/nodejs/node/pull/26036 --- lib/internal/bootstrap/cache.js | 19 +- lib/internal/bootstrap/loaders.js | 12 +- lib/internal/bootstrap/node.js | 823 ++++++------------ lib/internal/bootstrap/pre_execution.js | 82 ++ lib/internal/main/.eslintrc.yaml | 2 + lib/internal/main/check_syntax.js | 56 ++ lib/internal/main/eval_stdin.js | 26 + lib/internal/main/eval_string.js | 22 + lib/internal/main/inspect.js | 16 + .../print_bash_completion.js} | 6 +- lib/internal/{ => main}/print_help.js | 6 +- lib/internal/main/prof_process.js | 4 + lib/internal/main/repl.js | 44 + lib/internal/main/run_main_module.js | 27 + lib/internal/main/run_third_party_main.js | 9 + lib/internal/main/worker_thread.js | 39 + lib/internal/process/execution.js | 14 + node.gyp | 16 +- src/env.cc | 13 +- src/env.h | 24 +- src/node.cc | 216 +++-- src/node_internals.h | 5 +- src/node_native_module.cc | 20 - src/node_native_module.h | 24 +- src/node_worker.cc | 12 +- test/code-cache/test-code-cache.js | 4 +- test/message/assert_throws_stack.out | 1 - test/message/core_line_numbers.out | 2 +- test/message/error_exit.out | 3 +- test/message/eval_messages.out | 12 +- .../events_unhandled_error_common_trace.out | 5 +- .../events_unhandled_error_nexttick.out | 6 +- .../events_unhandled_error_sameline.out | 5 +- test/message/nexttick_throw.out | 3 +- test/message/stdin_messages.out | 17 +- .../unhandled_promise_trace_warnings.out | 4 - test/message/util_inspect_error.out | 5 - 37 files changed, 869 insertions(+), 735 deletions(-) create mode 100644 lib/internal/bootstrap/pre_execution.js create mode 100644 lib/internal/main/.eslintrc.yaml create mode 100644 lib/internal/main/check_syntax.js create mode 100644 lib/internal/main/eval_stdin.js create mode 100644 lib/internal/main/eval_string.js create mode 100644 lib/internal/main/inspect.js rename lib/internal/{bash_completion.js => main/print_bash_completion.js} (91%) rename lib/internal/{ => main}/print_help.js (99%) create mode 100644 lib/internal/main/prof_process.js create mode 100644 lib/internal/main/repl.js create mode 100644 lib/internal/main/run_main_module.js create mode 100644 lib/internal/main/run_third_party_main.js create mode 100644 lib/internal/main/worker_thread.js diff --git a/lib/internal/bootstrap/cache.js b/lib/internal/bootstrap/cache.js index e706ccb20dc813..bed20106060193 100644 --- a/lib/internal/bootstrap/cache.js +++ b/lib/internal/bootstrap/cache.js @@ -13,7 +13,7 @@ const { hasTracing, hasInspector } = process.binding('config'); // Modules with source code compiled in js2c that // cannot be compiled with the code cache. -const cannotUseCache = [ +const cannotBeRequired = [ 'sys', // Deprecated. 'internal/v8_prof_polyfill', 'internal/v8_prof_processor', @@ -21,8 +21,7 @@ const cannotUseCache = [ 'internal/per_context', 'internal/test/binding', - // TODO(joyeecheung): update the C++ side so that - // the code cache is also used when compiling these two files. + 'internal/bootstrap/loaders', 'internal/bootstrap/node' ]; @@ -30,16 +29,16 @@ const cannotUseCache = [ // Skip modules that cannot be required when they are not // built into the binary. if (!hasInspector) { - cannotUseCache.push( + cannotBeRequired.push( 'inspector', 'internal/util/inspector', ); } if (!hasTracing) { - cannotUseCache.push('trace_events'); + cannotBeRequired.push('trace_events'); } if (!process.versions.openssl) { - cannotUseCache.push( + cannotBeRequired.push( 'crypto', 'https', 'http2', @@ -67,11 +66,11 @@ if (!process.versions.openssl) { const cachableBuiltins = []; for (const id of NativeModule.map.keys()) { - if (id.startsWith('internal/deps') || + if (id.startsWith('internal/deps') || id.startsWith('internal/main') || id.startsWith('v8/') || id.startsWith('node-inspect/')) { - cannotUseCache.push(id); + cannotBeRequired.push(id); } - if (!cannotUseCache.includes(id)) { + if (!cannotBeRequired.includes(id)) { cachableBuiltins.push(id); } } @@ -80,5 +79,5 @@ module.exports = { cachableBuiltins, getCodeCache, compileFunction, - cannotUseCache + cannotBeRequired }; diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 6eed9eab267fa4..7078707b83adb1 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -160,7 +160,12 @@ internalBinding('module_wrap').callbackMap = new WeakMap(); // Think of this as module.exports in this file even though it is not // written in CommonJS style. -const loaderExports = { internalBinding, NativeModule }; +const loaderExports = { + internalBinding, + NativeModule, + require: nativeModuleRequire +}; + const loaderId = 'internal/bootstrap/loaders'; // Set up NativeModule. @@ -194,7 +199,7 @@ for (var i = 0; i < moduleIds.length; ++i) { NativeModule.map.set(id, mod); } -NativeModule.require = function(id) { +function nativeModuleRequire(id) { if (id === loaderId) { return loaderExports; } @@ -218,8 +223,9 @@ NativeModule.require = function(id) { moduleLoadList.push(`NativeModule ${id}`); mod.compile(); return mod.exports; -}; +} +NativeModule.require = nativeModuleRequire; NativeModule.exists = function(id) { return NativeModule.map.has(id); }; diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 27eb50f8d60ebf..24f7033f714845 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -21,570 +21,318 @@ const { internalBinding, NativeModule } = loaderExports; const { getOptionValue } = NativeModule.require('internal/options'); const config = internalBinding('config'); -function startup() { - setupTraceCategoryState(); - - setupProcessObject(); - - // TODO(joyeecheung): this does not have to done so early, any fatal errors - // thrown before user code execution should simply crash the process - // and we do not care about any clean up at that point. We don't care - // about emitting any events if the process crash upon bootstrap either. - { - const { - fatalException, - setUncaughtExceptionCaptureCallback, - hasUncaughtExceptionCaptureCallback - } = NativeModule.require('internal/process/execution'); - - process._fatalException = fatalException; - process.setUncaughtExceptionCaptureCallback = +setupTraceCategoryState(); + +setupProcessObject(); + +// TODO(joyeecheung): this does not have to done so early, any fatal errors +// thrown before user code execution should simply crash the process +// and we do not care about any clean up at that point. We don't care +// about emitting any events if the process crash upon bootstrap either. +{ + const { + fatalException, + setUncaughtExceptionCaptureCallback, + hasUncaughtExceptionCaptureCallback + } = NativeModule.require('internal/process/execution'); + + process._fatalException = fatalException; + process.setUncaughtExceptionCaptureCallback = setUncaughtExceptionCaptureCallback; - process.hasUncaughtExceptionCaptureCallback = + process.hasUncaughtExceptionCaptureCallback = hasUncaughtExceptionCaptureCallback; - } +} - setupGlobalVariables(); +setupGlobalVariables(); + +// Bootstrappers for all threads, including worker threads and main thread +const perThreadSetup = NativeModule.require('internal/process/per_thread'); +// Bootstrappers for the main thread only +let mainThreadSetup; +// Bootstrappers for the worker threads only +let workerThreadSetup; +if (isMainThread) { + mainThreadSetup = NativeModule.require( + 'internal/process/main_thread_only' + ); +} else { + workerThreadSetup = NativeModule.require( + 'internal/process/worker_thread_only' + ); +} - // Bootstrappers for all threads, including worker threads and main thread - const perThreadSetup = NativeModule.require('internal/process/per_thread'); - // Bootstrappers for the main thread only - let mainThreadSetup; - // Bootstrappers for the worker threads only - let workerThreadSetup; - if (isMainThread) { - mainThreadSetup = NativeModule.require( - 'internal/process/main_thread_only' - ); - } else { - workerThreadSetup = NativeModule.require( - 'internal/process/worker_thread_only' - ); - } +// process.config is serialized config.gypi +process.config = JSON.parse(internalBinding('native_module').config); - // process.config is serialized config.gypi - process.config = JSON.parse(internalBinding('native_module').config); +const rawMethods = internalBinding('process_methods'); +// Set up methods and events on the process object for the main thread +if (isMainThread) { + // This depends on process being an event emitter + mainThreadSetup.setupSignalHandlers(internalBinding); - const rawMethods = internalBinding('process_methods'); - // Set up methods and events on the process object for the main thread - if (isMainThread) { - // This depends on process being an event emitter - mainThreadSetup.setupSignalHandlers(internalBinding); - - process.abort = rawMethods.abort; - const wrapped = mainThreadSetup.wrapProcessMethods(rawMethods); - process.umask = wrapped.umask; - process.chdir = wrapped.chdir; - - // TODO(joyeecheung): deprecate and remove these underscore methods - process._debugProcess = rawMethods._debugProcess; - process._debugEnd = rawMethods._debugEnd; - process._startProfilerIdleNotifier = + process.abort = rawMethods.abort; + const wrapped = mainThreadSetup.wrapProcessMethods(rawMethods); + process.umask = wrapped.umask; + process.chdir = wrapped.chdir; + + // TODO(joyeecheung): deprecate and remove these underscore methods + process._debugProcess = rawMethods._debugProcess; + process._debugEnd = rawMethods._debugEnd; + process._startProfilerIdleNotifier = rawMethods._startProfilerIdleNotifier; - process._stopProfilerIdleNotifier = rawMethods._stopProfilerIdleNotifier; - } else { - const wrapped = workerThreadSetup.wrapProcessMethods(rawMethods); + process._stopProfilerIdleNotifier = rawMethods._stopProfilerIdleNotifier; +} else { + const wrapped = workerThreadSetup.wrapProcessMethods(rawMethods); - process.umask = wrapped.umask; - } + process.umask = wrapped.umask; +} - // Set up methods on the process object for all threads - { - process.cwd = rawMethods.cwd; - process.dlopen = rawMethods.dlopen; - process.uptime = rawMethods.uptime; - - // TODO(joyeecheung): either remove them or make them public - process._getActiveRequests = rawMethods._getActiveRequests; - process._getActiveHandles = rawMethods._getActiveHandles; - - // TODO(joyeecheung): remove these - process.reallyExit = rawMethods.reallyExit; - process._kill = rawMethods._kill; - - const wrapped = perThreadSetup.wrapProcessMethods(rawMethods); - process._rawDebug = wrapped._rawDebug; - process.hrtime = wrapped.hrtime; - process.hrtime.bigint = wrapped.hrtimeBigInt; - process.cpuUsage = wrapped.cpuUsage; - process.memoryUsage = wrapped.memoryUsage; - process.kill = wrapped.kill; - process.exit = wrapped.exit; - } +// Set up methods on the process object for all threads +{ + process.cwd = rawMethods.cwd; + process.dlopen = rawMethods.dlopen; + process.uptime = rawMethods.uptime; + + // TODO(joyeecheung): either remove them or make them public + process._getActiveRequests = rawMethods._getActiveRequests; + process._getActiveHandles = rawMethods._getActiveHandles; + + // TODO(joyeecheung): remove these + process.reallyExit = rawMethods.reallyExit; + process._kill = rawMethods._kill; + + const wrapped = perThreadSetup.wrapProcessMethods(rawMethods); + process._rawDebug = wrapped._rawDebug; + process.hrtime = wrapped.hrtime; + process.hrtime.bigint = wrapped.hrtimeBigInt; + process.cpuUsage = wrapped.cpuUsage; + process.memoryUsage = wrapped.memoryUsage; + process.kill = wrapped.kill; + process.exit = wrapped.exit; +} - const { - onWarning, - emitWarning - } = NativeModule.require('internal/process/warning'); - if (!process.noProcessWarnings && process.env.NODE_NO_WARNINGS !== '1') { - process.on('warning', onWarning); - } - process.emitWarning = emitWarning; +const { + onWarning, + emitWarning +} = NativeModule.require('internal/process/warning'); +if (!process.noProcessWarnings && process.env.NODE_NO_WARNINGS !== '1') { + process.on('warning', onWarning); +} +process.emitWarning = emitWarning; + +const { + nextTick, + runNextTicks +} = NativeModule.require('internal/process/next_tick').setup(); + +process.nextTick = nextTick; +// Used to emulate a tick manually in the JS land. +// A better name for this function would be `runNextTicks` but +// it has been exposed to the process object so we keep this legacy name +// TODO(joyeecheung): either remove it or make it public +process._tickCallback = runNextTicks; + +const credentials = internalBinding('credentials'); +if (credentials.implementsPosixCredentials) { + process.getuid = credentials.getuid; + process.geteuid = credentials.geteuid; + process.getgid = credentials.getgid; + process.getegid = credentials.getegid; + process.getgroups = credentials.getgroups; - const { - nextTick, - runNextTicks - } = NativeModule.require('internal/process/next_tick').setup(); - - process.nextTick = nextTick; - // Used to emulate a tick manually in the JS land. - // A better name for this function would be `runNextTicks` but - // it has been exposed to the process object so we keep this legacy name - // TODO(joyeecheung): either remove it or make it public - process._tickCallback = runNextTicks; - - const credentials = internalBinding('credentials'); - if (credentials.implementsPosixCredentials) { - process.getuid = credentials.getuid; - process.geteuid = credentials.geteuid; - process.getgid = credentials.getgid; - process.getegid = credentials.getegid; - process.getgroups = credentials.getgroups; - - if (isMainThread) { - const wrapped = mainThreadSetup.wrapPosixCredentialSetters(credentials); - process.initgroups = wrapped.initgroups; - process.setgroups = wrapped.setgroups; - process.setegid = wrapped.setegid; - process.seteuid = wrapped.seteuid; - process.setgid = wrapped.setgid; - process.setuid = wrapped.setuid; - } + if (isMainThread) { + const wrapped = mainThreadSetup.wrapPosixCredentialSetters(credentials); + process.initgroups = wrapped.initgroups; + process.setgroups = wrapped.setgroups; + process.setegid = wrapped.setegid; + process.seteuid = wrapped.seteuid; + process.setgid = wrapped.setgid; + process.setuid = wrapped.setuid; } +} - if (isMainThread) { - const { getStdout, getStdin, getStderr } = +if (isMainThread) { + const { getStdout, getStdin, getStderr } = NativeModule.require('internal/process/stdio').getMainThreadStdio(); - setupProcessStdio(getStdout, getStdin, getStderr); - } else { - const { getStdout, getStdin, getStderr } = + setupProcessStdio(getStdout, getStdin, getStderr); +} else { + const { getStdout, getStdin, getStderr } = workerThreadSetup.initializeWorkerStdio(); - setupProcessStdio(getStdout, getStdin, getStderr); - } - - if (config.hasInspector) { - const { - enable, - disable - } = NativeModule.require('internal/inspector_async_hook'); - internalBinding('inspector').registerAsyncHook(enable, disable); - } - - // If the process is spawned with env NODE_CHANNEL_FD, it's probably - // spawned by our child_process module, then initialize IPC. - // This attaches some internal event listeners and creates: - // process.send(), process.channel, process.connected, - // process.disconnect() - if (isMainThread && process.env.NODE_CHANNEL_FD) { - mainThreadSetup.setupChildProcessIpcChannel(); - } + setupProcessStdio(getStdout, getStdin, getStderr); +} - // TODO(joyeecheung): move this down further to get better snapshotting - const experimentalPolicy = getOptionValue('--experimental-policy'); - if (isMainThread && experimentalPolicy) { - process.emitWarning('Policies are experimental.', - 'ExperimentalWarning'); - const { pathToFileURL, URL } = NativeModule.require('url'); - // URL here as it is slightly different parsing - // no bare specifiers for now - let manifestURL; - if (NativeModule.require('path').isAbsolute(experimentalPolicy)) { - manifestURL = new URL(`file:///${experimentalPolicy}`); - } else { - const cwdURL = pathToFileURL(process.cwd()); - cwdURL.pathname += '/'; - manifestURL = new URL(experimentalPolicy, cwdURL); - } - const fs = NativeModule.require('fs'); - const src = fs.readFileSync(manifestURL, 'utf8'); - NativeModule.require('internal/process/policy') - .setup(src, manifestURL.href); - } +if (config.hasInspector) { + const { + enable, + disable + } = NativeModule.require('internal/inspector_async_hook'); + internalBinding('inspector').registerAsyncHook(enable, disable); +} - const browserGlobals = !process._noBrowserGlobals; - if (browserGlobals) { - setupGlobalTimeouts(); - setupGlobalConsole(); - setupGlobalURL(); - setupGlobalEncoding(); - setupQueueMicrotask(); - } +// If the process is spawned with env NODE_CHANNEL_FD, it's probably +// spawned by our child_process module, then initialize IPC. +// This attaches some internal event listeners and creates: +// process.send(), process.channel, process.connected, +// process.disconnect() +if (isMainThread && process.env.NODE_CHANNEL_FD) { + mainThreadSetup.setupChildProcessIpcChannel(); +} - setupDOMException(); +const browserGlobals = !process._noBrowserGlobals; +if (browserGlobals) { + setupGlobalTimeouts(); + setupGlobalConsole(); + setupGlobalURL(); + setupGlobalEncoding(); + setupQueueMicrotask(); +} - // On OpenBSD process.execPath will be relative unless we - // get the full path before process.execPath is used. - if (process.platform === 'openbsd') { - const { realpathSync } = NativeModule.require('fs'); - process.execPath = realpathSync.native(process.execPath); - } +setupDOMException(); - Object.defineProperty(process, 'argv0', { - enumerable: true, - configurable: false, - value: process.argv[0] - }); - process.argv[0] = process.execPath; +// On OpenBSD process.execPath will be relative unless we +// get the full path before process.execPath is used. +if (process.platform === 'openbsd') { + const { realpathSync } = NativeModule.require('fs'); + process.execPath = realpathSync.native(process.execPath); +} - // Handle `--debug*` deprecation and invalidation. - if (process._invalidDebug) { - process.emitWarning( - '`node --debug` and `node --debug-brk` are invalid. ' + +Object.defineProperty(process, 'argv0', { + enumerable: true, + configurable: false, + value: process.argv[0] +}); +process.argv[0] = process.execPath; + +// Handle `--debug*` deprecation and invalidation. +if (process._invalidDebug) { + process.emitWarning( + '`node --debug` and `node --debug-brk` are invalid. ' + 'Please use `node --inspect` or `node --inspect-brk` instead.', - 'DeprecationWarning', 'DEP0062', startup, true); - process.exit(9); - } else if (process._deprecatedDebugBrk) { - process.emitWarning( - '`node --inspect --debug-brk` is deprecated. ' + + 'DeprecationWarning', 'DEP0062', undefined, true); + process.exit(9); +} else if (process._deprecatedDebugBrk) { + process.emitWarning( + '`node --inspect --debug-brk` is deprecated. ' + 'Please use `node --inspect-brk` instead.', - 'DeprecationWarning', 'DEP0062', startup, true); - } + 'DeprecationWarning', 'DEP0062', undefined, true); +} - const { deprecate } = NativeModule.require('internal/util'); - { - // Install legacy getters on the `util` binding for typechecking. - // TODO(addaleax): Turn into a full runtime deprecation. - const pendingDeprecation = getOptionValue('--pending-deprecation'); - const utilBinding = internalBinding('util'); - const types = NativeModule.require('internal/util/types'); - for (const name of [ - 'isArrayBuffer', 'isArrayBufferView', 'isAsyncFunction', - 'isDataView', 'isDate', 'isExternal', 'isMap', 'isMapIterator', - 'isNativeError', 'isPromise', 'isRegExp', 'isSet', 'isSetIterator', - 'isTypedArray', 'isUint8Array', 'isAnyArrayBuffer' - ]) { - utilBinding[name] = pendingDeprecation ? - deprecate(types[name], - 'Accessing native typechecking bindings of Node ' + +const { deprecate } = NativeModule.require('internal/util'); +{ + // Install legacy getters on the `util` binding for typechecking. + // TODO(addaleax): Turn into a full runtime deprecation. + const pendingDeprecation = getOptionValue('--pending-deprecation'); + const utilBinding = internalBinding('util'); + const types = NativeModule.require('internal/util/types'); + for (const name of [ + 'isArrayBuffer', 'isArrayBufferView', 'isAsyncFunction', + 'isDataView', 'isDate', 'isExternal', 'isMap', 'isMapIterator', + 'isNativeError', 'isPromise', 'isRegExp', 'isSet', 'isSetIterator', + 'isTypedArray', 'isUint8Array', 'isAnyArrayBuffer' + ]) { + utilBinding[name] = pendingDeprecation ? + deprecate(types[name], + 'Accessing native typechecking bindings of Node ' + 'directly is deprecated. ' + `Please use \`util.types.${name}\` instead.`, - 'DEP0103') : - types[name]; - } + 'DEP0103') : + types[name]; } - - // TODO(jasnell): The following have been globals since around 2012. - // That's just silly. The underlying perfctr support has been removed - // so these are now deprecated non-ops that can be removed after one - // major release cycle. - if (process.platform === 'win32') { - const names = [ - 'NET_SERVER_CONNECTION', - 'NET_SERVER_CONNECTION_CLOSE', - 'HTTP_SERVER_REQUEST', - 'HTTP_SERVER_RESPONSE', - 'HTTP_CLIENT_REQUEST', - 'HTTP_CLIENT_RESPONSE' - ]; - for (var n = 0; n < names.length; n++) { - Object.defineProperty(global, `COUNTER_${names[n]}`, { - configurable: true, - enumerable: false, - value: deprecate(noop, - `COUNTER_${names[n]}() is deprecated.`, - 'DEP0120') - }); - } - } - - // process.allowedNodeEnvironmentFlags - Object.defineProperty(process, 'allowedNodeEnvironmentFlags', { - get() { - const flags = perThreadSetup.buildAllowedFlags(); - process.allowedNodeEnvironmentFlags = flags; - return process.allowedNodeEnvironmentFlags; - }, - // If the user tries to set this to another value, override - // this completely to that value. - set(value) { - Object.defineProperty(this, 'allowedNodeEnvironmentFlags', { - value, - configurable: true, - enumerable: true, - writable: true - }); - }, - enumerable: true, - configurable: true - }); - // process.assert - process.assert = deprecate( - perThreadSetup.assert, - 'process.assert() is deprecated. Please use the `assert` module instead.', - 'DEP0100'); - - // TODO(joyeecheung): this property has not been well-maintained, should we - // deprecate it in favor of a better API? - const { isDebugBuild, hasOpenSSL } = config; - Object.defineProperty(process, 'features', { - enumerable: true, - writable: false, - configurable: false, - value: { - debug: isDebugBuild, - uv: true, - ipv6: true, // TODO(bnoordhuis) ping libuv - tls_alpn: hasOpenSSL, - tls_sni: hasOpenSSL, - tls_ocsp: hasOpenSSL, - tls: hasOpenSSL - } - }); - - // User-facing NODE_V8_COVERAGE environment variable that writes - // ScriptCoverage to a specified file. - if (process.env.NODE_V8_COVERAGE) { - const originalReallyExit = process.reallyExit; - const cwd = NativeModule.require('internal/process/execution').tryGetCwd(); - const { resolve } = NativeModule.require('path'); - // Resolve the coverage directory to an absolute path, and - // overwrite process.env so that the original path gets passed - // to child processes even when they switch cwd. - const coverageDirectory = resolve(cwd, process.env.NODE_V8_COVERAGE); - process.env.NODE_V8_COVERAGE = coverageDirectory; - const { - writeCoverage, - setCoverageDirectory - } = NativeModule.require('internal/coverage-gen/with_profiler'); - setCoverageDirectory(coverageDirectory); - process.on('exit', writeCoverage); - process.reallyExit = (code) => { - writeCoverage(); - originalReallyExit(code); - }; - } - - const perf = internalBinding('performance'); - const { - NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE, - } = perf.constants; - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); - - if (getOptionValue('--experimental-report')) { - NativeModule.require('internal/process/report').setup(); - } - - if (isMainThread) { - return startMainThreadExecution; - } else { - return startWorkerThreadExecution; - } -} - -function startWorkerThreadExecution() { - // If we are in a worker thread, execute the script sent through the - // message port. - const { - getEnvMessagePort, - threadId - } = internalBinding('worker'); - const { - createMessageHandler, - createWorkerFatalExeception - } = NativeModule.require('internal/process/worker_thread_only'); - - // Set up the message port and start listening - const debug = NativeModule.require('util').debuglog('worker'); - debug(`[${threadId}] is setting up worker child environment`); - - const port = getEnvMessagePort(); - port.on('message', createMessageHandler( - port, - prepareUserCodeExecution)); - port.start(); - - // Overwrite fatalException - process._fatalException = createWorkerFatalExeception(port); } -// There are various modes that Node can run in. The most common two -// are running from a script and running the REPL - but there are a few -// others like the debugger or running --eval arguments. Here we decide -// which mode we run in. -function startMainThreadExecution(mainScript) { - if (mainScript) { - process.nextTick(() => { - NativeModule.require(mainScript); - }); - return; - } - - // `node inspect ...` or `node debug ...` - if (process.argv[1] === 'inspect' || process.argv[1] === 'debug') { - if (process.argv[1] === 'debug') { - process.emitWarning( - '`node debug` is deprecated. Please use `node inspect` instead.', - 'DeprecationWarning', 'DEP0068'); - } - - // Start the debugger agent. - process.nextTick(() => { - NativeModule.require('internal/deps/node-inspect/lib/_inspect').start(); +// TODO(jasnell): The following have been globals since around 2012. +// That's just silly. The underlying perfctr support has been removed +// so these are now deprecated non-ops that can be removed after one +// major release cycle. +if (process.platform === 'win32') { + const names = [ + 'NET_SERVER_CONNECTION', + 'NET_SERVER_CONNECTION_CLOSE', + 'HTTP_SERVER_REQUEST', + 'HTTP_SERVER_RESPONSE', + 'HTTP_CLIENT_REQUEST', + 'HTTP_CLIENT_RESPONSE' + ]; + for (var n = 0; n < names.length; n++) { + Object.defineProperty(global, `COUNTER_${names[n]}`, { + configurable: true, + enumerable: false, + value: deprecate(noop, + `COUNTER_${names[n]}() is deprecated.`, + 'DEP0120') }); - return; - } - - // node --help - if (getOptionValue('--help')) { - NativeModule.require('internal/print_help').print(process.stdout); - return; } - - // e.g. node --completion-bash >> ~/.bashrc - if (getOptionValue('--completion-bash')) { - NativeModule.require('internal/bash_completion').print(process.stdout); - return; - } - - // `node --prof-process` - if (getOptionValue('--prof-process')) { - NativeModule.require('internal/v8_prof_processor'); - return; - } - - // There is user code to be run. - prepareUserCodeExecution(); - executeUserCode(); } -function prepareUserCodeExecution() { - // If this is a worker in cluster mode, start up the communication - // channel. This needs to be done before any user code gets executed - // (including preload modules). - if (process.argv[1] && process.env.NODE_UNIQUE_ID) { - const cluster = NativeModule.require('cluster'); - cluster._setupWorker(); - // Make sure it's not accidentally inherited by child processes. - delete process.env.NODE_UNIQUE_ID; - } - - const experimentalModules = getOptionValue('--experimental-modules'); - const experimentalVMModules = getOptionValue('--experimental-vm-modules'); - if (experimentalModules || experimentalVMModules) { - if (experimentalModules) { - process.emitWarning( - 'The ESM module loader is experimental.', - 'ExperimentalWarning', undefined); - } - - const { - setImportModuleDynamicallyCallback, - setInitializeImportMetaObjectCallback - } = internalBinding('module_wrap'); - const esm = NativeModule.require('internal/process/esm_loader'); - // Setup per-isolate callbacks that locate data or callbacks that we keep - // track of for different ESM modules. - setInitializeImportMetaObjectCallback(esm.initializeImportMetaObject); - setImportModuleDynamicallyCallback(esm.importModuleDynamicallyCallback); - const userLoader = getOptionValue('--loader'); - // If --loader is specified, create a loader with user hooks. Otherwise - // create the default loader. - esm.initializeLoader(process.cwd(), userLoader); - } - - // For user code, we preload modules if `-r` is passed - const preloadModules = getOptionValue('--require'); - if (preloadModules.length) { - const { - _preloadModules - } = NativeModule.require('internal/modules/cjs/loader'); - _preloadModules(preloadModules); - } -} - -function executeUserCode() { - // User passed `-e` or `--eval` arguments to Node without `-i` or - // `--interactive`. - // Note that the name `forceRepl` is merely an alias of `interactive` - // in code. - if (getOptionValue('[has_eval_string]') && !getOptionValue('--interactive')) { - const { - addBuiltinLibsToObject - } = NativeModule.require('internal/modules/cjs/helpers'); - addBuiltinLibsToObject(global); - const source = getOptionValue('--eval'); - const { evalScript } = NativeModule.require('internal/process/execution'); - evalScript('[eval]', source, process._breakFirstLine); - return; - } - - // If the first argument is a file name, run it as a main script - if (process.argv[1] && process.argv[1] !== '-') { - // Expand process.argv[1] into a full path. - const path = NativeModule.require('path'); - process.argv[1] = path.resolve(process.argv[1]); - - const CJSModule = NativeModule.require('internal/modules/cjs/loader'); - - // If user passed `-c` or `--check` arguments to Node, check its syntax - // instead of actually running the file. - if (getOptionValue('--check')) { - const fs = NativeModule.require('fs'); - // Read the source. - const filename = CJSModule._resolveFilename(process.argv[1]); - const source = fs.readFileSync(filename, 'utf-8'); - checkScriptSyntax(source, filename); - process.exit(0); - } - - // Note: this actually tries to run the module as a ESM first if - // --experimental-modules is on. - // TODO(joyeecheung): can we move that logic to here? Note that this - // is an undocumented method available via `require('module').runMain` - CJSModule.runMain(); - return; - } - - // Create the REPL if `-i` or `--interactive` is passed, or if - // stdin is a TTY. - // Note that the name `forceRepl` is merely an alias of `interactive` - // in code. - if (process._forceRepl || NativeModule.require('tty').isatty(0)) { - const cliRepl = NativeModule.require('internal/repl'); - cliRepl.createInternalRepl(process.env, (err, repl) => { - if (err) { - throw err; - } - repl.on('exit', () => { - if (repl._flushing) { - repl.pause(); - return repl.once('flushHistory', () => { - process.exit(); - }); - } - process.exit(); - }); +// process.allowedNodeEnvironmentFlags +Object.defineProperty(process, 'allowedNodeEnvironmentFlags', { + get() { + const flags = perThreadSetup.buildAllowedFlags(); + process.allowedNodeEnvironmentFlags = flags; + return process.allowedNodeEnvironmentFlags; + }, + // If the user tries to set this to another value, override + // this completely to that value. + set(value) { + Object.defineProperty(this, 'allowedNodeEnvironmentFlags', { + value, + configurable: true, + enumerable: true, + writable: true }); - - // User passed '-e' or '--eval' along with `-i` or `--interactive` - if (process._eval != null) { - const { evalScript } = NativeModule.require('internal/process/execution'); - evalScript('[eval]', process._eval, process._breakFirstLine); - } - return; - } - - // Stdin is not a TTY, we will read it and execute it. - readAndExecuteStdin(); + }, + enumerable: true, + configurable: true +}); +// process.assert +process.assert = deprecate( + perThreadSetup.assert, + 'process.assert() is deprecated. Please use the `assert` module instead.', + 'DEP0100'); + +// TODO(joyeecheung): this property has not been well-maintained, should we +// deprecate it in favor of a better API? +const { isDebugBuild, hasOpenSSL } = config; +Object.defineProperty(process, 'features', { + enumerable: true, + writable: false, + configurable: false, + value: { + debug: isDebugBuild, + uv: true, + ipv6: true, // TODO(bnoordhuis) ping libuv + tls_alpn: hasOpenSSL, + tls_sni: hasOpenSSL, + tls_ocsp: hasOpenSSL, + tls: hasOpenSSL + } +}); + +// User-facing NODE_V8_COVERAGE environment variable that writes +// ScriptCoverage to a specified file. +if (process.env.NODE_V8_COVERAGE) { + const originalReallyExit = process.reallyExit; + const cwd = NativeModule.require('internal/process/execution').tryGetCwd(); + const { resolve } = NativeModule.require('path'); + // Resolve the coverage directory to an absolute path, and + // overwrite process.env so that the original path gets passed + // to child processes even when they switch cwd. + const coverageDirectory = resolve(cwd, process.env.NODE_V8_COVERAGE); + process.env.NODE_V8_COVERAGE = coverageDirectory; + const { + writeCoverage, + setCoverageDirectory + } = NativeModule.require('internal/coverage-gen/with_profiler'); + setCoverageDirectory(coverageDirectory); + process.on('exit', writeCoverage); + process.reallyExit = (code) => { + writeCoverage(); + originalReallyExit(code); + }; } -function readAndExecuteStdin() { - process.stdin.setEncoding('utf8'); - - let code = ''; - process.stdin.on('data', (d) => { - code += d; - }); - - process.stdin.on('end', () => { - if (process._syntax_check_only != null) { - checkScriptSyntax(code, '[stdin]'); - } else { - process._eval = code; - const { evalScript } = NativeModule.require('internal/process/execution'); - evalScript('[stdin]', process._eval, process._breakFirstLine); - } - }); +if (getOptionValue('--experimental-report')) { + NativeModule.require('internal/process/report').setup(); } function setupTraceCategoryState() { @@ -810,22 +558,3 @@ function setupDOMException() { } function noop() {} - -function checkScriptSyntax(source, filename) { - const CJSModule = NativeModule.require('internal/modules/cjs/loader'); - const vm = NativeModule.require('vm'); - const { - stripShebang, stripBOM - } = NativeModule.require('internal/modules/cjs/helpers'); - - // Remove Shebang. - source = stripShebang(source); - // Remove BOM. - source = stripBOM(source); - // Wrap it. - source = CJSModule.wrap(source); - // Compile the script, this will throw if it fails. - new vm.Script(source, { displayErrors: true, filename }); -} - -return startup(); diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js new file mode 100644 index 00000000000000..798c581a721735 --- /dev/null +++ b/lib/internal/bootstrap/pre_execution.js @@ -0,0 +1,82 @@ +'use strict'; + +const { getOptionValue } = require('internal/options'); + +function initializeClusterIPC() { + // If this is a worker in cluster mode, start up the communication + // channel. This needs to be done before any user code gets executed + // (including preload modules). + if (process.argv[1] && process.env.NODE_UNIQUE_ID) { + const cluster = require('cluster'); + cluster._setupWorker(); + // Make sure it's not accidentally inherited by child processes. + delete process.env.NODE_UNIQUE_ID; + } +} + +function initializePolicy() { + const experimentalPolicy = getOptionValue('--experimental-policy'); + if (experimentalPolicy) { + process.emitWarning('Policies are experimental.', + 'ExperimentalWarning'); + const { pathToFileURL, URL } = require('url'); + // URL here as it is slightly different parsing + // no bare specifiers for now + let manifestURL; + if (require('path').isAbsolute(experimentalPolicy)) { + manifestURL = new URL(`file:///${experimentalPolicy}`); + } else { + const cwdURL = pathToFileURL(process.cwd()); + cwdURL.pathname += '/'; + manifestURL = new URL(experimentalPolicy, cwdURL); + } + const fs = require('fs'); + const src = fs.readFileSync(manifestURL, 'utf8'); + require('internal/process/policy') + .setup(src, manifestURL.href); + } +} + +function initializeESMLoader() { + const experimentalModules = getOptionValue('--experimental-modules'); + const experimentalVMModules = getOptionValue('--experimental-vm-modules'); + if (experimentalModules || experimentalVMModules) { + if (experimentalModules) { + process.emitWarning( + 'The ESM module loader is experimental.', + 'ExperimentalWarning', undefined); + } + + const { + setImportModuleDynamicallyCallback, + setInitializeImportMetaObjectCallback + } = internalBinding('module_wrap'); + const esm = require('internal/process/esm_loader'); + // Setup per-isolate callbacks that locate data or callbacks that we keep + // track of for different ESM modules. + setInitializeImportMetaObjectCallback(esm.initializeImportMetaObject); + setImportModuleDynamicallyCallback(esm.importModuleDynamicallyCallback); + const userLoader = getOptionValue('--loader'); + // If --loader is specified, create a loader with user hooks. Otherwise + // create the default loader. + esm.initializeLoader(process.cwd(), userLoader); + } +} + +function loadPreloadModules() { + // For user code, we preload modules if `-r` is passed + const preloadModules = getOptionValue('--require'); + if (preloadModules) { + const { + _preloadModules + } = require('internal/modules/cjs/loader'); + _preloadModules(preloadModules); + } +} + +module.exports = { + initializeClusterIPC, + initializePolicy, + initializeESMLoader, + loadPreloadModules +}; diff --git a/lib/internal/main/.eslintrc.yaml b/lib/internal/main/.eslintrc.yaml new file mode 100644 index 00000000000000..dfb75077782301 --- /dev/null +++ b/lib/internal/main/.eslintrc.yaml @@ -0,0 +1,2 @@ +globals: + markBootstrapComplete: true diff --git a/lib/internal/main/check_syntax.js b/lib/internal/main/check_syntax.js new file mode 100644 index 00000000000000..5d4d7a04ebd0eb --- /dev/null +++ b/lib/internal/main/check_syntax.js @@ -0,0 +1,56 @@ +'use strict'; + +// If user passed `-c` or `--check` arguments to Node, check its syntax +// instead of actually running the file. + +const { + initializeClusterIPC, + initializePolicy, + initializeESMLoader, + loadPreloadModules +} = require('internal/bootstrap/pre_execution'); + +const { + readStdin +} = require('internal/process/execution'); + +const CJSModule = require('internal/modules/cjs/loader'); +const vm = require('vm'); +const { + stripShebang, stripBOM +} = require('internal/modules/cjs/helpers'); + +// TODO(joyeecheung): not every one of these are necessary +initializeClusterIPC(); +initializePolicy(); +initializeESMLoader(); +loadPreloadModules(); +markBootstrapComplete(); + +if (process.argv[1] && process.argv[1] !== '-') { + // Expand process.argv[1] into a full path. + const path = require('path'); + process.argv[1] = path.resolve(process.argv[1]); + // Read the source. + const filename = CJSModule._resolveFilename(process.argv[1]); + + const fs = require('fs'); + const source = fs.readFileSync(filename, 'utf-8'); + + checkScriptSyntax(source, filename); +} else { + readStdin((code) => { + checkScriptSyntax(code, '[stdin]'); + }); +} + +function checkScriptSyntax(source, filename) { + // Remove Shebang. + source = stripShebang(source); + // Remove BOM. + source = stripBOM(source); + // Wrap it. + source = CJSModule.wrap(source); + // Compile the script, this will throw if it fails. + new vm.Script(source, { displayErrors: true, filename }); +} diff --git a/lib/internal/main/eval_stdin.js b/lib/internal/main/eval_stdin.js new file mode 100644 index 00000000000000..ad15fdb93cd49d --- /dev/null +++ b/lib/internal/main/eval_stdin.js @@ -0,0 +1,26 @@ +'use strict'; + +// Stdin is not a TTY, we will read it and execute it. + +const { + initializeClusterIPC, + initializePolicy, + initializeESMLoader, + loadPreloadModules +} = require('internal/bootstrap/pre_execution'); + +const { + evalScript, + readStdin +} = require('internal/process/execution'); + +initializeClusterIPC(); +initializePolicy(); +initializeESMLoader(); +loadPreloadModules(); +markBootstrapComplete(); + +readStdin((code) => { + process._eval = code; + evalScript('[stdin]', process._eval, process._breakFirstLine); +}); diff --git a/lib/internal/main/eval_string.js b/lib/internal/main/eval_string.js new file mode 100644 index 00000000000000..cd382b48e76663 --- /dev/null +++ b/lib/internal/main/eval_string.js @@ -0,0 +1,22 @@ +'use strict'; + +// User passed `-e` or `--eval` arguments to Node without `-i` or +// `--interactive`. + +const { + initializeClusterIPC, + initializePolicy, + initializeESMLoader, + loadPreloadModules +} = require('internal/bootstrap/pre_execution'); +const { evalScript } = require('internal/process/execution'); +const { addBuiltinLibsToObject } = require('internal/modules/cjs/helpers'); + +const source = require('internal/options').getOptionValue('--eval'); +initializeClusterIPC(); +initializePolicy(); +initializeESMLoader(); +loadPreloadModules(); +addBuiltinLibsToObject(global); +markBootstrapComplete(); +evalScript('[eval]', source, process._breakFirstLine); diff --git a/lib/internal/main/inspect.js b/lib/internal/main/inspect.js new file mode 100644 index 00000000000000..7376f8984b13e1 --- /dev/null +++ b/lib/internal/main/inspect.js @@ -0,0 +1,16 @@ +'use strict'; + +// `node inspect ...` or `node debug ...` + +if (process.argv[1] === 'debug') { + process.emitWarning( + '`node debug` is deprecated. Please use `node inspect` instead.', + 'DeprecationWarning', 'DEP0068'); +} + +markBootstrapComplete(); + +// Start the debugger agent. +process.nextTick(() => { + require('internal/deps/node-inspect/lib/_inspect').start(); +}); diff --git a/lib/internal/bash_completion.js b/lib/internal/main/print_bash_completion.js similarity index 91% rename from lib/internal/bash_completion.js rename to lib/internal/main/print_bash_completion.js index 13363e8c4b8c32..225ed3d2221c00 100644 --- a/lib/internal/bash_completion.js +++ b/lib/internal/main/print_bash_completion.js @@ -18,6 +18,6 @@ function print(stream) { complete -F _node_complete node node_g`); } -module.exports = { - print -}; +markBootstrapComplete(); + +print(process.stdout); diff --git a/lib/internal/print_help.js b/lib/internal/main/print_help.js similarity index 99% rename from lib/internal/print_help.js rename to lib/internal/main/print_help.js index fdec7bd09bd87e..ca60994d942c6c 100644 --- a/lib/internal/print_help.js +++ b/lib/internal/main/print_help.js @@ -172,6 +172,6 @@ function print(stream) { stream.write('\nDocumentation can be found at https://nodejs.org/\n'); } -module.exports = { - print -}; +markBootstrapComplete(); + +print(process.stdout); diff --git a/lib/internal/main/prof_process.js b/lib/internal/main/prof_process.js new file mode 100644 index 00000000000000..a1143cb201e79c --- /dev/null +++ b/lib/internal/main/prof_process.js @@ -0,0 +1,4 @@ +'use strict'; + +markBootstrapComplete(); +require('internal/v8_prof_processor'); diff --git a/lib/internal/main/repl.js b/lib/internal/main/repl.js new file mode 100644 index 00000000000000..4ca328421bcb9a --- /dev/null +++ b/lib/internal/main/repl.js @@ -0,0 +1,44 @@ +'use strict'; + +// Create the REPL if `-i` or `--interactive` is passed, or if +// the main module is not specified and stdin is a TTY. + +const { + initializeClusterIPC, + initializePolicy, + initializeESMLoader, + loadPreloadModules +} = require('internal/bootstrap/pre_execution'); + +const { + evalScript +} = require('internal/process/execution'); + +initializeClusterIPC(); +initializePolicy(); +initializeESMLoader(); +loadPreloadModules(); + +const cliRepl = require('internal/repl'); +cliRepl.createInternalRepl(process.env, (err, repl) => { + if (err) { + throw err; + } + repl.on('exit', () => { + if (repl._flushing) { + repl.pause(); + return repl.once('flushHistory', () => { + process.exit(); + }); + } + process.exit(); + }); +}); + +// If user passed '-e' or '--eval' along with `-i` or `--interactive`, +// evaluate the code in the current context. +if (process._eval != null) { + evalScript('[eval]', process._eval, process._breakFirstLine); +} + +markBootstrapComplete(); diff --git a/lib/internal/main/run_main_module.js b/lib/internal/main/run_main_module.js new file mode 100644 index 00000000000000..b5049cffc5250c --- /dev/null +++ b/lib/internal/main/run_main_module.js @@ -0,0 +1,27 @@ +'use strict'; + +const { + initializeClusterIPC, + initializePolicy, + initializeESMLoader, + loadPreloadModules +} = require('internal/bootstrap/pre_execution'); + +initializeClusterIPC(); +initializePolicy(); +initializeESMLoader(); +loadPreloadModules(); + +// Expand process.argv[1] into a full path. +const path = require('path'); +process.argv[1] = path.resolve(process.argv[1]); + +const CJSModule = require('internal/modules/cjs/loader'); + +markBootstrapComplete(); + +// Note: this actually tries to run the module as a ESM first if +// --experimental-modules is on. +// TODO(joyeecheung): can we move that logic to here? Note that this +// is an undocumented method available via `require('module').runMain` +CJSModule.runMain(); diff --git a/lib/internal/main/run_third_party_main.js b/lib/internal/main/run_third_party_main.js new file mode 100644 index 00000000000000..c26c1f25f380c8 --- /dev/null +++ b/lib/internal/main/run_third_party_main.js @@ -0,0 +1,9 @@ +'use strict'; + +// Legacy _third_party_main.js support + +markBootstrapComplete(); + +process.nextTick(() => { + require('_third_party_main'); +}); diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js new file mode 100644 index 00000000000000..62a4bb1b7dd77e --- /dev/null +++ b/lib/internal/main/worker_thread.js @@ -0,0 +1,39 @@ +'use strict'; + +// In worker threads, execute the script sent through the +// message port. + +const { + initializeClusterIPC, + initializeESMLoader, + loadPreloadModules +} = require('internal/bootstrap/pre_execution'); + +const { + getEnvMessagePort, + threadId +} = internalBinding('worker'); + +const { + createMessageHandler, + createWorkerFatalExeception +} = require('internal/process/worker_thread_only'); + +const debug = require('util').debuglog('worker'); +debug(`[${threadId}] is setting up worker child environment`); + +function prepareUserCodeExecution() { + initializeClusterIPC(); + initializeESMLoader(); + loadPreloadModules(); +} + +// Set up the message port and start listening +const port = getEnvMessagePort(); +port.on('message', createMessageHandler(port, prepareUserCodeExecution)); +port.start(); + +// Overwrite fatalException +process._fatalException = createWorkerFatalExeception(port); + +markBootstrapComplete(); diff --git a/lib/internal/process/execution.js b/lib/internal/process/execution.js index 7aac90d79d7248..a35feaacce28ff 100644 --- a/lib/internal/process/execution.js +++ b/lib/internal/process/execution.js @@ -164,7 +164,21 @@ function createFatalException() { }; } +function readStdin(callback) { + process.stdin.setEncoding('utf8'); + + let code = ''; + process.stdin.on('data', (d) => { + code += d; + }); + + process.stdin.on('end', () => { + callback(code); + }); +} + module.exports = { + readStdin, tryGetCwd, evalScript, fatalException: createFatalException(), diff --git a/node.gyp b/node.gyp index 8f974b020b8e75..56b7548349f1dc 100644 --- a/node.gyp +++ b/node.gyp @@ -30,6 +30,7 @@ 'lib/internal/bootstrap/cache.js', 'lib/internal/bootstrap/loaders.js', 'lib/internal/bootstrap/node.js', + 'lib/internal/bootstrap/pre_execution.js', 'lib/async_hooks.js', 'lib/assert.js', 'lib/buffer.js', @@ -87,7 +88,6 @@ 'lib/internal/assert.js', 'lib/internal/assert/assertion_error.js', 'lib/internal/async_hooks.js', - 'lib/internal/bash_completion.js', 'lib/internal/buffer.js', 'lib/internal/cli_table.js', 'lib/internal/child_process.js', @@ -132,6 +132,17 @@ 'lib/internal/inspector_async_hook.js', 'lib/internal/js_stream_socket.js', 'lib/internal/linkedlist.js', + 'lib/internal/main/check_syntax.js', + 'lib/internal/main/eval_string.js', + 'lib/internal/main/eval_stdin.js', + 'lib/internal/main/inspect.js', + 'lib/internal/main/print_bash_completion.js', + 'lib/internal/main/print_help.js', + 'lib/internal/main/prof_process.js', + 'lib/internal/main/repl.js', + 'lib/internal/main/run_main_module.js', + 'lib/internal/main/run_third_party_main.js', + 'lib/internal/main/worker_thread.js', 'lib/internal/modules/cjs/helpers.js', 'lib/internal/modules/cjs/loader.js', 'lib/internal/modules/esm/loader.js', @@ -143,9 +154,8 @@ 'lib/internal/safe_globals.js', 'lib/internal/net.js', 'lib/internal/options.js', - 'lib/internal/policy/sri.js', 'lib/internal/policy/manifest.js', - 'lib/internal/print_help.js', + 'lib/internal/policy/sri.js', 'lib/internal/priority_queue.js', 'lib/internal/process/esm_loader.js', 'lib/internal/process/execution.js', diff --git a/src/env.cc b/src/env.cc index bdec7129e0bca6..269da1a49f1ee6 100644 --- a/src/env.cc +++ b/src/env.cc @@ -330,9 +330,20 @@ void Environment::Start(bool start_profiler_idle_notifier) { uv_key_set(&thread_local_env, this); } -MaybeLocal Environment::CreateProcessObject( +MaybeLocal Environment::ProcessCliArgs( const std::vector& args, const std::vector& exec_args) { + if (args.size() > 1) { + std::string first_arg = args[1]; + if (first_arg == "inspect") { + execution_mode_ = ExecutionMode::kInspect; + } else if (first_arg == "debug") { + execution_mode_ = ExecutionMode::kDebug; + } else if (first_arg != "-") { + execution_mode_ = ExecutionMode::kRunMainModule; + } + } + if (*TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( TRACING_CATEGORY_NODE1(environment)) != 0) { auto traced_value = tracing::TracedValue::Create(); diff --git a/src/env.h b/src/env.h index 009d00f6378c70..8a6b2d0e479997 100644 --- a/src/env.h +++ b/src/env.h @@ -353,11 +353,13 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2; V(http2session_on_stream_trailers_function, v8::Function) \ V(http2settings_constructor_template, v8::ObjectTemplate) \ V(http2stream_constructor_template, v8::ObjectTemplate) \ + V(internal_binding_loader, v8::Function) \ V(immediate_callback_function, v8::Function) \ V(inspector_console_extension_installer, v8::Function) \ V(libuv_stream_wrap_ctor_template, v8::FunctionTemplate) \ V(message_port, v8::Object) \ V(message_port_constructor_template, v8::FunctionTemplate) \ + V(native_module_require, v8::Function) \ V(performance_entry_callback, v8::Function) \ V(performance_entry_template, v8::Function) \ V(pipe_constructor_template, v8::FunctionTemplate) \ @@ -369,7 +371,6 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2; V(script_data_constructor_function, v8::Function) \ V(secure_context_constructor_template, v8::FunctionTemplate) \ V(shutdown_wrap_template, v8::ObjectTemplate) \ - V(start_execution_function, v8::Function) \ V(tcp_constructor_template, v8::FunctionTemplate) \ V(tick_callback_function, v8::Function) \ V(timers_callback_function, v8::Function) \ @@ -609,7 +610,7 @@ class Environment { ~Environment(); void Start(bool start_profiler_idle_notifier); - v8::MaybeLocal CreateProcessObject( + v8::MaybeLocal ProcessCliArgs( const std::vector& args, const std::vector& exec_args); @@ -926,6 +927,24 @@ class Environment { inline std::shared_ptr options(); inline std::shared_ptr inspector_host_port(); + enum class ExecutionMode { + kDefault, + kInspect, // node inspect + kDebug, // node debug + kPrintHelp, // node --help + kPrintBashCompletion, // node --completion-bash + kProfProcess, // node --prof-process + kEvalString, // node --eval without --interactive + kCheckSyntax, // node --check (incompatible with --eval) + kRepl, + kEvalStdin, + kRunMainModule + }; + + inline ExecutionMode execution_mode() { return execution_mode_; } + + inline void set_execution_mode(ExecutionMode mode) { execution_mode_ = mode; } + private: inline void CreateImmediate(native_immediate_callback cb, void* data, @@ -935,6 +954,7 @@ class Environment { inline void ThrowError(v8::Local (*fun)(v8::Local), const char* errmsg); + ExecutionMode execution_mode_ = ExecutionMode::kDefault; std::list loaded_addons_; v8::Isolate* const isolate_; IsolateData* const isolate_data_; diff --git a/src/node.cc b/src/node.cc index 881ace6e425a77..e67b16af83f0df 100644 --- a/src/node.cc +++ b/src/node.cc @@ -100,6 +100,7 @@ #if defined(_MSC_VER) #include #include +#define STDIN_FILENO 0 #else #include #include // getrlimit, setrlimit @@ -114,6 +115,7 @@ using v8::Array; using v8::Boolean; using v8::Context; using v8::DEFAULT; +using v8::EscapableHandleScope; using v8::Exception; using v8::Function; using v8::FunctionCallbackInfo; @@ -605,8 +607,20 @@ static MaybeLocal ExecuteBootstrapper( const char* id, std::vector>* parameters, std::vector>* arguments) { - MaybeLocal ret = per_process::native_module_loader.CompileAndCall( - env->context(), id, parameters, arguments, env); + EscapableHandleScope scope(env->isolate()); + MaybeLocal maybe_fn = + per_process::native_module_loader.LookupAndCompile( + env->context(), id, parameters, env); + + if (maybe_fn.IsEmpty()) { + return MaybeLocal(); + } + + Local fn = maybe_fn.ToLocalChecked(); + MaybeLocal result = fn->Call(env->context(), + Undefined(env->isolate()), + arguments->size(), + arguments->data()); // If there was an error during bootstrap then it was either handled by the // FatalException handler or it's unrecoverable (e.g. max call stack @@ -615,44 +629,17 @@ static MaybeLocal ExecuteBootstrapper( // There are only two ways to have a stack size > 1: 1) the user manually // called MakeCallback or 2) user awaited during bootstrap, which triggered // _tickCallback(). - if (ret.IsEmpty()) { + if (result.IsEmpty()) { env->async_hooks()->clear_async_id_stack(); } - return ret; -} - -void LoadEnvironment(Environment* env) { - RunBootstrapping(env); - - // To allow people to extend Node in different ways, this hook allows - // one to drop a file lib/_third_party_main.js into the build - // directory which will be executed instead of Node's normal loading. - if (per_process::native_module_loader.Exists("_third_party_main")) { - StartExecution(env, "_third_party_main"); - } else { - // TODO(joyeecheung): create different scripts for different - // execution modes: - // - `main_thread_main.js` when env->is_main_thread() - // - `worker_thread_main.js` when !env->is_main_thread() - // - `run_third_party_main.js` for `_third_party_main` - // - `inspect_main.js` for `node inspect` - // - `mkcodecache_main.js` for the code cache generator - // - `print_help_main.js` for --help - // - `bash_completion_main.js` for --completion-bash - // - `internal/v8_prof_processor` for --prof-process - // And leave bootstrap/node.js dedicated to the setup of the environment. - // We may want to move this switch out of LoadEnvironment, especially for - // the per-process options. - StartExecution(env, nullptr); - } + return scope.EscapeMaybe(result); } -void RunBootstrapping(Environment* env) { +MaybeLocal RunBootstrapping(Environment* env) { CHECK(!env->has_run_bootstrapping_code()); - env->set_has_run_bootstrapping_code(true); - HandleScope handle_scope(env->isolate()); + EscapableHandleScope scope(env->isolate()); Isolate* isolate = env->isolate(); Local context = env->context(); @@ -702,14 +689,24 @@ void RunBootstrapping(Environment* env) { Boolean::New(isolate, env->options()->expose_internals)}; - MaybeLocal loader_exports; // Bootstrap internal loaders - loader_exports = ExecuteBootstrapper( + MaybeLocal loader_exports = ExecuteBootstrapper( env, "internal/bootstrap/loaders", &loaders_params, &loaders_args); if (loader_exports.IsEmpty()) { - return; + return MaybeLocal(); } + Local loader_exports_obj = + loader_exports.ToLocalChecked().As(); + Local internal_binding_loader = + loader_exports_obj->Get(context, env->internal_binding_string()) + .ToLocalChecked(); + env->set_internal_binding_loader(internal_binding_loader.As()); + + Local require = + loader_exports_obj->Get(context, env->require_string()).ToLocalChecked(); + env->set_native_module_require(require.As()); + // process, loaderExports, isMainThread std::vector> node_params = { env->process_string(), @@ -717,43 +714,107 @@ void RunBootstrapping(Environment* env) { FIXED_ONE_BYTE_STRING(isolate, "isMainThread")}; std::vector> node_args = { process, - loader_exports.ToLocalChecked(), + loader_exports_obj, Boolean::New(isolate, env->is_main_thread())}; - Local start_execution; - if (!ExecuteBootstrapper( - env, "internal/bootstrap/node", &node_params, &node_args) - .ToLocal(&start_execution)) { - return; - } + MaybeLocal result = ExecuteBootstrapper( + env, "internal/bootstrap/node", &node_params, &node_args); - if (start_execution->IsFunction()) - env->set_start_execution_function(start_execution.As()); + env->set_has_run_bootstrapping_code(true); + + return scope.EscapeMaybe(result); } -void StartExecution(Environment* env, const char* main_script_id) { - HandleScope handle_scope(env->isolate()); - // We have to use Local<>::New because of the optimized way in which we access - // the object in the env->...() getters, which does not play well with - // resetting the handle while we're accessing the object through the Local<>. - Local start_execution = - Local::New(env->isolate(), env->start_execution_function()); - env->set_start_execution_function(Local()); - - if (start_execution.IsEmpty()) return; - - Local main_script_v; - if (main_script_id == nullptr) { - // TODO(joyeecheung): make this mandatory - we may also create an overload - // for main_script that is a Local. - main_script_v = Undefined(env->isolate()); - } else { - main_script_v = OneByteString(env->isolate(), main_script_id); +void MarkBootstrapComplete(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + env->performance_state()->Mark( + performance::NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); +} + +MaybeLocal StartExecution(Environment* env, const char* main_script_id) { + EscapableHandleScope scope(env->isolate()); + CHECK_NE(main_script_id, nullptr); + + std::vector> parameters = { + env->process_string(), + env->require_string(), + env->internal_binding_string(), + FIXED_ONE_BYTE_STRING(env->isolate(), "markBootstrapComplete")}; + + std::vector> arguments = { + env->process_object(), + env->native_module_require(), + env->internal_binding_loader(), + env->NewFunctionTemplate(MarkBootstrapComplete) + ->GetFunction(env->context()) + .ToLocalChecked()}; + + MaybeLocal result = + ExecuteBootstrapper(env, main_script_id, ¶meters, &arguments); + return scope.EscapeMaybe(result); +} + +MaybeLocal StartMainThreadExecution(Environment* env) { + // To allow people to extend Node in different ways, this hook allows + // one to drop a file lib/_third_party_main.js into the build + // directory which will be executed instead of Node's normal loading. + if (per_process::native_module_loader.Exists("_third_party_main")) { + return StartExecution(env, "internal/main/run_third_party_main"); + } + + if (env->execution_mode() == Environment::ExecutionMode::kInspect || + env->execution_mode() == Environment::ExecutionMode::kDebug) { + return StartExecution(env, "internal/main/inspect"); + } + + if (per_process::cli_options->print_help) { + env->set_execution_mode(Environment::ExecutionMode::kPrintHelp); + return StartExecution(env, "internal/main/print_help"); + } + + if (per_process::cli_options->print_bash_completion) { + env->set_execution_mode(Environment::ExecutionMode::kPrintBashCompletion); + return StartExecution(env, "internal/main/print_bash_completion"); + } + + if (env->options()->prof_process) { + env->set_execution_mode(Environment::ExecutionMode::kPrintBashCompletion); + return StartExecution(env, "internal/main/prof_process"); + } + + // -e/--eval without -i/--interactive + if (env->options()->has_eval_string && !env->options()->force_repl) { + env->set_execution_mode(Environment::ExecutionMode::kEvalString); + return StartExecution(env, "internal/main/eval_string"); + } + + if (env->options()->syntax_check_only) { + env->set_execution_mode(Environment::ExecutionMode::kCheckSyntax); + return StartExecution(env, "internal/main/check_syntax"); + } + + if (env->execution_mode() == Environment::ExecutionMode::kRunMainModule) { + return StartExecution(env, "internal/main/run_main_module"); + } + + if (env->options()->force_repl || uv_guess_handle(STDIN_FILENO) == UV_TTY) { + env->set_execution_mode(Environment::ExecutionMode::kRepl); + return StartExecution(env, "internal/main/repl"); } - Local argv[] = {main_script_v}; - USE(start_execution->Call( - env->context(), Undefined(env->isolate()), arraysize(argv), argv)); + env->set_execution_mode(Environment::ExecutionMode::kEvalStdin); + return StartExecution(env, "internal/main/eval_stdin"); +} + +void LoadEnvironment(Environment* env) { + CHECK(env->is_main_thread()); + // TODO(joyeecheung): Not all of the execution modes in + // StartMainThreadExecution() make sense for embedders. Pick the + // useful ones out, and allow embedders to customize the entry + // point more directly without using _third_party_main.js + if (!RunBootstrapping(env).IsEmpty()) { + USE(StartMainThreadExecution(env)); + } } @@ -1180,7 +1241,7 @@ Environment* CreateEnvironment(IsolateData* isolate_data, std::vector exec_args(exec_argv, exec_argv + exec_argc); Environment* env = new Environment(isolate_data, context); env->Start(per_process::v8_is_profiling); - env->CreateProcessObject(args, exec_args); + env->ProcessCliArgs(args, exec_args); return env; } @@ -1220,7 +1281,7 @@ void FreePlatform(MultiIsolatePlatform* platform) { Local NewContext(Isolate* isolate, Local object_template) { - auto context = Context::New(isolate, nullptr, object_template); + Local context = Context::New(isolate, nullptr, object_template); if (context.IsEmpty()) return context; HandleScope handle_scope(isolate); @@ -1233,12 +1294,19 @@ Local NewContext(Isolate* isolate, std::vector> parameters = { FIXED_ONE_BYTE_STRING(isolate, "global")}; - std::vector> arguments = {context->Global()}; - MaybeLocal result = per_process::native_module_loader.CompileAndCall( - context, "internal/per_context", ¶meters, &arguments, nullptr); + Local arguments[] = {context->Global()}; + MaybeLocal maybe_fn = + per_process::native_module_loader.LookupAndCompile( + context, "internal/per_context", ¶meters, nullptr); + if (maybe_fn.IsEmpty()) { + return Local(); + } + Local fn = maybe_fn.ToLocalChecked(); + MaybeLocal result = + fn->Call(context, Undefined(isolate), arraysize(arguments), arguments); + // Execution failed during context creation. + // TODO(joyeecheung): deprecate this signature and return a MaybeLocal. if (result.IsEmpty()) { - // Execution failed during context creation. - // TODO(joyeecheung): deprecate this signature and return a MaybeLocal. return Local(); } } @@ -1255,7 +1323,7 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, Context::Scope context_scope(context); Environment env(isolate_data, context); env.Start(per_process::v8_is_profiling); - env.CreateProcessObject(args, exec_args); + env.ProcessCliArgs(args, exec_args); #if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM CHECK(!env.inspector_agent()->IsListening()); diff --git a/src/node_internals.h b/src/node_internals.h index 0d4fe74ebf3d02..bf66c77e6f043c 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -268,8 +268,9 @@ bool SafeGetenv(const char* key, std::string* text); void DefineZlibConstants(v8::Local target); -void RunBootstrapping(Environment* env); -void StartExecution(Environment* env, const char* main_script_id); +v8::MaybeLocal RunBootstrapping(Environment* env); +v8::MaybeLocal StartExecution(Environment* env, + const char* main_script_id); } // namespace node diff --git a/src/node_native_module.cc b/src/node_native_module.cc index 27456dd54606e4..675495e34bff5a 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -175,26 +175,6 @@ void NativeModuleLoader::CompileFunction( } } -// TODO(joyeecheung): it should be possible to generate the argument names -// from some special comments for the bootstrapper case. -MaybeLocal NativeModuleLoader::CompileAndCall( - Local context, - const char* id, - std::vector>* parameters, - std::vector>* arguments, - Environment* optional_env) { - Isolate* isolate = context->GetIsolate(); - MaybeLocal compiled = - per_process::native_module_loader.LookupAndCompile( - context, id, parameters, nullptr); - if (compiled.IsEmpty()) { - return MaybeLocal(); - } - Local fn = compiled.ToLocalChecked().As(); - return fn->Call( - context, v8::Null(isolate), arguments->size(), arguments->data()); -} - MaybeLocal NativeModuleLoader::CompileAsModule(Environment* env, const char* id) { std::vector> parameters = {env->exports_string(), diff --git a/src/node_native_module.h b/src/node_native_module.h index 62c417a0b61474..be1fc92a7672f3 100644 --- a/src/node_native_module.h +++ b/src/node_native_module.h @@ -42,20 +42,17 @@ class NativeModuleLoader { // Returns config.gypi as a JSON string v8::Local GetConfigString(v8::Isolate* isolate) const; - // Run a script with JS source bundled inside the binary as if it's wrapped - // in a function called with a null receiver and arguments specified in C++. - // The returned value is empty if an exception is encountered. - // JS code run with this method can assume that their top-level - // declarations won't affect the global scope. - v8::MaybeLocal CompileAndCall( + bool Exists(const char* id); + + // For bootstrappers optional_env may be a nullptr. + // If an exception is encountered (e.g. source code contains + // syntax error), the returned value is empty. + v8::MaybeLocal LookupAndCompile( v8::Local context, const char* id, std::vector>* parameters, - std::vector>* arguments, Environment* optional_env); - bool Exists(const char* id); - private: static void GetCacheUsage(const v8::FunctionCallbackInfo& args); // Passing ids of builtin module source code into JS land as @@ -87,15 +84,6 @@ class NativeModuleLoader { static v8::MaybeLocal CompileAsModule(Environment* env, const char* id); - // For bootstrappers optional_env may be a nullptr. - // If an exception is encountered (e.g. source code contains - // syntax error), the returned value is empty. - v8::MaybeLocal LookupAndCompile( - v8::Local context, - const char* id, - std::vector>* parameters, - Environment* optional_env); - NativeModuleRecordMap source_; NativeModuleCacheMap code_cache_; UnionBytes config_; diff --git a/src/node_worker.cc b/src/node_worker.cc index e5ba438bc1501c..4b78d653929d4b 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -133,8 +133,8 @@ Worker::Worker(Environment* env, env_->set_thread_id(thread_id_); env_->Start(env->profiler_idle_notifier_started()); - env_->CreateProcessObject(std::vector{}, - std::vector{}); + env_->ProcessCliArgs(std::vector{}, + std::vector{}); // Done while on the parent thread AddWorkerInspector(env, env_.get(), thread_id_, url_); } @@ -192,10 +192,10 @@ void Worker::Run() { HandleScope handle_scope(isolate_); Environment::AsyncCallbackScope callback_scope(env_.get()); env_->async_hooks()->push_async_ids(1, 0); - RunBootstrapping(env_.get()); - // TODO(joyeecheung): create a main script for worker threads - // that starts listening on the message port. - StartExecution(env_.get(), nullptr); + if (!RunBootstrapping(env_.get()).IsEmpty()) { + USE(StartExecution(env_.get(), "internal/main/worker_thread")); + } + env_->async_hooks()->pop_async_id(1); Debug(this, "Loaded environment for worker %llu", thread_id_); diff --git a/test/code-cache/test-code-cache.js b/test/code-cache/test-code-cache.js index 54bd0b0e2a66be..6232f1ae61b324 100644 --- a/test/code-cache/test-code-cache.js +++ b/test/code-cache/test-code-cache.js @@ -9,7 +9,7 @@ const { isMainThread } = require('../common'); const assert = require('assert'); const { cachableBuiltins, - cannotUseCache + cannotBeRequired } = require('internal/bootstrap/cache'); const { @@ -60,7 +60,7 @@ if (process.config.variables.node_code_cache_path === undefined) { ); for (const key of loadedModules) { - if (cannotUseCache.includes(key)) { + if (cannotBeRequired.includes(key)) { assert(compiledWithoutCache.has(key), `"${key}" should've been compiled without code cache`); } else { diff --git a/test/message/assert_throws_stack.out b/test/message/assert_throws_stack.out index cf96ee42c98cb7..0457670d6a317c 100644 --- a/test/message/assert_throws_stack.out +++ b/test/message/assert_throws_stack.out @@ -17,4 +17,3 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal: at * at * at * - at * diff --git a/test/message/core_line_numbers.out b/test/message/core_line_numbers.out index 59953132fa0542..0336e5b451651e 100644 --- a/test/message/core_line_numbers.out +++ b/test/message/core_line_numbers.out @@ -12,4 +12,4 @@ RangeError: Invalid input at tryModuleLoad (internal/modules/cjs/loader.js:*:*) at Function.Module._load (internal/modules/cjs/loader.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) + at internal/main/run_main_module.js:*:* diff --git a/test/message/error_exit.out b/test/message/error_exit.out index 7e0112d586cecb..3364210099ca75 100644 --- a/test/message/error_exit.out +++ b/test/message/error_exit.out @@ -14,5 +14,4 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: at tryModuleLoad (internal/modules/cjs/loader.js:*:*) at Function.Module._load (internal/modules/cjs/loader.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/run_main_module.js:*:* diff --git a/test/message/eval_messages.out b/test/message/eval_messages.out index 3af7c9792121b9..0d2e68f3d79b04 100644 --- a/test/message/eval_messages.out +++ b/test/message/eval_messages.out @@ -9,8 +9,7 @@ SyntaxError: Strict mode code may not include a with statement at Object. ([eval]-wrapper:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*) at evalScript (internal/process/execution.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/eval_string.js:*:* 42 42 [eval]:1 @@ -24,8 +23,7 @@ Error: hello at Object. ([eval]-wrapper:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*) at evalScript (internal/process/execution.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/eval_string.js:*:* [eval]:1 throw new Error("hello") @@ -38,8 +36,7 @@ Error: hello at Object. ([eval]-wrapper:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*) at evalScript (internal/process/execution.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/eval_string.js:*:* 100 [eval]:1 var x = 100; y = x; @@ -52,8 +49,7 @@ ReferenceError: y is not defined at Object. ([eval]-wrapper:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*) at evalScript (internal/process/execution.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/eval_string.js:*:* [eval]:1 var ______________________________________________; throw 10 diff --git a/test/message/events_unhandled_error_common_trace.out b/test/message/events_unhandled_error_common_trace.out index 331d669272320c..0d64143c67f865 100644 --- a/test/message/events_unhandled_error_common_trace.out +++ b/test/message/events_unhandled_error_common_trace.out @@ -12,11 +12,10 @@ Error: foo:bar at tryModuleLoad (internal/modules/cjs/loader.js:*:*) at Function.Module._load (internal/modules/cjs/loader.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) + at internal/main/run_main_module.js:*:* Emitted 'error' event at: at quux (*events_unhandled_error_common_trace.js:*:*) at Object. (*events_unhandled_error_common_trace.js:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*) [... lines matching original stack trace ...] - at executeUserCode (internal/bootstrap/node.js:*:*) - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/run_main_module.js:*:* diff --git a/test/message/events_unhandled_error_nexttick.out b/test/message/events_unhandled_error_nexttick.out index 8875eda532882f..4132ae9f3bc1be 100644 --- a/test/message/events_unhandled_error_nexttick.out +++ b/test/message/events_unhandled_error_nexttick.out @@ -10,12 +10,10 @@ Error at tryModuleLoad (internal/modules/cjs/loader.js:*:*) at Function.Module._load (internal/modules/cjs/loader.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/run_main_module.js:*:* Emitted 'error' event at: at process.nextTick (*events_unhandled_error_nexttick.js:*:*) at processTicksAndRejections (internal/process/next_tick.js:*:*) at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/run_main_module.js:*:* diff --git a/test/message/events_unhandled_error_sameline.out b/test/message/events_unhandled_error_sameline.out index ff024c826eb5da..f877b254aafe97 100644 --- a/test/message/events_unhandled_error_sameline.out +++ b/test/message/events_unhandled_error_sameline.out @@ -10,10 +10,9 @@ Error at tryModuleLoad (internal/modules/cjs/loader.js:*:*) at Function.Module._load (internal/modules/cjs/loader.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/run_main_module.js:*:* Emitted 'error' event at: at Object. (*events_unhandled_error_sameline.js:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*) [... lines matching original stack trace ...] - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/run_main_module.js:*:* diff --git a/test/message/nexttick_throw.out b/test/message/nexttick_throw.out index 4bcdcaa62c8bc5..7aa38a0424bd99 100644 --- a/test/message/nexttick_throw.out +++ b/test/message/nexttick_throw.out @@ -7,5 +7,4 @@ ReferenceError: undefined_reference_error_maker is not defined at processTicksAndRejections (internal/process/next_tick.js:*:*) at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) - at executeUserCode (internal/bootstrap/node.js:*:*) - at startMainThreadExecution (internal/bootstrap/node.js:*:*) + at internal/main/run_main_module.js:*:* diff --git a/test/message/stdin_messages.out b/test/message/stdin_messages.out index 2bf935d7cbd16f..837e9017d7f947 100644 --- a/test/message/stdin_messages.out +++ b/test/message/stdin_messages.out @@ -2,6 +2,7 @@ [stdin]:1 with(this){__filename} ^^^^ + SyntaxError: Strict mode code may not include a with statement at new Script (vm.js:*) at createScript (vm.js:*) @@ -9,10 +10,10 @@ SyntaxError: Strict mode code may not include a with statement at Object. ([stdin]-wrapper:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*) at evalScript (internal/process/execution.js:*:*) - at Socket.process.stdin.on (internal/bootstrap/node.js:*:*) + at readStdin (internal/main/eval_stdin.js:*:*) + at Socket.process.stdin.on (internal/process/execution.js:*:*) at Socket.emit (events.js:*:*) at endReadableNT (_stream_readable.js:*:*) - at processTicksAndRejections (internal/process/next_tick.js:*:*) 42 42 [stdin]:1 @@ -26,10 +27,10 @@ Error: hello at Object. ([stdin]-wrapper:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*) at evalScript (internal/process/execution.js:*:*) - at Socket.process.stdin.on (internal/bootstrap/node.js:*:*) + at readStdin (internal/main/eval_stdin.js:*:*) + at Socket.process.stdin.on (internal/process/execution.js:*:*) at Socket.emit (events.js:*:*) at endReadableNT (_stream_readable.js:*:*) - at processTicksAndRejections (internal/process/next_tick.js:*:*) [stdin]:1 throw new Error("hello") ^ @@ -41,10 +42,10 @@ Error: hello at Object. ([stdin]-wrapper:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*) at evalScript (internal/process/execution.js:*:*) - at Socket.process.stdin.on (internal/bootstrap/node.js:*:*) + at readStdin (internal/main/eval_stdin.js:*:*) + at Socket.process.stdin.on (internal/process/execution.js:*:*) at Socket.emit (events.js:*:*) at endReadableNT (_stream_readable.js:*:*) - at processTicksAndRejections (internal/process/next_tick.js:*:*) 100 [stdin]:1 var x = 100; y = x; @@ -57,10 +58,10 @@ ReferenceError: y is not defined at Object. ([stdin]-wrapper:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*) at evalScript (internal/process/execution.js:*:*) - at Socket.process.stdin.on (internal/bootstrap/node.js:*:*) + at readStdin (internal/main/eval_stdin.js:*:*) + at Socket.process.stdin.on (internal/process/execution.js:*:*) at Socket.emit (events.js:*:*) at endReadableNT (_stream_readable.js:*:*) - at processTicksAndRejections (internal/process/next_tick.js:*:*) [stdin]:1 var ______________________________________________; throw 10 diff --git a/test/message/unhandled_promise_trace_warnings.out b/test/message/unhandled_promise_trace_warnings.out index 1f88a136a9aa13..60c08805f5cd54 100644 --- a/test/message/unhandled_promise_trace_warnings.out +++ b/test/message/unhandled_promise_trace_warnings.out @@ -13,8 +13,6 @@ at * at * at * - at * - at * (node:*) Error: This was rejected at * (*test*message*unhandled_promise_trace_warnings.js:*) at * @@ -24,7 +22,6 @@ at * at * at * - at * (node:*) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at * at * @@ -33,7 +30,6 @@ at * at * at * - at * (node:*) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1) at handledRejection (internal/process/promises.js:*) at promiseRejectHandler (internal/process/promises.js:*) diff --git a/test/message/util_inspect_error.out b/test/message/util_inspect_error.out index 406d8112ce2599..31b65eb2e2bf3c 100644 --- a/test/message/util_inspect_error.out +++ b/test/message/util_inspect_error.out @@ -9,7 +9,6 @@ at * at * at * - at * nested: { err: Error: foo @@ -22,7 +21,6 @@ at * at * at * - at * } } { err: Error: foo bar @@ -34,7 +32,6 @@ at * at * at * - at *, nested: { err: Error: foo bar @@ -46,7 +43,6 @@ at * at * at * - at * } } { Error: foo @@ -59,5 +55,4 @@ bar at * at * at * - at * foo: 'bar' } From 8db6b8a95a3a09f283fc291f83dc1777a94da6be Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 16 Jan 2019 00:08:20 +0800 Subject: [PATCH 158/223] worker: move worker thread setup code into the main script This patch directly inlines `createMessageHandler()` and `createWorkerFatalExeception()` in the new `lib/internal/main/worker_thread.js` since the implementation of the two methods are related to the execution flow of workers. PR-URL: https://github.com/nodejs/node/pull/25667 Reviewed-By: Anna Henningsen Backport-PR-URL: https://github.com/nodejs/node/pull/26036 --- lib/internal/main/worker_thread.js | 116 ++++++++++++++++++--- lib/internal/process/worker_thread_only.js | 107 +------------------ 2 files changed, 103 insertions(+), 120 deletions(-) diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js index 62a4bb1b7dd77e..94d0e613e8ce38 100644 --- a/lib/internal/main/worker_thread.js +++ b/lib/internal/main/worker_thread.js @@ -10,30 +10,118 @@ const { } = require('internal/bootstrap/pre_execution'); const { - getEnvMessagePort, - threadId + threadId, + getEnvMessagePort } = internalBinding('worker'); const { - createMessageHandler, - createWorkerFatalExeception -} = require('internal/process/worker_thread_only'); + messageTypes: { + // Messages that may be received by workers + LOAD_SCRIPT, + // Messages that may be posted from workers + UP_AND_RUNNING, + ERROR_MESSAGE, + COULD_NOT_SERIALIZE_ERROR, + // Messages that may be either received or posted + STDIO_PAYLOAD, + STDIO_WANTS_MORE_DATA, + }, + kStdioWantsMoreDataCallback +} = require('internal/worker/io'); +const { + fatalException: originalFatalException +} = require('internal/process/execution'); + +const publicWorker = require('worker_threads'); const debug = require('util').debuglog('worker'); -debug(`[${threadId}] is setting up worker child environment`); -function prepareUserCodeExecution() { - initializeClusterIPC(); - initializeESMLoader(); - loadPreloadModules(); -} +debug(`[${threadId}] is setting up worker child environment`); // Set up the message port and start listening const port = getEnvMessagePort(); -port.on('message', createMessageHandler(port, prepareUserCodeExecution)); -port.start(); + +port.on('message', (message) => { + if (message.type === LOAD_SCRIPT) { + const { + filename, + doEval, + workerData, + publicPort, + manifestSrc, + manifestURL, + hasStdin + } = message; + if (manifestSrc) { + require('internal/process/policy').setup(manifestSrc, manifestURL); + } + initializeClusterIPC(); + initializeESMLoader(); + loadPreloadModules(); + publicWorker.parentPort = publicPort; + publicWorker.workerData = workerData; + + if (!hasStdin) + process.stdin.push(null); + + debug(`[${threadId}] starts worker script ${filename} ` + + `(eval = ${eval}) at cwd = ${process.cwd()}`); + port.unref(); + port.postMessage({ type: UP_AND_RUNNING }); + if (doEval) { + const { evalScript } = require('internal/process/execution'); + evalScript('[worker eval]', filename); + } else { + process.argv[1] = filename; // script filename + require('module').runMain(); + } + return; + } else if (message.type === STDIO_PAYLOAD) { + const { stream, chunk, encoding } = message; + process[stream].push(chunk, encoding); + return; + } else if (message.type === STDIO_WANTS_MORE_DATA) { + const { stream } = message; + process[stream][kStdioWantsMoreDataCallback](); + return; + } + + require('assert').fail(`Unknown worker message type ${message.type}`); +}); // Overwrite fatalException -process._fatalException = createWorkerFatalExeception(port); +process._fatalException = (error) => { + debug(`[${threadId}] gets fatal exception`); + let caught = false; + try { + caught = originalFatalException.call(this, error); + } catch (e) { + error = e; + } + debug(`[${threadId}] fatal exception caught = ${caught}`); + + if (!caught) { + let serialized; + try { + const { serializeError } = require('internal/error-serdes'); + serialized = serializeError(error); + } catch {} + debug(`[${threadId}] fatal exception serialized = ${!!serialized}`); + if (serialized) + port.postMessage({ + type: ERROR_MESSAGE, + error: serialized + }); + else + port.postMessage({ type: COULD_NOT_SERIALIZE_ERROR }); + + const { clearAsyncIdStack } = require('internal/async_hooks'); + clearAsyncIdStack(); + + process.exit(); + } +}; markBootstrapComplete(); + +port.start(); diff --git a/lib/internal/process/worker_thread_only.js b/lib/internal/process/worker_thread_only.js index 2171d2b586a4ca..f05d5e932bebf2 100644 --- a/lib/internal/process/worker_thread_only.js +++ b/lib/internal/process/worker_thread_only.js @@ -3,13 +3,10 @@ // This file contains process bootstrappers that can only be // run in the worker thread. const { - getEnvMessagePort, - threadId + getEnvMessagePort } = internalBinding('worker'); const { - messageTypes, - kStdioWantsMoreDataCallback, kWaitingStreams, ReadableWorkerStdio, WritableWorkerStdio @@ -18,15 +15,6 @@ const { const { codes: { ERR_WORKER_UNSUPPORTED_OPERATION } } = require('internal/errors'); - -let debuglog; -function debug(...args) { - if (!debuglog) { - debuglog = require('util').debuglog('worker'); - } - return debuglog(...args); -} - const workerStdio = {}; function initializeWorkerStdio() { @@ -43,97 +31,6 @@ function initializeWorkerStdio() { }; } -function createMessageHandler(port, prepareUserCodeExecution) { - const publicWorker = require('worker_threads'); - - return function(message) { - if (message.type === messageTypes.LOAD_SCRIPT) { - const { - filename, - doEval, - workerData, - publicPort, - manifestSrc, - manifestURL, - hasStdin - } = message; - if (manifestSrc) { - require('internal/process/policy').setup(manifestSrc, manifestURL); - } - prepareUserCodeExecution(); - publicWorker.parentPort = publicPort; - publicWorker.workerData = workerData; - - if (!hasStdin) - workerStdio.stdin.push(null); - - debug(`[${threadId}] starts worker script ${filename} ` + - `(eval = ${eval}) at cwd = ${process.cwd()}`); - port.unref(); - port.postMessage({ type: messageTypes.UP_AND_RUNNING }); - if (doEval) { - const { evalScript } = require('internal/process/execution'); - evalScript('[worker eval]', filename); - } else { - process.argv[1] = filename; // script filename - require('module').runMain(); - } - return; - } else if (message.type === messageTypes.STDIO_PAYLOAD) { - const { stream, chunk, encoding } = message; - workerStdio[stream].push(chunk, encoding); - return; - } else if (message.type === messageTypes.STDIO_WANTS_MORE_DATA) { - const { stream } = message; - workerStdio[stream][kStdioWantsMoreDataCallback](); - return; - } - - require('assert').fail(`Unknown worker message type ${message.type}`); - }; -} - -// XXX(joyeecheung): this has to be returned as an anonymous function -// wrapped in a closure, see the comment of the original -// process._fatalException in lib/internal/process/execution.js -function createWorkerFatalExeception(port) { - const { - fatalException: originalFatalException - } = require('internal/process/execution'); - - return (error) => { - debug(`[${threadId}] gets fatal exception`); - let caught = false; - try { - caught = originalFatalException.call(this, error); - } catch (e) { - error = e; - } - debug(`[${threadId}] fatal exception caught = ${caught}`); - - if (!caught) { - let serialized; - try { - const { serializeError } = require('internal/error-serdes'); - serialized = serializeError(error); - } catch {} - debug(`[${threadId}] fatal exception serialized = ${!!serialized}`); - if (serialized) - port.postMessage({ - type: messageTypes.ERROR_MESSAGE, - error: serialized - }); - else - port.postMessage({ type: messageTypes.COULD_NOT_SERIALIZE_ERROR }); - - const { clearAsyncIdStack } = require('internal/async_hooks'); - clearAsyncIdStack(); - - process.exit(); - } - }; -} - // The execution of this function itself should not cause any side effects. function wrapProcessMethods(binding) { function umask(mask) { @@ -150,7 +47,5 @@ function wrapProcessMethods(binding) { module.exports = { initializeWorkerStdio, - createMessageHandler, - createWorkerFatalExeception, wrapProcessMethods }; From 0a154ff7ad327c8eb78cf4c38a5b6027c9698653 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 17 Jan 2019 02:34:43 +0800 Subject: [PATCH 159/223] src: move v8_platform implementation into node_v8_platform-inl.h So that the v8_platform global variable can be referenced in other files. PR-URL: https://github.com/nodejs/node/pull/25541 Reviewed-By: Gus Caplan --- node.gyp | 1 + src/env.cc | 1 + src/inspector/tracing_agent.cc | 1 + src/node.cc | 196 +++------------------------------ src/node_internals.h | 3 - src/node_trace_events.cc | 6 +- src/node_v8_platform-inl.h | 178 ++++++++++++++++++++++++++++++ 7 files changed, 201 insertions(+), 185 deletions(-) create mode 100644 src/node_v8_platform-inl.h diff --git a/node.gyp b/node.gyp index 56b7548349f1dc..1eceb2c6361143 100644 --- a/node.gyp +++ b/node.gyp @@ -497,6 +497,7 @@ 'src/node_union_bytes.h', 'src/node_url.h', 'src/node_version.h', + 'src/node_v8_platform-inl.h', 'src/node_watchdog.h', 'src/node_worker.h', 'src/pipe_wrap.h', diff --git a/src/env.cc b/src/env.cc index 269da1a49f1ee6..03e8369063e5ac 100644 --- a/src/env.cc +++ b/src/env.cc @@ -8,6 +8,7 @@ #include "node_options-inl.h" #include "node_platform.h" #include "node_process.h" +#include "node_v8_platform-inl.h" #include "node_worker.h" #include "tracing/agent.h" #include "tracing/traced_value.h" diff --git a/src/inspector/tracing_agent.cc b/src/inspector/tracing_agent.cc index 79fccbf8aa47ac..fb8467a1b9d3e0 100644 --- a/src/inspector/tracing_agent.cc +++ b/src/inspector/tracing_agent.cc @@ -1,6 +1,7 @@ #include "tracing_agent.h" #include "main_thread_interface.h" #include "node_internals.h" +#include "node_v8_platform-inl.h" #include "env-inl.h" #include "v8.h" diff --git a/src/node.cc b/src/node.cc index e67b16af83f0df..b9f4403829963f 100644 --- a/src/node.cc +++ b/src/node.cc @@ -32,8 +32,8 @@ #include "node_platform.h" #include "node_process.h" #include "node_revert.h" +#include "node_v8_platform-inl.h" #include "node_version.h" -#include "tracing/traced_value.h" #if HAVE_OPENSSL #include "node_crypto.h" @@ -56,8 +56,6 @@ #include "handle_wrap.h" #include "req_wrap-inl.h" #include "string_bytes.h" -#include "tracing/agent.h" -#include "tracing/node_trace_writer.h" #include "util.h" #include "uv.h" #if NODE_USE_V8_PLATFORM @@ -165,169 +163,10 @@ bool v8_initialized = false; // node_internals.h // process-relative uptime base, initialized at start-up double prog_start_time; -} // namespace per_process - -// Ensures that __metadata trace events are only emitted -// when tracing is enabled. -class NodeTraceStateObserver : - public TracingController::TraceStateObserver { - public: - void OnTraceEnabled() override { - char name_buffer[512]; - if (uv_get_process_title(name_buffer, sizeof(name_buffer)) == 0) { - // Only emit the metadata event if the title can be retrieved - // successfully. Ignore it otherwise. - TRACE_EVENT_METADATA1("__metadata", "process_name", - "name", TRACE_STR_COPY(name_buffer)); - } - TRACE_EVENT_METADATA1("__metadata", - "version", - "node", - per_process::metadata.versions.node.c_str()); - TRACE_EVENT_METADATA1("__metadata", "thread_name", - "name", "JavaScriptMainThread"); - - auto trace_process = tracing::TracedValue::Create(); - trace_process->BeginDictionary("versions"); - -#define V(key) \ - trace_process->SetString(#key, per_process::metadata.versions.key.c_str()); - - NODE_VERSIONS_KEYS(V) -#undef V - - trace_process->EndDictionary(); - - trace_process->SetString("arch", per_process::metadata.arch.c_str()); - trace_process->SetString("platform", - per_process::metadata.platform.c_str()); - - trace_process->BeginDictionary("release"); - trace_process->SetString("name", - per_process::metadata.release.name.c_str()); -#if NODE_VERSION_IS_LTS - trace_process->SetString("lts", per_process::metadata.release.lts.c_str()); -#endif - trace_process->EndDictionary(); - TRACE_EVENT_METADATA1("__metadata", "node", - "process", std::move(trace_process)); - - // This only runs the first time tracing is enabled - controller_->RemoveTraceStateObserver(this); - } - - void OnTraceDisabled() override { - // Do nothing here. This should never be called because the - // observer removes itself when OnTraceEnabled() is called. - UNREACHABLE(); - } - - explicit NodeTraceStateObserver(TracingController* controller) : - controller_(controller) {} - ~NodeTraceStateObserver() override {} - - private: - TracingController* controller_; -}; - -static struct { -#if NODE_USE_V8_PLATFORM - void Initialize(int thread_pool_size) { - tracing_agent_.reset(new tracing::Agent()); - node::tracing::TraceEventHelper::SetAgent(tracing_agent_.get()); - node::tracing::TracingController* controller = - tracing_agent_->GetTracingController(); - trace_state_observer_.reset(new NodeTraceStateObserver(controller)); - controller->AddTraceStateObserver(trace_state_observer_.get()); - StartTracingAgent(); - // Tracing must be initialized before platform threads are created. - platform_ = new NodePlatform(thread_pool_size, controller); - V8::InitializePlatform(platform_); - } - - void Dispose() { - StopTracingAgent(); - platform_->Shutdown(); - delete platform_; - platform_ = nullptr; - // Destroy tracing after the platform (and platform threads) have been - // stopped. - tracing_agent_.reset(nullptr); - trace_state_observer_.reset(nullptr); - } - - void DrainVMTasks(Isolate* isolate) { - platform_->DrainTasks(isolate); - } - void CancelVMTasks(Isolate* isolate) { - platform_->CancelPendingDelayedTasks(isolate); - } - - void StartTracingAgent() { - if (per_process::cli_options->trace_event_categories.empty()) { - tracing_file_writer_ = tracing_agent_->DefaultHandle(); - } else { - std::vector categories = - SplitString(per_process::cli_options->trace_event_categories, ','); - - tracing_file_writer_ = tracing_agent_->AddClient( - std::set(std::make_move_iterator(categories.begin()), - std::make_move_iterator(categories.end())), - std::unique_ptr( - new tracing::NodeTraceWriter( - per_process::cli_options->trace_event_file_pattern)), - tracing::Agent::kUseDefaultCategories); - } - } - - void StopTracingAgent() { - tracing_file_writer_.reset(); - } - - tracing::AgentWriterHandle* GetTracingAgentWriter() { - return &tracing_file_writer_; - } - - NodePlatform* Platform() { - return platform_; - } - - std::unique_ptr trace_state_observer_; - std::unique_ptr tracing_agent_; - tracing::AgentWriterHandle tracing_file_writer_; - NodePlatform* platform_; -#else // !NODE_USE_V8_PLATFORM - void Initialize(int thread_pool_size) {} - void Dispose() {} - void DrainVMTasks(Isolate* isolate) {} - void CancelVMTasks(Isolate* isolate) {} - - void StartTracingAgent() { - if (!trace_enabled_categories.empty()) { - fprintf(stderr, "Node compiled with NODE_USE_V8_PLATFORM=0, " - "so event tracing is not available.\n"); - } - } - void StopTracingAgent() {} - - tracing::AgentWriterHandle* GetTracingAgentWriter() { - return nullptr; - } - - NodePlatform* Platform() { - return nullptr; - } -#endif // !NODE_USE_V8_PLATFORM -} v8_platform; - -tracing::AgentWriterHandle* GetTracingAgentWriter() { - return v8_platform.GetTracingAgentWriter(); -} - -void DisposePlatform() { - v8_platform.Dispose(); -} +// node_v8_platform-inl.h +struct V8Platform v8_platform; +} // namespace per_process #ifdef __POSIX__ static const unsigned kMaxSignal = 32; @@ -1258,7 +1097,7 @@ Environment* GetCurrentEnvironment(Local context) { MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() { - return v8_platform.Platform(); + return per_process::v8_platform.Platform(); } @@ -1270,8 +1109,8 @@ MultiIsolatePlatform* CreatePlatform( MultiIsolatePlatform* InitializeV8Platform(int thread_pool_size) { - v8_platform.Initialize(thread_pool_size); - return v8_platform.Platform(); + per_process::v8_platform.Initialize(thread_pool_size); + return per_process::v8_platform.Platform(); } @@ -1359,7 +1198,7 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, do { uv_run(env.event_loop(), UV_RUN_DEFAULT); - v8_platform.DrainVMTasks(isolate); + per_process::v8_platform.DrainVMTasks(isolate); more = uv_loop_alive(env.event_loop()); if (more) @@ -1387,8 +1226,8 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, env.RunCleanup(); RunAtExit(&env); - v8_platform.DrainVMTasks(isolate); - v8_platform.CancelVMTasks(isolate); + per_process::v8_platform.DrainVMTasks(isolate); + per_process::v8_platform.CancelVMTasks(isolate); #if defined(LEAK_SANITIZER) __lsan_do_leak_check(); #endif @@ -1416,7 +1255,7 @@ Isolate* NewIsolate(ArrayBufferAllocator* allocator, uv_loop_t* event_loop) { // Register the isolate on the platform before the isolate gets initialized, // so that the isolate can access the platform during initialization. - v8_platform.Platform()->RegisterIsolate(isolate, event_loop); + per_process::v8_platform.Platform()->RegisterIsolate(isolate, event_loop); Isolate::Initialize(isolate, params); isolate->AddMessageListenerWithErrorLevel(OnMessage, @@ -1462,11 +1301,10 @@ inline int Start(uv_loop_t* event_loop, Isolate::Scope isolate_scope(isolate); HandleScope handle_scope(isolate); std::unique_ptr isolate_data( - CreateIsolateData( - isolate, - event_loop, - v8_platform.Platform(), - allocator.get()), + CreateIsolateData(isolate, + event_loop, + per_process::v8_platform.Platform(), + allocator.get()), &FreeIsolateData); // TODO(addaleax): This should load a real per-Isolate option, currently // this is still effectively per-process. @@ -1484,7 +1322,7 @@ inline int Start(uv_loop_t* event_loop, } isolate->Dispose(); - v8_platform.Platform()->UnregisterIsolate(isolate); + per_process::v8_platform.Platform()->UnregisterIsolate(isolate); return exit_code; } @@ -1549,7 +1387,7 @@ int Start(int argc, char** argv) { // that happen to terminate during shutdown from being run unsafely. // Since uv_run cannot be called, uv_async handles held by the platform // will never be fully cleaned up. - v8_platform.Dispose(); + per_process::v8_platform.Dispose(); return exit_code; } diff --git a/src/node_internals.h b/src/node_internals.h index bf66c77e6f043c..d972e2e5bd5916 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -244,9 +244,6 @@ int ThreadPoolWork::CancelWork() { return uv_cancel(reinterpret_cast(&work_req_)); } -tracing::AgentWriterHandle* GetTracingAgentWriter(); -void DisposePlatform(); - #define TRACING_CATEGORY_NODE "node" #define TRACING_CATEGORY_NODE1(one) \ TRACING_CATEGORY_NODE "," \ diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index 3c0f1cf68f1db8..9538e75d2c54ed 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -1,8 +1,8 @@ +#include "base_object-inl.h" +#include "env.h" #include "node.h" -#include "node_internals.h" +#include "node_v8_platform-inl.h" #include "tracing/agent.h" -#include "env.h" -#include "base_object-inl.h" #include #include diff --git a/src/node_v8_platform-inl.h b/src/node_v8_platform-inl.h new file mode 100644 index 00000000000000..ed91ee3a022551 --- /dev/null +++ b/src/node_v8_platform-inl.h @@ -0,0 +1,178 @@ +#ifndef SRC_NODE_V8_PLATFORM_INL_H_ +#define SRC_NODE_V8_PLATFORM_INL_H_ + +#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#include "env-inl.h" +#include "node.h" +#include "node_metadata.h" +#include "node_options.h" +#include "tracing/node_trace_writer.h" +#include "tracing/trace_event.h" +#include "tracing/traced_value.h" + +namespace node { + +// Ensures that __metadata trace events are only emitted +// when tracing is enabled. +class NodeTraceStateObserver + : public v8::TracingController::TraceStateObserver { + public: + inline void OnTraceEnabled() override { + char name_buffer[512]; + if (uv_get_process_title(name_buffer, sizeof(name_buffer)) == 0) { + // Only emit the metadata event if the title can be retrieved + // successfully. Ignore it otherwise. + TRACE_EVENT_METADATA1( + "__metadata", "process_name", "name", TRACE_STR_COPY(name_buffer)); + } + TRACE_EVENT_METADATA1("__metadata", + "version", + "node", + per_process::metadata.versions.node.c_str()); + TRACE_EVENT_METADATA1( + "__metadata", "thread_name", "name", "JavaScriptMainThread"); + + auto trace_process = tracing::TracedValue::Create(); + trace_process->BeginDictionary("versions"); + +#define V(key) \ + trace_process->SetString(#key, per_process::metadata.versions.key.c_str()); + + NODE_VERSIONS_KEYS(V) +#undef V + + trace_process->EndDictionary(); + + trace_process->SetString("arch", per_process::metadata.arch.c_str()); + trace_process->SetString("platform", + per_process::metadata.platform.c_str()); + + trace_process->BeginDictionary("release"); + trace_process->SetString("name", + per_process::metadata.release.name.c_str()); +#if NODE_VERSION_IS_LTS + trace_process->SetString("lts", per_process::metadata.release.lts.c_str()); +#endif + trace_process->EndDictionary(); + TRACE_EVENT_METADATA1( + "__metadata", "node", "process", std::move(trace_process)); + + // This only runs the first time tracing is enabled + controller_->RemoveTraceStateObserver(this); + } + + inline void OnTraceDisabled() override { + // Do nothing here. This should never be called because the + // observer removes itself when OnTraceEnabled() is called. + UNREACHABLE(); + } + + explicit NodeTraceStateObserver(v8::TracingController* controller) + : controller_(controller) {} + ~NodeTraceStateObserver() override {} + + private: + v8::TracingController* controller_; +}; + +struct V8Platform { +#if NODE_USE_V8_PLATFORM + inline void Initialize(int thread_pool_size) { + tracing_agent_.reset(new tracing::Agent()); + node::tracing::TraceEventHelper::SetAgent(tracing_agent_.get()); + node::tracing::TracingController* controller = + tracing_agent_->GetTracingController(); + trace_state_observer_.reset(new NodeTraceStateObserver(controller)); + controller->AddTraceStateObserver(trace_state_observer_.get()); + StartTracingAgent(); + // Tracing must be initialized before platform threads are created. + platform_ = new NodePlatform(thread_pool_size, controller); + v8::V8::InitializePlatform(platform_); + } + + inline void Dispose() { + StopTracingAgent(); + platform_->Shutdown(); + delete platform_; + platform_ = nullptr; + // Destroy tracing after the platform (and platform threads) have been + // stopped. + tracing_agent_.reset(nullptr); + trace_state_observer_.reset(nullptr); + } + + inline void DrainVMTasks(v8::Isolate* isolate) { + platform_->DrainTasks(isolate); + } + + inline void CancelVMTasks(v8::Isolate* isolate) { + platform_->CancelPendingDelayedTasks(isolate); + } + + inline void StartTracingAgent() { + if (per_process::cli_options->trace_event_categories.empty()) { + tracing_file_writer_ = tracing_agent_->DefaultHandle(); + } else { + std::vector categories = + SplitString(per_process::cli_options->trace_event_categories, ','); + + tracing_file_writer_ = tracing_agent_->AddClient( + std::set(std::make_move_iterator(categories.begin()), + std::make_move_iterator(categories.end())), + std::unique_ptr( + new tracing::NodeTraceWriter( + per_process::cli_options->trace_event_file_pattern)), + tracing::Agent::kUseDefaultCategories); + } + } + + inline void StopTracingAgent() { tracing_file_writer_.reset(); } + + inline tracing::AgentWriterHandle* GetTracingAgentWriter() { + return &tracing_file_writer_; + } + + inline NodePlatform* Platform() { return platform_; } + + std::unique_ptr trace_state_observer_; + std::unique_ptr tracing_agent_; + tracing::AgentWriterHandle tracing_file_writer_; + NodePlatform* platform_; +#else // !NODE_USE_V8_PLATFORM + inline void Initialize(int thread_pool_size) {} + inline void Dispose() {} + inline void DrainVMTasks(v8::Isolate* isolate) {} + inline void CancelVMTasks(v8::Isolate* isolate) {} + inline void StartTracingAgent() { + if (!trace_enabled_categories.empty()) { + fprintf(stderr, + "Node compiled with NODE_USE_V8_PLATFORM=0, " + "so event tracing is not available.\n"); + } + } + inline void StopTracingAgent() {} + + inline tracing::AgentWriterHandle* GetTracingAgentWriter() { return nullptr; } + + inline NodePlatform* Platform() { return nullptr; } +#endif // !NODE_USE_V8_PLATFORM +}; + +namespace per_process { +extern struct V8Platform v8_platform; +} + +inline tracing::AgentWriterHandle* GetTracingAgentWriter() { + return per_process::v8_platform.GetTracingAgentWriter(); +} + +inline void DisposePlatform() { + per_process::v8_platform.Dispose(); +} + +} // namespace node + +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#endif // SRC_NODE_V8_PLATFORM_INL_H_ From b72ec23201227391f796868a5d36debbe2a882aa Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 17 Jan 2019 03:00:55 +0800 Subject: [PATCH 160/223] src: move public C++ APIs into src/api/*.cc This patch moves most of the public C++ APIs into src/api/*.cc so that it's easier to tell that we need to be careful about the compatibility of these code. Some APIs, like `node::LoadEnvironmet()`, `node::Start()` and `node::Init()` still stay in `node.cc` because they are still very specific to our use cases and do not work quite well yet for embedders anyway - we could not even manage to write cctest for them at the moment. PR-URL: https://github.com/nodejs/node/pull/25541 Reviewed-By: Gus Caplan --- node.gyp | 10 +- src/{callback_scope.cc => api/callback.cc} | 0 src/{node_encoding.cc => api/encoding.cc} | 0 src/api/environment.cc | 214 ++++++++++ src/{ => api}/exceptions.cc | 14 + src/api/hooks.cc | 149 +++++++ src/api/utils.cc | 170 ++++++++ src/async_wrap.cc | 65 --- src/node.cc | 456 +-------------------- src/node_errors.cc | 13 - src/node_internals.h | 1 + 11 files changed, 557 insertions(+), 535 deletions(-) rename src/{callback_scope.cc => api/callback.cc} (100%) rename src/{node_encoding.cc => api/encoding.cc} (100%) create mode 100644 src/api/environment.cc rename src/{ => api}/exceptions.cc (92%) create mode 100644 src/api/hooks.cc create mode 100644 src/api/utils.cc diff --git a/node.gyp b/node.gyp index 1eceb2c6361143..81a0ade8f7ac83 100644 --- a/node.gyp +++ b/node.gyp @@ -365,14 +365,19 @@ 'dependencies': [ 'deps/histogram/histogram.gyp:histogram' ], 'sources': [ + 'src/api/callback.cc', + 'src/api/encoding.cc', + 'src/api/environment.cc', + 'src/api/exceptions.cc', + 'src/api/hooks.cc', + 'src/api/utils.cc', + 'src/async_wrap.cc', - 'src/callback_scope.cc', 'src/cares_wrap.cc', 'src/connect_wrap.cc', 'src/connection_wrap.cc', 'src/debug_utils.cc', 'src/env.cc', - 'src/exceptions.cc', 'src/fs_event_wrap.cc', 'src/handle_wrap.cc', 'src/heap_utils.cc', @@ -392,7 +397,6 @@ 'src/node_contextify.cc', 'src/node_credentials.cc', 'src/node_domain.cc', - 'src/node_encoding.cc', 'src/node_env_var.cc', 'src/node_errors.cc', 'src/node_file.cc', diff --git a/src/callback_scope.cc b/src/api/callback.cc similarity index 100% rename from src/callback_scope.cc rename to src/api/callback.cc diff --git a/src/node_encoding.cc b/src/api/encoding.cc similarity index 100% rename from src/node_encoding.cc rename to src/api/encoding.cc diff --git a/src/api/environment.cc b/src/api/environment.cc new file mode 100644 index 00000000000000..9480fb2b96144c --- /dev/null +++ b/src/api/environment.cc @@ -0,0 +1,214 @@ +#include "env.h" +#include "node.h" +#include "node_context_data.h" +#include "node_errors.h" +#include "node_internals.h" +#include "node_native_module.h" +#include "node_platform.h" +#include "node_process.h" +#include "node_v8_platform-inl.h" +#include "uv.h" + +namespace node { +using v8::Context; +using v8::Function; +using v8::HandleScope; +using v8::Isolate; +using v8::Local; +using v8::MaybeLocal; +using v8::Message; +using v8::MicrotasksPolicy; +using v8::ObjectTemplate; +using v8::String; +using v8::Value; + +static bool AllowWasmCodeGenerationCallback(Local context, + Local) { + Local wasm_code_gen = + context->GetEmbedderData(ContextEmbedderIndex::kAllowWasmCodeGeneration); + return wasm_code_gen->IsUndefined() || wasm_code_gen->IsTrue(); +} + +static bool ShouldAbortOnUncaughtException(Isolate* isolate) { + HandleScope scope(isolate); + Environment* env = Environment::GetCurrent(isolate); + return env != nullptr && env->should_abort_on_uncaught_toggle()[0] && + !env->inside_should_not_abort_on_uncaught_scope(); +} + +static void OnMessage(Local message, Local error) { + Isolate* isolate = message->GetIsolate(); + switch (message->ErrorLevel()) { + case Isolate::MessageErrorLevel::kMessageWarning: { + Environment* env = Environment::GetCurrent(isolate); + if (!env) { + break; + } + Utf8Value filename(isolate, message->GetScriptOrigin().ResourceName()); + // (filename):(line) (message) + std::stringstream warning; + warning << *filename; + warning << ":"; + warning << message->GetLineNumber(env->context()).FromMaybe(-1); + warning << " "; + v8::String::Utf8Value msg(isolate, message->Get()); + warning << *msg; + USE(ProcessEmitWarningGeneric(env, warning.str().c_str(), "V8")); + break; + } + case Isolate::MessageErrorLevel::kMessageError: + FatalException(isolate, error, message); + break; + } +} + +void* ArrayBufferAllocator::Allocate(size_t size) { + if (zero_fill_field_ || per_process::cli_options->zero_fill_all_buffers) + return UncheckedCalloc(size); + else + return UncheckedMalloc(size); +} + +ArrayBufferAllocator* CreateArrayBufferAllocator() { + return new ArrayBufferAllocator(); +} + +void FreeArrayBufferAllocator(ArrayBufferAllocator* allocator) { + delete allocator; +} + +Isolate* NewIsolate(ArrayBufferAllocator* allocator, uv_loop_t* event_loop) { + Isolate::CreateParams params; + params.array_buffer_allocator = allocator; +#ifdef NODE_ENABLE_VTUNE_PROFILING + params.code_event_handler = vTune::GetVtuneCodeEventHandler(); +#endif + + Isolate* isolate = Isolate::Allocate(); + if (isolate == nullptr) return nullptr; + + // Register the isolate on the platform before the isolate gets initialized, + // so that the isolate can access the platform during initialization. + per_process::v8_platform.Platform()->RegisterIsolate(isolate, event_loop); + Isolate::Initialize(isolate, params); + + isolate->AddMessageListenerWithErrorLevel( + OnMessage, + Isolate::MessageErrorLevel::kMessageError | + Isolate::MessageErrorLevel::kMessageWarning); + isolate->SetAbortOnUncaughtExceptionCallback(ShouldAbortOnUncaughtException); + isolate->SetMicrotasksPolicy(MicrotasksPolicy::kExplicit); + isolate->SetFatalErrorHandler(OnFatalError); + isolate->SetAllowWasmCodeGenerationCallback(AllowWasmCodeGenerationCallback); + v8::CpuProfiler::UseDetailedSourcePositionsForProfiling(isolate); + + return isolate; +} + +IsolateData* CreateIsolateData(Isolate* isolate, + uv_loop_t* loop, + MultiIsolatePlatform* platform, + ArrayBufferAllocator* allocator) { + return new IsolateData( + isolate, + loop, + platform, + allocator != nullptr ? allocator->zero_fill_field() : nullptr); +} + +void FreeIsolateData(IsolateData* isolate_data) { + delete isolate_data; +} + +Environment* CreateEnvironment(IsolateData* isolate_data, + Local context, + int argc, + const char* const* argv, + int exec_argc, + const char* const* exec_argv) { + Isolate* isolate = context->GetIsolate(); + HandleScope handle_scope(isolate); + Context::Scope context_scope(context); + // TODO(addaleax): This is a much better place for parsing per-Environment + // options than the global parse call. + std::vector args(argv, argv + argc); + std::vector exec_args(exec_argv, exec_argv + exec_argc); + Environment* env = new Environment(isolate_data, context); + env->Start(per_process::v8_is_profiling); + env->ProcessCliArgs(args, exec_args); + return env; +} + +void FreeEnvironment(Environment* env) { + env->RunCleanup(); + delete env; +} + +Environment* GetCurrentEnvironment(Local context) { + return Environment::GetCurrent(context); +} + +MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() { + return per_process::v8_platform.Platform(); +} + +MultiIsolatePlatform* CreatePlatform( + int thread_pool_size, + node::tracing::TracingController* tracing_controller) { + return new NodePlatform(thread_pool_size, tracing_controller); +} + +MultiIsolatePlatform* InitializeV8Platform(int thread_pool_size) { + per_process::v8_platform.Initialize(thread_pool_size); + return per_process::v8_platform.Platform(); +} + +void FreePlatform(MultiIsolatePlatform* platform) { + delete platform; +} + +Local NewContext(Isolate* isolate, + Local object_template) { + auto context = Context::New(isolate, nullptr, object_template); + if (context.IsEmpty()) return context; + HandleScope handle_scope(isolate); + + context->SetEmbedderData(ContextEmbedderIndex::kAllowWasmCodeGeneration, + True(isolate)); + + { + // Run lib/internal/per_context.js + Context::Scope context_scope(context); + + std::vector> parameters = { + FIXED_ONE_BYTE_STRING(isolate, "global")}; + Local arguments[] = {context->Global()}; + MaybeLocal maybe_fn = + per_process::native_module_loader.LookupAndCompile( + context, "internal/per_context", ¶meters, nullptr); + if (maybe_fn.IsEmpty()) { + return Local(); + } + Local fn = maybe_fn.ToLocalChecked(); + MaybeLocal result = + fn->Call(context, Undefined(isolate), arraysize(arguments), arguments); + // Execution failed during context creation. + // TODO(joyeecheung): deprecate this signature and return a MaybeLocal. + if (result.IsEmpty()) { + return Local(); + } + } + + return context; +} + +uv_loop_t* GetCurrentEventLoop(Isolate* isolate) { + HandleScope handle_scope(isolate); + Local context = isolate->GetCurrentContext(); + if (context.IsEmpty()) return nullptr; + Environment* env = Environment::GetCurrent(context); + if (env == nullptr) return nullptr; + return env->event_loop(); +} + +} // namespace node diff --git a/src/exceptions.cc b/src/api/exceptions.cc similarity index 92% rename from src/exceptions.cc rename to src/api/exceptions.cc index d5c05fdf420926..4d1cca8b6512b4 100644 --- a/src/exceptions.cc +++ b/src/api/exceptions.cc @@ -12,6 +12,7 @@ namespace node { using v8::Exception; +using v8::HandleScope; using v8::Integer; using v8::Isolate; using v8::Local; @@ -228,4 +229,17 @@ Local WinapiErrnoException(Isolate* isolate, } #endif +void FatalException(Isolate* isolate, const v8::TryCatch& try_catch) { + // If we try to print out a termination exception, we'd just get 'null', + // so just crashing here with that information seems like a better idea, + // and in particular it seems like we should handle terminations at the call + // site for this function rather than by printing them out somewhere. + CHECK(!try_catch.HasTerminated()); + + HandleScope scope(isolate); + if (!try_catch.IsVerbose()) { + FatalException(isolate, try_catch.Exception(), try_catch.Message()); + } +} + } // namespace node diff --git a/src/api/hooks.cc b/src/api/hooks.cc new file mode 100644 index 00000000000000..b54292638ddf95 --- /dev/null +++ b/src/api/hooks.cc @@ -0,0 +1,149 @@ +#include "env-inl.h" +#include "node.h" +#include "node_process.h" +#include "async_wrap.h" + +namespace node { + +using v8::Context; +using v8::HandleScope; +using v8::Integer; +using v8::Isolate; +using v8::Local; +using v8::Object; +using v8::String; +using v8::Value; +using v8::NewStringType; + +void RunAtExit(Environment* env) { + env->RunAtExitCallbacks(); +} + +void AtExit(void (*cb)(void* arg), void* arg) { + auto env = Environment::GetThreadLocalEnv(); + AtExit(env, cb, arg); +} + +void AtExit(Environment* env, void (*cb)(void* arg), void* arg) { + CHECK_NOT_NULL(env); + env->AtExit(cb, arg); +} + +void EmitBeforeExit(Environment* env) { + HandleScope handle_scope(env->isolate()); + Context::Scope context_scope(env->context()); + Local exit_code = env->process_object() + ->Get(env->context(), env->exit_code_string()) + .ToLocalChecked() + ->ToInteger(env->context()) + .ToLocalChecked(); + ProcessEmit(env, "beforeExit", exit_code).ToLocalChecked(); +} + +int EmitExit(Environment* env) { + // process.emit('exit') + HandleScope handle_scope(env->isolate()); + Context::Scope context_scope(env->context()); + Local process_object = env->process_object(); + process_object + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "_exiting"), + True(env->isolate())) + .FromJust(); + + Local exit_code = env->exit_code_string(); + int code = process_object->Get(env->context(), exit_code) + .ToLocalChecked() + ->Int32Value(env->context()) + .ToChecked(); + ProcessEmit(env, "exit", Integer::New(env->isolate(), code)); + + // Reload exit code, it may be changed by `emit('exit')` + return process_object->Get(env->context(), exit_code) + .ToLocalChecked() + ->Int32Value(env->context()) + .ToChecked(); +} + +void AddPromiseHook(Isolate* isolate, promise_hook_func fn, void* arg) { + Environment* env = Environment::GetCurrent(isolate); + CHECK_NOT_NULL(env); + env->AddPromiseHook(fn, arg); +} + +void AddEnvironmentCleanupHook(Isolate* isolate, + void (*fun)(void* arg), + void* arg) { + Environment* env = Environment::GetCurrent(isolate); + CHECK_NOT_NULL(env); + env->AddCleanupHook(fun, arg); +} + +void RemoveEnvironmentCleanupHook(Isolate* isolate, + void (*fun)(void* arg), + void* arg) { + Environment* env = Environment::GetCurrent(isolate); + CHECK_NOT_NULL(env); + env->RemoveCleanupHook(fun, arg); +} + +async_id AsyncHooksGetExecutionAsyncId(Isolate* isolate) { + // Environment::GetCurrent() allocates a Local<> handle. + HandleScope handle_scope(isolate); + Environment* env = Environment::GetCurrent(isolate); + if (env == nullptr) return -1; + return env->execution_async_id(); +} + +async_id AsyncHooksGetTriggerAsyncId(Isolate* isolate) { + // Environment::GetCurrent() allocates a Local<> handle. + HandleScope handle_scope(isolate); + Environment* env = Environment::GetCurrent(isolate); + if (env == nullptr) return -1; + return env->trigger_async_id(); +} + + +async_context EmitAsyncInit(Isolate* isolate, + Local resource, + const char* name, + async_id trigger_async_id) { + HandleScope handle_scope(isolate); + Local type = + String::NewFromUtf8(isolate, name, NewStringType::kInternalized) + .ToLocalChecked(); + return EmitAsyncInit(isolate, resource, type, trigger_async_id); +} + +async_context EmitAsyncInit(Isolate* isolate, + Local resource, + Local name, + async_id trigger_async_id) { + HandleScope handle_scope(isolate); + Environment* env = Environment::GetCurrent(isolate); + CHECK_NOT_NULL(env); + + // Initialize async context struct + if (trigger_async_id == -1) + trigger_async_id = env->get_default_trigger_async_id(); + + async_context context = { + env->new_async_id(), // async_id_ + trigger_async_id // trigger_async_id_ + }; + + // Run init hooks + AsyncWrap::EmitAsyncInit(env, resource, name, context.async_id, + context.trigger_async_id); + + return context; +} + +void EmitAsyncDestroy(Isolate* isolate, async_context asyncContext) { + // Environment::GetCurrent() allocates a Local<> handle. + HandleScope handle_scope(isolate); + AsyncWrap::EmitDestroy( + Environment::GetCurrent(isolate), asyncContext.async_id); +} + +} // namespace node diff --git a/src/api/utils.cc b/src/api/utils.cc new file mode 100644 index 00000000000000..e6993f33b00647 --- /dev/null +++ b/src/api/utils.cc @@ -0,0 +1,170 @@ +#include "node.h" +#include "node_internals.h" + +#include + +namespace node { + +const char* signo_string(int signo) { +#define SIGNO_CASE(e) \ + case e: \ + return #e; + switch (signo) { +#ifdef SIGHUP + SIGNO_CASE(SIGHUP); +#endif + +#ifdef SIGINT + SIGNO_CASE(SIGINT); +#endif + +#ifdef SIGQUIT + SIGNO_CASE(SIGQUIT); +#endif + +#ifdef SIGILL + SIGNO_CASE(SIGILL); +#endif + +#ifdef SIGTRAP + SIGNO_CASE(SIGTRAP); +#endif + +#ifdef SIGABRT + SIGNO_CASE(SIGABRT); +#endif + +#ifdef SIGIOT +#if SIGABRT != SIGIOT + SIGNO_CASE(SIGIOT); +#endif +#endif + +#ifdef SIGBUS + SIGNO_CASE(SIGBUS); +#endif + +#ifdef SIGFPE + SIGNO_CASE(SIGFPE); +#endif + +#ifdef SIGKILL + SIGNO_CASE(SIGKILL); +#endif + +#ifdef SIGUSR1 + SIGNO_CASE(SIGUSR1); +#endif + +#ifdef SIGSEGV + SIGNO_CASE(SIGSEGV); +#endif + +#ifdef SIGUSR2 + SIGNO_CASE(SIGUSR2); +#endif + +#ifdef SIGPIPE + SIGNO_CASE(SIGPIPE); +#endif + +#ifdef SIGALRM + SIGNO_CASE(SIGALRM); +#endif + + SIGNO_CASE(SIGTERM); + +#ifdef SIGCHLD + SIGNO_CASE(SIGCHLD); +#endif + +#ifdef SIGSTKFLT + SIGNO_CASE(SIGSTKFLT); +#endif + +#ifdef SIGCONT + SIGNO_CASE(SIGCONT); +#endif + +#ifdef SIGSTOP + SIGNO_CASE(SIGSTOP); +#endif + +#ifdef SIGTSTP + SIGNO_CASE(SIGTSTP); +#endif + +#ifdef SIGBREAK + SIGNO_CASE(SIGBREAK); +#endif + +#ifdef SIGTTIN + SIGNO_CASE(SIGTTIN); +#endif + +#ifdef SIGTTOU + SIGNO_CASE(SIGTTOU); +#endif + +#ifdef SIGURG + SIGNO_CASE(SIGURG); +#endif + +#ifdef SIGXCPU + SIGNO_CASE(SIGXCPU); +#endif + +#ifdef SIGXFSZ + SIGNO_CASE(SIGXFSZ); +#endif + +#ifdef SIGVTALRM + SIGNO_CASE(SIGVTALRM); +#endif + +#ifdef SIGPROF + SIGNO_CASE(SIGPROF); +#endif + +#ifdef SIGWINCH + SIGNO_CASE(SIGWINCH); +#endif + +#ifdef SIGIO + SIGNO_CASE(SIGIO); +#endif + +#ifdef SIGPOLL +#if SIGPOLL != SIGIO + SIGNO_CASE(SIGPOLL); +#endif +#endif + +#ifdef SIGLOST +#if SIGLOST != SIGABRT + SIGNO_CASE(SIGLOST); +#endif +#endif + +#ifdef SIGPWR +#if SIGPWR != SIGLOST + SIGNO_CASE(SIGPWR); +#endif +#endif + +#ifdef SIGINFO +#if !defined(SIGPWR) || SIGINFO != SIGPWR + SIGNO_CASE(SIGINFO); +#endif +#endif + +#ifdef SIGSYS + SIGNO_CASE(SIGSYS); +#endif + + default: + return ""; + } +} + +} // namespace node diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 9798fc0de8471f..4550312abd1b02 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -39,7 +39,6 @@ using v8::Integer; using v8::Isolate; using v8::Local; using v8::MaybeLocal; -using v8::NewStringType; using v8::Number; using v8::Object; using v8::ObjectTemplate; @@ -700,70 +699,6 @@ MaybeLocal AsyncWrap::MakeCallback(const Local cb, return ret; } - -/* Public C++ embedder API */ - - -async_id AsyncHooksGetExecutionAsyncId(Isolate* isolate) { - // Environment::GetCurrent() allocates a Local<> handle. - HandleScope handle_scope(isolate); - Environment* env = Environment::GetCurrent(isolate); - if (env == nullptr) return -1; - return env->execution_async_id(); -} - - -async_id AsyncHooksGetTriggerAsyncId(Isolate* isolate) { - // Environment::GetCurrent() allocates a Local<> handle. - HandleScope handle_scope(isolate); - Environment* env = Environment::GetCurrent(isolate); - if (env == nullptr) return -1; - return env->trigger_async_id(); -} - - -async_context EmitAsyncInit(Isolate* isolate, - Local resource, - const char* name, - async_id trigger_async_id) { - HandleScope handle_scope(isolate); - Local type = - String::NewFromUtf8(isolate, name, NewStringType::kInternalized) - .ToLocalChecked(); - return EmitAsyncInit(isolate, resource, type, trigger_async_id); -} - -async_context EmitAsyncInit(Isolate* isolate, - Local resource, - Local name, - async_id trigger_async_id) { - HandleScope handle_scope(isolate); - Environment* env = Environment::GetCurrent(isolate); - CHECK_NOT_NULL(env); - - // Initialize async context struct - if (trigger_async_id == -1) - trigger_async_id = env->get_default_trigger_async_id(); - - async_context context = { - env->new_async_id(), // async_id_ - trigger_async_id // trigger_async_id_ - }; - - // Run init hooks - AsyncWrap::EmitAsyncInit(env, resource, name, context.async_id, - context.trigger_async_id); - - return context; -} - -void EmitAsyncDestroy(Isolate* isolate, async_context asyncContext) { - // Environment::GetCurrent() allocates a Local<> handle. - HandleScope handle_scope(isolate); - AsyncWrap::EmitDestroy( - Environment::GetCurrent(isolate), asyncContext.async_id); -} - std::string AsyncWrap::MemoryInfoName() const { return provider_names[provider_type()]; } diff --git a/src/node.cc b/src/node.cc index b9f4403829963f..745ed83917885e 100644 --- a/src/node.cc +++ b/src/node.cc @@ -119,32 +119,21 @@ using v8::Function; using v8::FunctionCallbackInfo; using v8::HandleScope; using v8::Int32; -using v8::Integer; using v8::Isolate; using v8::Just; using v8::Local; using v8::Locker; using v8::Maybe; using v8::MaybeLocal; -using v8::Message; -using v8::MicrotasksPolicy; using v8::Object; -using v8::ObjectTemplate; using v8::Script; -using v8::ScriptOrigin; using v8::SealHandleScope; using v8::String; -using v8::TracingController; using v8::Undefined; using v8::V8; using v8::Value; namespace per_process { -// Tells whether --prof is passed. -// TODO(joyeecheung): move env->options()->prof_process to -// per_process::cli_options.prof_process and use that instead. -static bool v8_is_profiling = false; - // TODO(joyeecheung): these are no longer necessary. Remove them. // See: https://github.com/nodejs/node/pull/25302#discussion_r244924196 // Isolate on the main thread @@ -163,6 +152,8 @@ bool v8_initialized = false; // node_internals.h // process-relative uptime base, initialized at start-up double prog_start_time; +// Tells whether --prof is passed. +bool v8_is_profiling = false; // node_v8_platform-inl.h struct V8Platform v8_platform; @@ -172,209 +163,6 @@ struct V8Platform v8_platform; static const unsigned kMaxSignal = 32; #endif -const char* signo_string(int signo) { -#define SIGNO_CASE(e) case e: return #e; - switch (signo) { -#ifdef SIGHUP - SIGNO_CASE(SIGHUP); -#endif - -#ifdef SIGINT - SIGNO_CASE(SIGINT); -#endif - -#ifdef SIGQUIT - SIGNO_CASE(SIGQUIT); -#endif - -#ifdef SIGILL - SIGNO_CASE(SIGILL); -#endif - -#ifdef SIGTRAP - SIGNO_CASE(SIGTRAP); -#endif - -#ifdef SIGABRT - SIGNO_CASE(SIGABRT); -#endif - -#ifdef SIGIOT -# if SIGABRT != SIGIOT - SIGNO_CASE(SIGIOT); -# endif -#endif - -#ifdef SIGBUS - SIGNO_CASE(SIGBUS); -#endif - -#ifdef SIGFPE - SIGNO_CASE(SIGFPE); -#endif - -#ifdef SIGKILL - SIGNO_CASE(SIGKILL); -#endif - -#ifdef SIGUSR1 - SIGNO_CASE(SIGUSR1); -#endif - -#ifdef SIGSEGV - SIGNO_CASE(SIGSEGV); -#endif - -#ifdef SIGUSR2 - SIGNO_CASE(SIGUSR2); -#endif - -#ifdef SIGPIPE - SIGNO_CASE(SIGPIPE); -#endif - -#ifdef SIGALRM - SIGNO_CASE(SIGALRM); -#endif - - SIGNO_CASE(SIGTERM); - -#ifdef SIGCHLD - SIGNO_CASE(SIGCHLD); -#endif - -#ifdef SIGSTKFLT - SIGNO_CASE(SIGSTKFLT); -#endif - - -#ifdef SIGCONT - SIGNO_CASE(SIGCONT); -#endif - -#ifdef SIGSTOP - SIGNO_CASE(SIGSTOP); -#endif - -#ifdef SIGTSTP - SIGNO_CASE(SIGTSTP); -#endif - -#ifdef SIGBREAK - SIGNO_CASE(SIGBREAK); -#endif - -#ifdef SIGTTIN - SIGNO_CASE(SIGTTIN); -#endif - -#ifdef SIGTTOU - SIGNO_CASE(SIGTTOU); -#endif - -#ifdef SIGURG - SIGNO_CASE(SIGURG); -#endif - -#ifdef SIGXCPU - SIGNO_CASE(SIGXCPU); -#endif - -#ifdef SIGXFSZ - SIGNO_CASE(SIGXFSZ); -#endif - -#ifdef SIGVTALRM - SIGNO_CASE(SIGVTALRM); -#endif - -#ifdef SIGPROF - SIGNO_CASE(SIGPROF); -#endif - -#ifdef SIGWINCH - SIGNO_CASE(SIGWINCH); -#endif - -#ifdef SIGIO - SIGNO_CASE(SIGIO); -#endif - -#ifdef SIGPOLL -# if SIGPOLL != SIGIO - SIGNO_CASE(SIGPOLL); -# endif -#endif - -#ifdef SIGLOST -# if SIGLOST != SIGABRT - SIGNO_CASE(SIGLOST); -# endif -#endif - -#ifdef SIGPWR -# if SIGPWR != SIGLOST - SIGNO_CASE(SIGPWR); -# endif -#endif - -#ifdef SIGINFO -# if !defined(SIGPWR) || SIGINFO != SIGPWR - SIGNO_CASE(SIGINFO); -# endif -#endif - -#ifdef SIGSYS - SIGNO_CASE(SIGSYS); -#endif - - default: return ""; - } -} - -void* ArrayBufferAllocator::Allocate(size_t size) { - if (zero_fill_field_ || per_process::cli_options->zero_fill_all_buffers) - return UncheckedCalloc(size); - else - return UncheckedMalloc(size); -} - -namespace { - -bool ShouldAbortOnUncaughtException(Isolate* isolate) { - HandleScope scope(isolate); - Environment* env = Environment::GetCurrent(isolate); - return env != nullptr && - env->should_abort_on_uncaught_toggle()[0] && - !env->inside_should_not_abort_on_uncaught_scope(); -} - -} // anonymous namespace - - -void AddPromiseHook(Isolate* isolate, promise_hook_func fn, void* arg) { - Environment* env = Environment::GetCurrent(isolate); - CHECK_NOT_NULL(env); - env->AddPromiseHook(fn, arg); -} - -void AddEnvironmentCleanupHook(Isolate* isolate, - void (*fun)(void* arg), - void* arg) { - Environment* env = Environment::GetCurrent(isolate); - CHECK_NOT_NULL(env); - env->AddCleanupHook(fun, arg); -} - - -void RemoveEnvironmentCleanupHook(Isolate* isolate, - void (*fun)(void* arg), - void* arg) { - Environment* env = Environment::GetCurrent(isolate); - CHECK_NOT_NULL(env); - env->RemoveCleanupHook(fun, arg); -} - static void WaitForInspectorDisconnect(Environment* env) { #if HAVE_INSPECTOR if (env->inspector_agent()->IsActive()) { @@ -402,33 +190,6 @@ void Exit(const FunctionCallbackInfo& args) { env->Exit(code); } -static void OnMessage(Local message, Local error) { - Isolate* isolate = message->GetIsolate(); - switch (message->ErrorLevel()) { - case Isolate::MessageErrorLevel::kMessageWarning: { - Environment* env = Environment::GetCurrent(isolate); - if (!env) { - break; - } - Utf8Value filename(isolate, - message->GetScriptOrigin().ResourceName()); - // (filename):(line) (message) - std::stringstream warning; - warning << *filename; - warning << ":"; - warning << message->GetLineNumber(env->context()).FromMaybe(-1); - warning << " "; - v8::String::Utf8Value msg(isolate, message->Get()); - warning << *msg; - USE(ProcessEmitWarningGeneric(env, warning.str().c_str(), "V8")); - break; - } - case Isolate::MessageErrorLevel::kMessageError: - FatalException(isolate, error, message); - break; - } -} - void SignalExit(int signo) { uv_tty_reset_mode(); #ifdef __FreeBSD__ @@ -969,35 +730,6 @@ void Init(int* argc, argv[i] = strdup(argv_[i].c_str()); } -void RunAtExit(Environment* env) { - env->RunAtExitCallbacks(); -} - - -uv_loop_t* GetCurrentEventLoop(Isolate* isolate) { - HandleScope handle_scope(isolate); - Local context = isolate->GetCurrentContext(); - if (context.IsEmpty()) - return nullptr; - Environment* env = Environment::GetCurrent(context); - if (env == nullptr) - return nullptr; - return env->event_loop(); -} - - -void AtExit(void (*cb)(void* arg), void* arg) { - auto env = Environment::GetThreadLocalEnv(); - AtExit(env, cb, arg); -} - - -void AtExit(Environment* env, void (*cb)(void* arg), void* arg) { - CHECK_NOT_NULL(env); - env->AtExit(cb, arg); -} - - void RunBeforeExit(Environment* env) { env->RunBeforeExitCallbacks(); @@ -1005,155 +737,6 @@ void RunBeforeExit(Environment* env) { EmitBeforeExit(env); } - -void EmitBeforeExit(Environment* env) { - HandleScope handle_scope(env->isolate()); - Context::Scope context_scope(env->context()); - Local exit_code = env->process_object() - ->Get(env->context(), env->exit_code_string()) - .ToLocalChecked() - ->ToInteger(env->context()) - .ToLocalChecked(); - ProcessEmit(env, "beforeExit", exit_code).ToLocalChecked(); -} - -int EmitExit(Environment* env) { - // process.emit('exit') - HandleScope handle_scope(env->isolate()); - Context::Scope context_scope(env->context()); - Local process_object = env->process_object(); - process_object->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "_exiting"), - True(env->isolate())).FromJust(); - - Local exit_code = env->exit_code_string(); - int code = process_object->Get(env->context(), exit_code).ToLocalChecked() - ->Int32Value(env->context()).ToChecked(); - ProcessEmit(env, "exit", Integer::New(env->isolate(), code)); - - // Reload exit code, it may be changed by `emit('exit')` - return process_object->Get(env->context(), exit_code).ToLocalChecked() - ->Int32Value(env->context()).ToChecked(); -} - - -ArrayBufferAllocator* CreateArrayBufferAllocator() { - return new ArrayBufferAllocator(); -} - - -void FreeArrayBufferAllocator(ArrayBufferAllocator* allocator) { - delete allocator; -} - - -IsolateData* CreateIsolateData( - Isolate* isolate, - uv_loop_t* loop, - MultiIsolatePlatform* platform, - ArrayBufferAllocator* allocator) { - return new IsolateData( - isolate, - loop, - platform, - allocator != nullptr ? allocator->zero_fill_field() : nullptr); -} - - -void FreeIsolateData(IsolateData* isolate_data) { - delete isolate_data; -} - - -Environment* CreateEnvironment(IsolateData* isolate_data, - Local context, - int argc, - const char* const* argv, - int exec_argc, - const char* const* exec_argv) { - Isolate* isolate = context->GetIsolate(); - HandleScope handle_scope(isolate); - Context::Scope context_scope(context); - // TODO(addaleax): This is a much better place for parsing per-Environment - // options than the global parse call. - std::vector args(argv, argv + argc); - std::vector exec_args(exec_argv, exec_argv + exec_argc); - Environment* env = new Environment(isolate_data, context); - env->Start(per_process::v8_is_profiling); - env->ProcessCliArgs(args, exec_args); - return env; -} - - -void FreeEnvironment(Environment* env) { - env->RunCleanup(); - delete env; -} - - -Environment* GetCurrentEnvironment(Local context) { - return Environment::GetCurrent(context); -} - - -MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() { - return per_process::v8_platform.Platform(); -} - - -MultiIsolatePlatform* CreatePlatform( - int thread_pool_size, - node::tracing::TracingController* tracing_controller) { - return new NodePlatform(thread_pool_size, tracing_controller); -} - - -MultiIsolatePlatform* InitializeV8Platform(int thread_pool_size) { - per_process::v8_platform.Initialize(thread_pool_size); - return per_process::v8_platform.Platform(); -} - - -void FreePlatform(MultiIsolatePlatform* platform) { - delete platform; -} - -Local NewContext(Isolate* isolate, - Local object_template) { - Local context = Context::New(isolate, nullptr, object_template); - if (context.IsEmpty()) return context; - HandleScope handle_scope(isolate); - - context->SetEmbedderData( - ContextEmbedderIndex::kAllowWasmCodeGeneration, True(isolate)); - - { - // Run lib/internal/per_context.js - Context::Scope context_scope(context); - - std::vector> parameters = { - FIXED_ONE_BYTE_STRING(isolate, "global")}; - Local arguments[] = {context->Global()}; - MaybeLocal maybe_fn = - per_process::native_module_loader.LookupAndCompile( - context, "internal/per_context", ¶meters, nullptr); - if (maybe_fn.IsEmpty()) { - return Local(); - } - Local fn = maybe_fn.ToLocalChecked(); - MaybeLocal result = - fn->Call(context, Undefined(isolate), arraysize(arguments), arguments); - // Execution failed during context creation. - // TODO(joyeecheung): deprecate this signature and return a MaybeLocal. - if (result.IsEmpty()) { - return Local(); - } - } - - return context; -} - - inline int Start(Isolate* isolate, IsolateData* isolate_data, const std::vector& args, const std::vector& exec_args) { @@ -1235,41 +818,6 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, return exit_code; } -bool AllowWasmCodeGenerationCallback( - Local context, Local) { - Local wasm_code_gen = - context->GetEmbedderData(ContextEmbedderIndex::kAllowWasmCodeGeneration); - return wasm_code_gen->IsUndefined() || wasm_code_gen->IsTrue(); -} - -Isolate* NewIsolate(ArrayBufferAllocator* allocator, uv_loop_t* event_loop) { - Isolate::CreateParams params; - params.array_buffer_allocator = allocator; -#ifdef NODE_ENABLE_VTUNE_PROFILING - params.code_event_handler = vTune::GetVtuneCodeEventHandler(); -#endif - - Isolate* isolate = Isolate::Allocate(); - if (isolate == nullptr) - return nullptr; - - // Register the isolate on the platform before the isolate gets initialized, - // so that the isolate can access the platform during initialization. - per_process::v8_platform.Platform()->RegisterIsolate(isolate, event_loop); - Isolate::Initialize(isolate, params); - - isolate->AddMessageListenerWithErrorLevel(OnMessage, - Isolate::MessageErrorLevel::kMessageError | - Isolate::MessageErrorLevel::kMessageWarning); - isolate->SetAbortOnUncaughtExceptionCallback(ShouldAbortOnUncaughtException); - isolate->SetMicrotasksPolicy(MicrotasksPolicy::kExplicit); - isolate->SetFatalErrorHandler(OnFatalError); - isolate->SetAllowWasmCodeGenerationCallback(AllowWasmCodeGenerationCallback); - v8::CpuProfiler::UseDetailedSourcePositionsForProfiling(isolate); - - return isolate; -} - inline int Start(uv_loop_t* event_loop, const std::vector& args, const std::vector& exec_args) { diff --git a/src/node_errors.cc b/src/node_errors.cc index 8fb0e0122f542d..42e19f690514ff 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -758,19 +758,6 @@ void FatalException(Isolate* isolate, } } -void FatalException(Isolate* isolate, const v8::TryCatch& try_catch) { - // If we try to print out a termination exception, we'd just get 'null', - // so just crashing here with that information seems like a better idea, - // and in particular it seems like we should handle terminations at the call - // site for this function rather than by printing them out somewhere. - CHECK(!try_catch.HasTerminated()); - - HandleScope scope(isolate); - if (!try_catch.IsVerbose()) { - FatalException(isolate, try_catch.Exception(), try_catch.Message()); - } -} - void FatalException(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); Environment* env = Environment::GetCurrent(isolate); diff --git a/src/node_internals.h b/src/node_internals.h index d972e2e5bd5916..b34e6f90e7d28c 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -56,6 +56,7 @@ class NativeModuleLoader; namespace per_process { extern Mutex env_var_mutex; extern double prog_start_time; +extern bool v8_is_profiling; } // namespace per_process // Forward declaration From f63817fd38b7ffbd803ac5e4cafa215d9f7ad363 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 29 Jan 2019 19:06:17 +0100 Subject: [PATCH 161/223] worker: refactor thread id management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Assign thread IDs to `Environment` instances, rather than Workers. This is more embedder-friendly than the current system, in which all “main threads” (if there are multiple ones) would get the id `0`. - Because that means that `isMainThread === (threadId === 0)` no longer holds, refactor `isMainThread` into a separate entity. Implement it in a way that allows for future extensibility, because we use `isMainThread` in multiple different ways (determining whether there is a parent thread; determining whether the current thread has control of the current process; etc.). PR-URL: https://github.com/nodejs/node/pull/25796 Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Denys Otrishko --- lib/internal/worker.js | 5 ++--- src/api/environment.cc | 4 +++- src/env-inl.h | 6 +----- src/env.cc | 8 +++++++- src/env.h | 12 +++++++++--- src/node.cc | 2 +- src/node_worker.cc | 44 ++++++++++++++++++++++-------------------- 7 files changed, 46 insertions(+), 35 deletions(-) diff --git a/lib/internal/worker.js b/lib/internal/worker.js index da663798148441..083ef76184ec2e 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -31,11 +31,10 @@ const { pathToFileURL } = require('url'); const { Worker: WorkerImpl, - threadId + threadId, + isMainThread } = internalBinding('worker'); -const isMainThread = threadId === 0; - const kHandle = Symbol('kHandle'); const kPublicPort = Symbol('kPublicPort'); const kDispose = Symbol('kDispose'); diff --git a/src/api/environment.cc b/src/api/environment.cc index 9480fb2b96144c..22938df37cc41d 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -133,7 +133,9 @@ Environment* CreateEnvironment(IsolateData* isolate_data, // options than the global parse call. std::vector args(argv, argv + argc); std::vector exec_args(exec_argv, exec_argv + exec_argc); - Environment* env = new Environment(isolate_data, context); + // TODO(addaleax): Provide more sensible flags, in an embedder-accessible way. + Environment* env = + new Environment(isolate_data, context, Environment::kIsMainThread); env->Start(per_process::v8_is_profiling); env->ProcessCliArgs(args, exec_args); return env; diff --git a/src/env-inl.h b/src/env-inl.h index d5bf6bc086ab77..0a47b7cfcae345 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -647,17 +647,13 @@ inline void Environment::set_has_run_bootstrapping_code(bool value) { } inline bool Environment::is_main_thread() const { - return thread_id_ == 0; + return flags_ & kIsMainThread; } inline uint64_t Environment::thread_id() const { return thread_id_; } -inline void Environment::set_thread_id(uint64_t id) { - thread_id_ = id; -} - inline worker::Worker* Environment::worker_context() const { return worker_context_; } diff --git a/src/env.cc b/src/env.cc index 03e8369063e5ac..d6ffa93fd69e8b 100644 --- a/src/env.cc +++ b/src/env.cc @@ -16,6 +16,7 @@ #include #include +#include namespace node { @@ -166,8 +167,11 @@ void Environment::TrackingTraceStateObserver::UpdateTraceCategoryState() { 0, nullptr).ToLocalChecked(); } +static std::atomic next_thread_id{0}; + Environment::Environment(IsolateData* isolate_data, - Local context) + Local context, + Flags flags) : isolate_(context->GetIsolate()), isolate_data_(isolate_data), immediate_info_(context->GetIsolate()), @@ -176,6 +180,8 @@ Environment::Environment(IsolateData* isolate_data, should_abort_on_uncaught_toggle_(isolate_, 1), trace_category_state_(isolate_, kTraceCategoryCount), stream_base_state_(isolate_, StreamBase::kNumStreamBaseStateFields), + flags_(flags), + thread_id_(next_thread_id++), fs_stats_field_array_(isolate_, kFsStatsBufferLength), fs_stats_field_bigint_array_(isolate_, kFsStatsBufferLength), context_(context->GetIsolate(), context) { diff --git a/src/env.h b/src/env.h index 8a6b2d0e479997..4134efcb5db9c5 100644 --- a/src/env.h +++ b/src/env.h @@ -593,6 +593,11 @@ class Environment { DISALLOW_COPY_AND_ASSIGN(TickInfo); }; + enum Flags { + kNoFlags = 0, + kIsMainThread = 1 + }; + static inline Environment* GetCurrent(v8::Isolate* isolate); static inline Environment* GetCurrent(v8::Local context); static inline Environment* GetCurrent( @@ -606,7 +611,8 @@ class Environment { static inline Environment* GetThreadLocalEnv(); Environment(IsolateData* isolate_data, - v8::Local context); + v8::Local context, + Flags flags = Flags()); ~Environment(); void Start(bool start_profiler_idle_notifier); @@ -759,7 +765,6 @@ class Environment { inline bool is_main_thread() const; inline uint64_t thread_id() const; - inline void set_thread_id(uint64_t id); inline worker::Worker* worker_context() const; inline void set_worker_context(worker::Worker* context); inline void add_sub_worker_context(worker::Worker* context); @@ -1003,7 +1008,8 @@ class Environment { bool has_run_bootstrapping_code_ = false; bool can_call_into_js_ = true; - uint64_t thread_id_ = 0; + Flags flags_; + uint64_t thread_id_; std::unordered_set sub_worker_contexts_; static void* const kNodeContextTagPtr; diff --git a/src/node.cc b/src/node.cc index 745ed83917885e..d3a3d299ac5268 100644 --- a/src/node.cc +++ b/src/node.cc @@ -743,7 +743,7 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, HandleScope handle_scope(isolate); Local context = NewContext(isolate); Context::Scope context_scope(context); - Environment env(isolate_data, context); + Environment env(isolate_data, context, Environment::kIsMainThread); env.Start(per_process::v8_is_profiling); env.ProcessCliArgs(args, exec_args); diff --git a/src/node_worker.cc b/src/node_worker.cc index 4b78d653929d4b..d457ab0c3e1ff2 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -13,6 +13,7 @@ using node::options_parser::kDisallowedInEnvironment; using v8::ArrayBuffer; +using v8::Boolean; using v8::Context; using v8::Function; using v8::FunctionCallbackInfo; @@ -33,9 +34,6 @@ namespace worker { namespace { -uint64_t next_thread_id = 1; -Mutex next_thread_id_mutex; - #if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR void StartWorkerInspector(Environment* child, const std::string& url) { child->inspector_agent()->Start(url, @@ -74,17 +72,7 @@ Worker::Worker(Environment* env, const std::string& url, std::shared_ptr per_isolate_opts) : AsyncWrap(env, wrap, AsyncWrap::PROVIDER_WORKER), url_(url) { - // Generate a new thread id. - { - Mutex::ScopedLock next_thread_id_lock(next_thread_id_mutex); - thread_id_ = next_thread_id++; - } - - Debug(this, "Creating worker with id %llu", thread_id_); - wrap->Set(env->context(), - env->thread_id_string(), - Number::New(env->isolate(), - static_cast(thread_id_))).FromJust(); + Debug(this, "Creating new worker instance at %p", static_cast(this)); // Set up everything that needs to be set up in the parent environment. parent_port_ = MessagePort::New(env, env->context()); @@ -130,7 +118,7 @@ Worker::Worker(Environment* env, CHECK_NE(env_, nullptr); env_->set_abort_on_uncaught_exception(false); env_->set_worker_context(this); - env_->set_thread_id(thread_id_); + thread_id_ = env_->thread_id(); env_->Start(env->profiler_idle_notifier_started()); env_->ProcessCliArgs(std::vector{}, @@ -142,7 +130,15 @@ Worker::Worker(Environment* env, // The new isolate won't be bothered on this thread again. isolate_->DiscardThreadSpecificMetadata(); - Debug(this, "Set up worker with id %llu", thread_id_); + wrap->Set(env->context(), + env->thread_id_string(), + Number::New(env->isolate(), static_cast(thread_id_))) + .FromJust(); + + Debug(this, + "Set up worker at %p with id %llu", + static_cast(this), + thread_id_); } bool Worker::is_stopped() const { @@ -562,11 +558,17 @@ void InitWorker(Local target, env->SetMethod(target, "getEnvMessagePort", GetEnvMessagePort); - auto thread_id_string = FIXED_ONE_BYTE_STRING(env->isolate(), "threadId"); - target->Set(env->context(), - thread_id_string, - Number::New(env->isolate(), - static_cast(env->thread_id()))).FromJust(); + target + ->Set(env->context(), + env->thread_id_string(), + Number::New(env->isolate(), static_cast(env->thread_id()))) + .FromJust(); + + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "isMainThread"), + Boolean::New(env->isolate(), env->is_main_thread())) + .FromJust(); } } // anonymous namespace From 92ca50636c8836a90248c2449206ad0eb96d43c1 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 30 Jan 2019 22:21:07 +0800 Subject: [PATCH 162/223] lib: save primordials during bootstrap and use it in builtins This patches changes the `safe_globals` internal module into a script that gets run during bootstrap and saves JavaScript builtins (primordials) into an object that is available for all other builtin modules to access lexically later. PR-URL: https://github.com/nodejs/node/pull/25816 Refs: https://github.com/nodejs/node/issues/18795 Reviewed-By: Bradley Farias Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan --- lib/.eslintrc.yaml | 1 + lib/internal/bootstrap/cache.js | 1 + lib/internal/bootstrap/loaders.js | 76 ++++++++------------- lib/internal/bootstrap/primordials.js | 84 ++++++++++++++++++++++++ lib/internal/error-serdes.js | 14 ++-- lib/internal/modules/esm/module_job.js | 6 +- lib/internal/modules/esm/module_map.js | 4 +- lib/internal/modules/esm/translators.js | 9 ++- lib/internal/policy/manifest.js | 17 +++-- lib/internal/safe_globals.js | 25 ------- lib/internal/trace_events_async_hooks.js | 2 +- lib/internal/vm/source_text_module.js | 2 +- lib/url.js | 2 +- node.gyp | 2 +- src/env.h | 2 + src/node.cc | 40 +++++++---- src/node_native_module.cc | 3 +- 17 files changed, 185 insertions(+), 105 deletions(-) create mode 100644 lib/internal/bootstrap/primordials.js delete mode 100644 lib/internal/safe_globals.js diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 81a764f0f85b81..181fb9cead2090 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -46,3 +46,4 @@ globals: DCHECK_LT: false DCHECK_NE: false internalBinding: false + primordials: false diff --git a/lib/internal/bootstrap/cache.js b/lib/internal/bootstrap/cache.js index bed20106060193..5d5c441e65a7b7 100644 --- a/lib/internal/bootstrap/cache.js +++ b/lib/internal/bootstrap/cache.js @@ -22,6 +22,7 @@ const cannotBeRequired = [ 'internal/test/binding', + 'internal/bootstrap/primordials', 'internal/bootstrap/loaders', 'internal/bootstrap/node' ]; diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 7078707b83adb1..1007b41069c723 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -40,33 +40,20 @@ 'use strict'; // This file is compiled as if it's wrapped in a function with arguments -// passed by node::LoadEnvironment() +// passed by node::RunBootstrapping() /* global process, getBinding, getLinkedBinding, getInternalBinding */ -/* global debugBreak, experimentalModules, exposeInternals */ +/* global experimentalModules, exposeInternals, primordials */ -if (debugBreak) - debugger; // eslint-disable-line no-debugger - -const { - apply: ReflectApply, - deleteProperty: ReflectDeleteProperty, - get: ReflectGet, - getOwnPropertyDescriptor: ReflectGetOwnPropertyDescriptor, - has: ReflectHas, - set: ReflectSet, -} = Reflect; const { - prototype: { - hasOwnProperty: ObjectHasOwnProperty, - }, - create: ObjectCreate, - defineProperty: ObjectDefineProperty, - keys: ObjectKeys, -} = Object; + Reflect, + Object, + ObjectPrototype, + SafeSet +} = primordials; // Set up process.moduleLoadList. const moduleLoadList = []; -ObjectDefineProperty(process, 'moduleLoadList', { +Object.defineProperty(process, 'moduleLoadList', { value: moduleLoadList, configurable: true, enumerable: true, @@ -78,7 +65,7 @@ ObjectDefineProperty(process, 'moduleLoadList', { // that are whitelisted for access via process.binding()... This is used // to provide a transition path for modules that are being moved over to // internalBinding. -const internalBindingWhitelist = [ +const internalBindingWhitelist = new SafeSet([ 'async_wrap', 'buffer', 'cares_wrap', @@ -108,20 +95,17 @@ const internalBindingWhitelist = [ 'uv', 'v8', 'zlib' -]; -// We will use a lazy loaded SafeSet in internalBindingWhitelistHas -// for checking existence in this list. -let internalBindingWhitelistSet; +]); // Set up process.binding() and process._linkedBinding(). { - const bindingObj = ObjectCreate(null); + const bindingObj = Object.create(null); process.binding = function binding(module) { module = String(module); // Deprecated specific process.binding() modules, but not all, allow // selective fallback to internalBinding for the deprecated ones. - if (internalBindingWhitelistHas(module)) { + if (internalBindingWhitelist.has(module)) { return internalBinding(module); } let mod = bindingObj[module]; @@ -144,7 +128,7 @@ let internalBindingWhitelistSet; // Set up internalBinding() in the closure. let internalBinding; { - const bindingObj = ObjectCreate(null); + const bindingObj = Object.create(null); internalBinding = function internalBinding(module) { let mod = bindingObj[module]; if (typeof mod !== 'object') { @@ -245,8 +229,8 @@ NativeModule.requireWithFallbackInDeps = function(request) { }; const getOwn = (target, property, receiver) => { - return ReflectApply(ObjectHasOwnProperty, target, [property]) ? - ReflectGet(target, property, receiver) : + return Reflect.apply(ObjectPrototype.hasOwnProperty, target, [property]) ? + Reflect.get(target, property, receiver) : undefined; }; @@ -255,12 +239,12 @@ const getOwn = (target, property, receiver) => { // as the entire namespace (module.exports) and wrapped in a proxy such // that APMs and other behavior are still left intact. NativeModule.prototype.proxifyExports = function() { - this.exportKeys = ObjectKeys(this.exports); + this.exportKeys = Object.keys(this.exports); const update = (property, value) => { if (this.reflect !== undefined && - ReflectApply(ObjectHasOwnProperty, - this.reflect.exports, [property])) + Reflect.apply(ObjectPrototype.hasOwnProperty, + this.reflect.exports, [property])) this.reflect.exports[property].set(value); }; @@ -269,12 +253,12 @@ NativeModule.prototype.proxifyExports = function() { defineProperty: (target, prop, descriptor) => { // Use `Object.defineProperty` instead of `Reflect.defineProperty` // to throw the appropriate error if something goes wrong. - ObjectDefineProperty(target, prop, descriptor); + Object.defineProperty(target, prop, descriptor); if (typeof descriptor.get === 'function' && - !ReflectHas(handler, 'get')) { + !Reflect.has(handler, 'get')) { handler.get = (target, prop, receiver) => { - const value = ReflectGet(target, prop, receiver); - if (ReflectApply(ObjectHasOwnProperty, target, [prop])) + const value = Reflect.get(target, prop, receiver); + if (Reflect.apply(ObjectPrototype.hasOwnProperty, target, [prop])) update(prop, value); return value; }; @@ -283,15 +267,15 @@ NativeModule.prototype.proxifyExports = function() { return true; }, deleteProperty: (target, prop) => { - if (ReflectDeleteProperty(target, prop)) { + if (Reflect.deleteProperty(target, prop)) { update(prop, undefined); return true; } return false; }, set: (target, prop, value, receiver) => { - const descriptor = ReflectGetOwnPropertyDescriptor(target, prop); - if (ReflectSet(target, prop, value, receiver)) { + const descriptor = Reflect.getOwnPropertyDescriptor(target, prop); + if (Reflect.set(target, prop, value, receiver)) { if (descriptor && typeof descriptor.set === 'function') { for (const key of this.exportKeys) { update(key, getOwn(target, key, receiver)); @@ -319,7 +303,7 @@ NativeModule.prototype.compile = function() { NativeModule.require; const fn = compileFunction(id); - fn(this.exports, requireFn, this, process, internalBinding); + fn(this.exports, requireFn, this, process, internalBinding, primordials); if (experimentalModules && this.canBeRequiredByUsers) { this.proxifyExports(); @@ -344,13 +328,5 @@ if (process.env.NODE_V8_COVERAGE) { } } -function internalBindingWhitelistHas(name) { - if (!internalBindingWhitelistSet) { - const { SafeSet } = NativeModule.require('internal/safe_globals'); - internalBindingWhitelistSet = new SafeSet(internalBindingWhitelist); - } - return internalBindingWhitelistSet.has(name); -} - // This will be passed to internal/bootstrap/node.js. return loaderExports; diff --git a/lib/internal/bootstrap/primordials.js b/lib/internal/bootstrap/primordials.js new file mode 100644 index 00000000000000..2a97e74542a964 --- /dev/null +++ b/lib/internal/bootstrap/primordials.js @@ -0,0 +1,84 @@ +'use strict'; + +/* global breakAtBootstrap, primordials */ + +// This file subclasses and stores the JS builtins that come from the VM +// so that Node.js's builtin modules do not need to later look these up from +// the global proxy, which can be mutated by users. + +// TODO(joyeecheung): we can restrict access to these globals in builtin +// modules through the JS linter, for example: ban access such as `Object` +// (which falls back to a lookup in the global proxy) in favor of +// `primordials.Object` where `primordials` is a lexical variable passed +// by the native module compiler. + +if (breakAtBootstrap) { + debugger; // eslint-disable-line no-debugger +} + +function copyProps(src, dest) { + for (const key of Reflect.ownKeys(src)) { + if (!Reflect.getOwnPropertyDescriptor(dest, key)) { + Reflect.defineProperty( + dest, + key, + Reflect.getOwnPropertyDescriptor(src, key)); + } + } +} + +function makeSafe(unsafe, safe) { + copyProps(unsafe.prototype, safe.prototype); + copyProps(unsafe, safe); + Object.setPrototypeOf(safe.prototype, null); + Object.freeze(safe.prototype); + Object.freeze(safe); + return safe; +} + +// Subclass the constructors because we need to use their prototype +// methods later. +primordials.SafeMap = makeSafe( + Map, + class SafeMap extends Map {} +); +primordials.SafeWeakMap = makeSafe( + WeakMap, + class SafeWeakMap extends WeakMap {} +); +primordials.SafeSet = makeSafe( + Set, + class SafeSet extends Set {} +); +primordials.SafePromise = makeSafe( + Promise, + class SafePromise extends Promise {} +); + +// Create copies of the namespace objects +[ + 'JSON', + 'Math', + 'Reflect' +].forEach((name) => { + const target = primordials[name] = Object.create(null); + copyProps(global[name], target); +}); + +// Create copies of intrinsic objects +[ + 'Array', + 'Date', + 'Function', + 'Object', + 'RegExp', + 'String' +].forEach((name) => { + const target = primordials[name] = Object.create(null); + copyProps(global[name], target); + const proto = primordials[name + 'Prototype'] = Object.create(null); + copyProps(global[name].prototype, proto); +}); + +Object.setPrototypeOf(primordials, null); +Object.freeze(primordials); diff --git a/lib/internal/error-serdes.js b/lib/internal/error-serdes.js index d6e15ac77397cf..7b4b416b80c670 100644 --- a/lib/internal/error-serdes.js +++ b/lib/internal/error-serdes.js @@ -2,7 +2,13 @@ const Buffer = require('buffer').Buffer; const { serialize, deserialize } = require('v8'); -const { SafeSet } = require('internal/safe_globals'); +const { + SafeSet, + Object, + ObjectPrototype, + FunctionPrototype, + ArrayPrototype +} = primordials; const kSerializedError = 0; const kSerializedObject = 1; @@ -14,9 +20,9 @@ const GetOwnPropertyNames = Object.getOwnPropertyNames; const DefineProperty = Object.defineProperty; const Assign = Object.assign; const ObjectPrototypeToString = - Function.prototype.call.bind(Object.prototype.toString); -const ForEach = Function.prototype.call.bind(Array.prototype.forEach); -const Call = Function.prototype.call.bind(Function.prototype.call); + FunctionPrototype.call.bind(ObjectPrototype.toString); +const ForEach = FunctionPrototype.call.bind(ArrayPrototype.forEach); +const Call = FunctionPrototype.call.bind(FunctionPrototype.call); const errors = { Error, TypeError, RangeError, URIError, SyntaxError, ReferenceError, EvalError diff --git a/lib/internal/modules/esm/module_job.js b/lib/internal/modules/esm/module_job.js index e3fb91ca6ff505..e900babefd6261 100644 --- a/lib/internal/modules/esm/module_job.js +++ b/lib/internal/modules/esm/module_job.js @@ -1,7 +1,11 @@ 'use strict'; const { ModuleWrap } = internalBinding('module_wrap'); -const { SafeSet, SafePromise } = require('internal/safe_globals'); +const { + SafeSet, + SafePromise +} = primordials; + const { decorateErrorStack } = require('internal/util'); const assert = require('assert'); const resolvedPromise = SafePromise.resolve(); diff --git a/lib/internal/modules/esm/module_map.js b/lib/internal/modules/esm/module_map.js index a9d0c23c0e5ee9..1c1cd54a3d79ed 100644 --- a/lib/internal/modules/esm/module_map.js +++ b/lib/internal/modules/esm/module_map.js @@ -1,7 +1,9 @@ 'use strict'; const ModuleJob = require('internal/modules/esm/module_job'); -const { SafeMap } = require('internal/safe_globals'); +const { + SafeMap +} = primordials; const debug = require('util').debuglog('esm'); const { ERR_INVALID_ARG_TYPE } = require('internal/errors').codes; const { validateString } = require('internal/validators'); diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index 776b8d584df21f..25552cff0e8f47 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -12,14 +12,19 @@ const createDynamicModule = require( 'internal/modules/esm/create_dynamic_module'); const fs = require('fs'); const { _makeLong } = require('path'); -const { SafeMap } = require('internal/safe_globals'); +const { + SafeMap, + JSON, + FunctionPrototype, + StringPrototype +} = primordials; const { URL } = require('url'); const { debuglog, promisify } = require('util'); const esmLoader = require('internal/process/esm_loader'); const readFileAsync = promisify(fs.readFile); const readFileSync = fs.readFileSync; -const StringReplace = Function.call.bind(String.prototype.replace); +const StringReplace = FunctionPrototype.call.bind(StringPrototype.replace); const JsonParse = JSON.parse; const debug = debuglog('esm'); diff --git a/lib/internal/policy/manifest.js b/lib/internal/policy/manifest.js index 67b6d7b9d9b6c5..6c777a7c78b9c6 100644 --- a/lib/internal/policy/manifest.js +++ b/lib/internal/policy/manifest.js @@ -6,16 +6,21 @@ const { } = require('internal/errors').codes; const debug = require('util').debuglog('policy'); const SRI = require('internal/policy/sri'); -const { SafeWeakMap } = require('internal/safe_globals'); +const { + SafeWeakMap, + FunctionPrototype, + Object, + RegExpPrototype +} = primordials; const crypto = require('crypto'); const { Buffer } = require('buffer'); const { URL } = require('url'); const { createHash, timingSafeEqual } = crypto; -const HashUpdate = Function.call.bind(crypto.Hash.prototype.update); -const HashDigest = Function.call.bind(crypto.Hash.prototype.digest); -const BufferEquals = Function.call.bind(Buffer.prototype.equals); -const BufferToString = Function.call.bind(Buffer.prototype.toString); -const RegExpTest = Function.call.bind(RegExp.prototype.test); +const HashUpdate = FunctionPrototype.call.bind(crypto.Hash.prototype.update); +const HashDigest = FunctionPrototype.call.bind(crypto.Hash.prototype.digest); +const BufferEquals = FunctionPrototype.call.bind(Buffer.prototype.equals); +const BufferToString = FunctionPrototype.call.bind(Buffer.prototype.toString); +const RegExpTest = FunctionPrototype.call.bind(RegExpPrototype.test); const { entries } = Object; const kIntegrities = new SafeWeakMap(); const kReactions = new SafeWeakMap(); diff --git a/lib/internal/safe_globals.js b/lib/internal/safe_globals.js deleted file mode 100644 index 109409d535495d..00000000000000 --- a/lib/internal/safe_globals.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -const copyProps = (unsafe, safe) => { - for (const key of Reflect.ownKeys(unsafe)) { - if (!Object.getOwnPropertyDescriptor(safe, key)) { - Object.defineProperty( - safe, - key, - Object.getOwnPropertyDescriptor(unsafe, key)); - } - } -}; -const makeSafe = (unsafe, safe) => { - copyProps(unsafe.prototype, safe.prototype); - copyProps(unsafe, safe); - Object.setPrototypeOf(safe.prototype, null); - Object.freeze(safe.prototype); - Object.freeze(safe); - return safe; -}; - -exports.SafeMap = makeSafe(Map, class SafeMap extends Map {}); -exports.SafeWeakMap = makeSafe(WeakMap, class SafeWeakMap extends WeakMap {}); -exports.SafeSet = makeSafe(Set, class SafeSet extends Set {}); -exports.SafePromise = makeSafe(Promise, class SafePromise extends Promise {}); diff --git a/lib/internal/trace_events_async_hooks.js b/lib/internal/trace_events_async_hooks.js index 0cf5d517c2bf9f..b947cbb6152b4b 100644 --- a/lib/internal/trace_events_async_hooks.js +++ b/lib/internal/trace_events_async_hooks.js @@ -3,7 +3,7 @@ const { trace } = internalBinding('trace_events'); const async_wrap = internalBinding('async_wrap'); const async_hooks = require('async_hooks'); -const { SafeMap, SafeSet } = require('internal/safe_globals'); +const { SafeMap, SafeSet } = primordials; // Use small letters such that chrome://tracing groups by the name. // The behavior is not only useful but the same as the events emitted using diff --git a/lib/internal/vm/source_text_module.js b/lib/internal/vm/source_text_module.js index 8b107a9b74866f..6840b4281f46f1 100644 --- a/lib/internal/vm/source_text_module.js +++ b/lib/internal/vm/source_text_module.js @@ -17,7 +17,7 @@ const { customInspectSymbol, emitExperimentalWarning } = require('internal/util'); -const { SafePromise } = require('internal/safe_globals'); +const { SafePromise } = primordials; const { validateInt32, validateUint32, diff --git a/lib/url.js b/lib/url.js index 569733bfc4b0d7..0e02dbc1312101 100644 --- a/lib/url.js +++ b/lib/url.js @@ -23,7 +23,7 @@ const { toASCII } = require('internal/idna'); const { hexTable } = require('internal/querystring'); -const { SafeSet } = require('internal/safe_globals'); +const { SafeSet } = primordials; const { ERR_INVALID_ARG_TYPE diff --git a/node.gyp b/node.gyp index 81a0ade8f7ac83..ae5578b72ec952 100644 --- a/node.gyp +++ b/node.gyp @@ -27,6 +27,7 @@ 'node_intermediate_lib_type%': 'static_library', 'library_files': [ 'lib/internal/per_context.js', + 'lib/internal/bootstrap/primordials.js', 'lib/internal/bootstrap/cache.js', 'lib/internal/bootstrap/loaders.js', 'lib/internal/bootstrap/node.js', @@ -151,7 +152,6 @@ 'lib/internal/modules/esm/module_job.js', 'lib/internal/modules/esm/module_map.js', 'lib/internal/modules/esm/translators.js', - 'lib/internal/safe_globals.js', 'lib/internal/net.js', 'lib/internal/options.js', 'lib/internal/policy/manifest.js', diff --git a/src/env.h b/src/env.h index 4134efcb5db9c5..51775ff1a00155 100644 --- a/src/env.h +++ b/src/env.h @@ -254,6 +254,7 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2; V(port2_string, "port2") \ V(port_string, "port") \ V(preference_string, "preference") \ + V(primordials_string, "primordials") \ V(priority_string, "priority") \ V(process_string, "process") \ V(promise_string, "promise") \ @@ -364,6 +365,7 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2; V(performance_entry_template, v8::Function) \ V(pipe_constructor_template, v8::FunctionTemplate) \ V(process_object, v8::Object) \ + V(primordials, v8::Object) \ V(promise_reject_callback, v8::Function) \ V(promise_wrap_template, v8::ObjectTemplate) \ V(sab_lifetimepartner_constructor_template, v8::FunctionTemplate) \ diff --git a/src/node.cc b/src/node.cc index d3a3d299ac5268..8593daeefcfd35 100644 --- a/src/node.cc +++ b/src/node.cc @@ -259,18 +259,37 @@ MaybeLocal RunBootstrapping(Environment* env) { global->Set(context, FIXED_ONE_BYTE_STRING(env->isolate(), "global"), global) .FromJust(); + // Store primordials + env->set_primordials(Object::New(isolate)); + std::vector> primordials_params = { + FIXED_ONE_BYTE_STRING(isolate, "breakAtBootstrap"), + env->primordials_string() + }; + std::vector> primordials_args = { + Boolean::New(isolate, + env->options()->debug_options().break_node_first_line), + env->primordials() + }; + MaybeLocal primordials_ret = + ExecuteBootstrapper(env, + "internal/bootstrap/primordials", + &primordials_params, + &primordials_args); + if (primordials_ret.IsEmpty()) { + return MaybeLocal(); + } + // Create binding loaders std::vector> loaders_params = { env->process_string(), FIXED_ONE_BYTE_STRING(isolate, "getBinding"), FIXED_ONE_BYTE_STRING(isolate, "getLinkedBinding"), FIXED_ONE_BYTE_STRING(isolate, "getInternalBinding"), - // --inspect-brk-node - FIXED_ONE_BYTE_STRING(isolate, "debugBreak"), // --experimental-modules FIXED_ONE_BYTE_STRING(isolate, "experimentalModules"), // --expose-internals - FIXED_ONE_BYTE_STRING(isolate, "exposeInternals")}; + FIXED_ONE_BYTE_STRING(isolate, "exposeInternals"), + env->primordials_string()}; std::vector> loaders_args = { process, env->NewFunctionTemplate(binding::GetBinding) @@ -282,12 +301,9 @@ MaybeLocal RunBootstrapping(Environment* env) { env->NewFunctionTemplate(binding::GetInternalBinding) ->GetFunction(context) .ToLocalChecked(), - Boolean::New(isolate, - env->options()->debug_options().break_node_first_line), - Boolean::New(isolate, - env->options()->experimental_modules), - Boolean::New(isolate, - env->options()->expose_internals)}; + Boolean::New(isolate, env->options()->experimental_modules), + Boolean::New(isolate, env->options()->expose_internals), + env->primordials()}; // Bootstrap internal loaders MaybeLocal loader_exports = ExecuteBootstrapper( @@ -311,11 +327,13 @@ MaybeLocal RunBootstrapping(Environment* env) { std::vector> node_params = { env->process_string(), FIXED_ONE_BYTE_STRING(isolate, "loaderExports"), - FIXED_ONE_BYTE_STRING(isolate, "isMainThread")}; + FIXED_ONE_BYTE_STRING(isolate, "isMainThread"), + env->primordials_string()}; std::vector> node_args = { process, loader_exports_obj, - Boolean::New(isolate, env->is_main_thread())}; + Boolean::New(isolate, env->is_main_thread()), + env->primordials()}; MaybeLocal result = ExecuteBootstrapper( env, "internal/bootstrap/node", &node_params, &node_args); diff --git a/src/node_native_module.cc b/src/node_native_module.cc index 675495e34bff5a..662aad31d5d159 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -181,7 +181,8 @@ MaybeLocal NativeModuleLoader::CompileAsModule(Environment* env, env->require_string(), env->module_string(), env->process_string(), - env->internal_binding_string()}; + env->internal_binding_string(), + env->primordials_string()}; return per_process::native_module_loader.LookupAndCompile( env->context(), id, ¶meters, env); } From 1d76ba1b3deaeda6b4dbf3f3f224128ee2f77460 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 30 Jan 2019 23:19:45 +0800 Subject: [PATCH 163/223] process: expose process.features.inspector Instead of using process.config.variables.v8_enable_inspector to detect whether inspector is enabled in the build. PR-URL: https://github.com/nodejs/node/pull/25819 Refs: https://github.com/nodejs/node/issues/25343 Reviewed-By: Eugene Ostroukhov Reviewed-By: Gus Caplan Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen --- lib/internal/bootstrap/node.js | 3 ++- lib/internal/util/inspector.js | 2 +- src/node_config.cc | 12 ++++++------ test/common/index.js | 5 ++--- .../test-inspector-cluster-port-clash.js | 2 +- test/parallel/test-cli-bad-options.js | 2 +- test/parallel/test-cli-node-print-help.js | 3 +-- test/parallel/test-module-cjs-helpers.js | 4 +--- test/parallel/test-process-env-allowed-flags.js | 2 +- test/parallel/test-process-features.js | 1 + test/parallel/test-repl-tab-complete.js | 2 +- test/parallel/test-v8-coverage.js | 2 +- test/sequential/test-async-wrap-getasyncid.js | 3 +-- .../sequential/test-inspector-has-inspector-false.js | 6 +++--- tools/test.py | 4 ++-- 15 files changed, 25 insertions(+), 28 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 24f7033f714845..534f43bad6f241 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -292,12 +292,13 @@ process.assert = deprecate( // TODO(joyeecheung): this property has not been well-maintained, should we // deprecate it in favor of a better API? -const { isDebugBuild, hasOpenSSL } = config; +const { isDebugBuild, hasOpenSSL, hasInspector } = config; Object.defineProperty(process, 'features', { enumerable: true, writable: false, configurable: false, value: { + inspector: hasInspector, debug: isDebugBuild, uv: true, ipv6: true, // TODO(bnoordhuis) ping libuv diff --git a/lib/internal/util/inspector.js b/lib/internal/util/inspector.js index 68c20108bd317b..e237db16a64800 100644 --- a/lib/internal/util/inspector.js +++ b/lib/internal/util/inspector.js @@ -3,8 +3,8 @@ let session; function sendInspectorCommand(cb, onError) { const { hasInspector } = internalBinding('config'); - const inspector = hasInspector ? require('inspector') : undefined; if (!hasInspector) return onError(); + const inspector = require('inspector'); if (session === undefined) session = new inspector.Session(); try { session.connect(); diff --git a/src/node_config.cc b/src/node_config.cc index 1f851ef91cdd45..6e443230f74df3 100644 --- a/src/node_config.cc +++ b/src/node_config.cc @@ -57,12 +57,6 @@ static void Initialize(Local target, READONLY_TRUE_PROPERTY(target, "hasTracing"); #endif -#if HAVE_INSPECTOR - READONLY_TRUE_PROPERTY(target, "hasInspector"); -#else - READONLY_FALSE_PROPERTY(target, "hasInspector"); -#endif - #if !defined(NODE_WITHOUT_NODE_OPTIONS) READONLY_TRUE_PROPERTY(target, "hasNodeOptions"); #endif @@ -73,6 +67,12 @@ static void Initialize(Local target, #endif // NODE_HAVE_I18N_SUPPORT +#if HAVE_INSPECTOR + READONLY_TRUE_PROPERTY(target, "hasInspector"); +#else + READONLY_FALSE_PROPERTY(target, "hasInspector"); +#endif + READONLY_PROPERTY(target, "bits", Number::New(env->isolate(), 8 * sizeof(intptr_t))); diff --git a/test/common/index.js b/test/common/index.js index 2c1eae7e410650..3d72a876eac281 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -80,8 +80,7 @@ if (process.argv.length === 2 && hasCrypto && // If the binary is build without `intl` the inspect option is // invalid. The test itself should handle this case. - (process.config.variables.v8_enable_inspector !== 0 || - !flag.startsWith('--inspect'))) { + (process.features.inspector || !flag.startsWith('--inspect'))) { throw new Error(`Test has to be started with the flag: '${flag}'`); } } @@ -629,7 +628,7 @@ function expectsError(fn, settings, exact) { } function skipIfInspectorDisabled() { - if (process.config.variables.v8_enable_inspector === 0) { + if (!process.features.inspector) { skip('V8 inspector is disabled'); } } diff --git a/test/known_issues/test-inspector-cluster-port-clash.js b/test/known_issues/test-inspector-cluster-port-clash.js index 0333ffcb98751c..bc04e9907b168b 100644 --- a/test/known_issues/test-inspector-cluster-port-clash.js +++ b/test/known_issues/test-inspector-cluster-port-clash.js @@ -13,7 +13,7 @@ const assert = require('assert'); // This following check should be replaced by common.skipIfInspectorDisabled() // if moved out of the known_issues directory. -if (process.config.variables.v8_enable_inspector === 0) { +if (!process.features.inspector) { // When the V8 inspector is disabled, using either --without-inspector or // --without-ssl, this test will not fail which it is expected to do. // The following fail will allow this test to be skipped by failing it. diff --git a/test/parallel/test-cli-bad-options.js b/test/parallel/test-cli-bad-options.js index 7abd330aa4726d..3fc8980c142509 100644 --- a/test/parallel/test-cli-bad-options.js +++ b/test/parallel/test-cli-bad-options.js @@ -6,7 +6,7 @@ require('../common'); const assert = require('assert'); const spawn = require('child_process').spawnSync; -if (process.config.variables.v8_enable_inspector === 1) { +if (process.features.inspector) { requiresArgument('--inspect-port'); requiresArgument('--inspect-port='); requiresArgument('--debug-port'); diff --git a/test/parallel/test-cli-node-print-help.js b/test/parallel/test-cli-node-print-help.js index 433a95faf20542..e115124b0487fe 100644 --- a/test/parallel/test-cli-node-print-help.js +++ b/test/parallel/test-cli-node-print-help.js @@ -22,10 +22,9 @@ function startPrintHelpTest() { } function validateNodePrintHelp() { - const config = process.config; const HAVE_OPENSSL = common.hasCrypto; const NODE_HAVE_I18N_SUPPORT = common.hasIntl; - const HAVE_INSPECTOR = config.variables.v8_enable_inspector === 1; + const HAVE_INSPECTOR = process.features.inspector; const cliHelpOptions = [ { compileConstant: HAVE_OPENSSL, diff --git a/test/parallel/test-module-cjs-helpers.js b/test/parallel/test-module-cjs-helpers.js index ccf95f3e81c14a..12de65598e54e1 100644 --- a/test/parallel/test-module-cjs-helpers.js +++ b/test/parallel/test-module-cjs-helpers.js @@ -5,7 +5,5 @@ require('../common'); const assert = require('assert'); const { builtinLibs } = require('internal/modules/cjs/helpers'); -const hasInspector = process.config.variables.v8_enable_inspector === 1; - -const expectedLibs = hasInspector ? 34 : 33; +const expectedLibs = process.features.inspector ? 34 : 33; assert.strictEqual(builtinLibs.length, expectedLibs); diff --git a/test/parallel/test-process-env-allowed-flags.js b/test/parallel/test-process-env-allowed-flags.js index 00c44e869455f1..dbc3b1ccd8c3c6 100644 --- a/test/parallel/test-process-env-allowed-flags.js +++ b/test/parallel/test-process-env-allowed-flags.js @@ -16,7 +16,7 @@ require('../common'); 'r', '--stack-trace-limit=100', '--stack-trace-limit=-=xX_nodejs_Xx=-', - ].concat(process.config.variables.v8_enable_inspector ? [ + ].concat(process.features.inspector ? [ '--inspect-brk', 'inspect-brk', '--inspect_brk', diff --git a/test/parallel/test-process-features.js b/test/parallel/test-process-features.js index 7752cc53b2a1ca..a24d366ba8e30a 100644 --- a/test/parallel/test-process-features.js +++ b/test/parallel/test-process-features.js @@ -6,6 +6,7 @@ const assert = require('assert'); const keys = new Set(Object.keys(process.features)); assert.deepStrictEqual(keys, new Set([ + 'inspector', 'debug', 'uv', 'ipv6', diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 0325678ff2e200..5438c960b84cb1 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -29,7 +29,7 @@ const { } = require('../common/hijackstdio'); const assert = require('assert'); const fixtures = require('../common/fixtures'); -const hasInspector = process.config.variables.v8_enable_inspector === 1; +const hasInspector = process.features.inspector; if (!common.isMainThread) common.skip('process.chdir is not available in Workers'); diff --git a/test/parallel/test-v8-coverage.js b/test/parallel/test-v8-coverage.js index a7a318c34d4e96..3db8b81d5504b4 100644 --- a/test/parallel/test-v8-coverage.js +++ b/test/parallel/test-v8-coverage.js @@ -1,6 +1,6 @@ 'use strict'; -if (!process.config.variables.v8_enable_inspector) return; +if (!process.features.inspector) return; const common = require('../common'); const assert = require('assert'); diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js index 6a6bf1b407e50f..a5e2bf64d82fc2 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -289,8 +289,7 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check testInitialized(req, 'SendWrap'); } -if (process.config.variables.v8_enable_inspector !== 0 && - common.isMainThread) { +if (process.features.inspector && common.isMainThread) { const binding = internalBinding('inspector'); const handle = new binding.Connection(() => {}); testInitialized(handle, 'Connection'); diff --git a/test/sequential/test-inspector-has-inspector-false.js b/test/sequential/test-inspector-has-inspector-false.js index cdb7ca9e19e79b..56a50408bb8ea1 100644 --- a/test/sequential/test-inspector-has-inspector-false.js +++ b/test/sequential/test-inspector-has-inspector-false.js @@ -3,10 +3,10 @@ const common = require('../common'); -// This is to ensure that the sendInspectorCommand function calls the error -// function if its called with the v8_enable_inspector is disabled +if (process.features.inspector) { + common.skip('V8 inspector is enabled'); +} -process.config.variables.v8_enable_inspector = 0; const inspector = require('internal/util/inspector'); inspector.sendInspectorCommand( diff --git a/tools/test.py b/tools/test.py index e457075a1c5395..e6fc7be73f11b1 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1661,8 +1661,8 @@ def Main(): # We want to skip the inspector tests if node was built without the inspector. has_inspector = Execute([vm, - '-p', 'process.config.variables.v8_enable_inspector'], context) - if has_inspector.stdout.rstrip() == '0': + '-p', 'process.features.inspector'], context) + if has_inspector.stdout.rstrip() == 'false': context.v8_enable_inspector = False has_crypto = Execute([vm, From c8bf4327d8a845b99258c8268002bbbfd4dfaa0d Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 31 Jan 2019 00:35:57 +0800 Subject: [PATCH 164/223] process: move process mutation into bootstrap/node.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch moves the part in the report initialization that mutates the process object into bootstrap/node.js so it's easier to tell the side effect of the initialization on the global state during bootstrap. PR-URL: https://github.com/nodejs/node/pull/25821 Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Michaël Zasso --- lib/internal/bootstrap/node.js | 13 +- lib/internal/process/report.js | 276 ++++++++++++++++----------------- 2 files changed, 149 insertions(+), 140 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 534f43bad6f241..d0b57f136e7ff9 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -333,7 +333,18 @@ if (process.env.NODE_V8_COVERAGE) { } if (getOptionValue('--experimental-report')) { - NativeModule.require('internal/process/report').setup(); + const { + config, + handleSignal, + report, + syncConfig + } = NativeModule.require('internal/process/report'); + process.report = report; + // Download the CLI / ENV config into JS land. + syncConfig(config, false); + if (config.events.includes('signal')) { + process.on(config.signal, handleSignal); + } } function setupTraceCategoryState() { diff --git a/lib/internal/process/report.js b/lib/internal/process/report.js index f83282ca1920b9..4ef03885ec64a7 100644 --- a/lib/internal/process/report.js +++ b/lib/internal/process/report.js @@ -3,158 +3,156 @@ const { emitExperimentalWarning } = require('internal/util'); const { ERR_INVALID_ARG_TYPE, - ERR_SYNTHETIC } = require('internal/errors').codes; + ERR_SYNTHETIC +} = require('internal/errors').codes; -exports.setup = function() { - const REPORTEVENTS = 1; - const REPORTSIGNAL = 2; - const REPORTFILENAME = 3; - const REPORTPATH = 4; - const REPORTVERBOSE = 5; +const REPORTEVENTS = 1; +const REPORTSIGNAL = 2; +const REPORTFILENAME = 3; +const REPORTPATH = 4; +const REPORTVERBOSE = 5; - // If report is enabled, extract the binding and - // wrap the APIs with thin layers, with some error checks. - // user options can come in from CLI / ENV / API. - // CLI and ENV is intercepted in C++ and the API call here (JS). - // So sync up with both sides as appropriate - initially from - // C++ to JS and from JS to C++ whenever the API is called. - // Some events are controlled purely from JS (signal | exception) - // and some from C++ (fatalerror) so this sync-up is essential for - // correct behavior and alignment with the supplied tunables. - const nr = internalBinding('report'); +// If report is enabled, extract the binding and +// wrap the APIs with thin layers, with some error checks. +// user options can come in from CLI / ENV / API. +// CLI and ENV is intercepted in C++ and the API call here (JS). +// So sync up with both sides as appropriate - initially from +// C++ to JS and from JS to C++ whenever the API is called. +// Some events are controlled purely from JS (signal | exception) +// and some from C++ (fatalerror) so this sync-up is essential for +// correct behavior and alignment with the supplied tunables. +const nr = internalBinding('report'); - // Keep it un-exposed; lest programs play with it - // leaving us with a lot of unwanted sanity checks. - let config = { - events: [], - signal: 'SIGUSR2', - filename: '', - path: '', - verbose: false - }; - const report = { - setDiagnosticReportOptions(options) { - emitExperimentalWarning('report'); - // Reuse the null and undefined checks. Save - // space when dealing with large number of arguments. - const list = parseOptions(options); +// Keep it un-exposed; lest programs play with it +// leaving us with a lot of unwanted sanity checks. +let config = { + events: [], + signal: 'SIGUSR2', + filename: '', + path: '', + verbose: false +}; +const report = { + setDiagnosticReportOptions(options) { + emitExperimentalWarning('report'); + // Reuse the null and undefined checks. Save + // space when dealing with large number of arguments. + const list = parseOptions(options); - // Flush the stale entries from report, as - // we are refreshing it, items that the users did not - // touch may be hanging around stale otherwise. - config = {}; + // Flush the stale entries from report, as + // we are refreshing it, items that the users did not + // touch may be hanging around stale otherwise. + config = {}; - // The parseOption method returns an array that include - // the indices at which valid params are present. - list.forEach((i) => { - switch (i) { - case REPORTEVENTS: - if (Array.isArray(options.events)) - config.events = options.events; - else - throw new ERR_INVALID_ARG_TYPE('events', - 'Array', - options.events); - break; - case REPORTSIGNAL: - if (typeof options.signal !== 'string') { - throw new ERR_INVALID_ARG_TYPE('signal', - 'String', - options.signal); - } - process.removeListener(config.signal, handleSignal); - if (config.events.includes('signal')) - process.on(options.signal, handleSignal); - config.signal = options.signal; - break; - case REPORTFILENAME: - if (typeof options.filename !== 'string') { - throw new ERR_INVALID_ARG_TYPE('filename', - 'String', - options.filename); - } - config.filename = options.filename; - break; - case REPORTPATH: - if (typeof options.path !== 'string') - throw new ERR_INVALID_ARG_TYPE('path', 'String', options.path); - config.path = options.path; - break; - case REPORTVERBOSE: - if (typeof options.verbose !== 'string' && - typeof options.verbose !== 'boolean') { - throw new ERR_INVALID_ARG_TYPE('verbose', - 'Booelan | String' + - ' (true|false|yes|no)', - options.verbose); - } - config.verbose = options.verbose; - break; - } - }); - // Upload this new config to C++ land - nr.syncConfig(config, true); - }, + // The parseOption method returns an array that include + // the indices at which valid params are present. + list.forEach((i) => { + switch (i) { + case REPORTEVENTS: + if (Array.isArray(options.events)) + config.events = options.events; + else + throw new ERR_INVALID_ARG_TYPE('events', + 'Array', + options.events); + break; + case REPORTSIGNAL: + if (typeof options.signal !== 'string') { + throw new ERR_INVALID_ARG_TYPE('signal', + 'String', + options.signal); + } + process.removeListener(config.signal, handleSignal); + if (config.events.includes('signal')) + process.on(options.signal, handleSignal); + config.signal = options.signal; + break; + case REPORTFILENAME: + if (typeof options.filename !== 'string') { + throw new ERR_INVALID_ARG_TYPE('filename', + 'String', + options.filename); + } + config.filename = options.filename; + break; + case REPORTPATH: + if (typeof options.path !== 'string') + throw new ERR_INVALID_ARG_TYPE('path', 'String', options.path); + config.path = options.path; + break; + case REPORTVERBOSE: + if (typeof options.verbose !== 'string' && + typeof options.verbose !== 'boolean') { + throw new ERR_INVALID_ARG_TYPE('verbose', + 'Booelan | String' + + ' (true|false|yes|no)', + options.verbose); + } + config.verbose = options.verbose; + break; + } + }); + // Upload this new config to C++ land + nr.syncConfig(config, true); + }, - triggerReport(file, err) { - emitExperimentalWarning('report'); - if (err == null) { - if (file == null) { - return nr.triggerReport(new ERR_SYNTHETIC().stack); - } - if (typeof file !== 'string') - throw new ERR_INVALID_ARG_TYPE('file', 'String', file); - return nr.triggerReport(file, new ERR_SYNTHETIC().stack); + triggerReport(file, err) { + emitExperimentalWarning('report'); + if (err == null) { + if (file == null) { + return nr.triggerReport(new ERR_SYNTHETIC().stack); } - if (typeof err !== 'object') - throw new ERR_INVALID_ARG_TYPE('err', 'Object', err); - if (file == null) - return nr.triggerReport(err.stack); if (typeof file !== 'string') throw new ERR_INVALID_ARG_TYPE('file', 'String', file); - return nr.triggerReport(file, err.stack); - }, - getReport(err) { - emitExperimentalWarning('report'); - if (err == null) { - return nr.getReport(new ERR_SYNTHETIC().stack); - } else if (typeof err !== 'object') { - throw new ERR_INVALID_ARG_TYPE('err', 'Object', err); - } else { - return nr.getReport(err.stack); - } + return nr.triggerReport(file, new ERR_SYNTHETIC().stack); + } + if (typeof err !== 'object') + throw new ERR_INVALID_ARG_TYPE('err', 'Object', err); + if (file == null) + return nr.triggerReport(err.stack); + if (typeof file !== 'string') + throw new ERR_INVALID_ARG_TYPE('file', 'String', file); + return nr.triggerReport(file, err.stack); + }, + getReport(err) { + emitExperimentalWarning('report'); + if (err == null) { + return nr.getReport(new ERR_SYNTHETIC().stack); + } else if (typeof err !== 'object') { + throw new ERR_INVALID_ARG_TYPE('err', 'Object', err); + } else { + return nr.getReport(err.stack); } - }; - - // Download the CLI / ENV config into JS land. - nr.syncConfig(config, false); - - function handleSignal(signo) { - if (typeof signo !== 'string') - signo = config.signal; - nr.onUserSignal(signo); } +}; - if (config.events.includes('signal')) { - process.on(config.signal, handleSignal); - } +function handleSignal(signo) { + if (typeof signo !== 'string') + signo = config.signal; + nr.onUserSignal(signo); +} - function parseOptions(obj) { - const list = []; - if (obj == null) - return list; - if (obj.events != null) - list.push(REPORTEVENTS); - if (obj.signal != null) - list.push(REPORTSIGNAL); - if (obj.filename != null) - list.push(REPORTFILENAME); - if (obj.path != null) - list.push(REPORTPATH); - if (obj.verbose != null) - list.push(REPORTVERBOSE); +function parseOptions(obj) { + const list = []; + if (obj == null) return list; - } - process.report = report; + if (obj.events != null) + list.push(REPORTEVENTS); + if (obj.signal != null) + list.push(REPORTSIGNAL); + if (obj.filename != null) + list.push(REPORTFILENAME); + if (obj.path != null) + list.push(REPORTPATH); + if (obj.verbose != null) + list.push(REPORTVERBOSE); + return list; +} + +module.exports = { + config, + handleSignal, + report, + syncConfig: nr.syncConfig }; From fd6ce533aa8e0e0620cafa45a7a314de7fa9b87b Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 30 Jan 2019 19:45:31 +0100 Subject: [PATCH 165/223] src: remove main_isolate PR-URL: https://github.com/nodejs/node/pull/25823 Reviewed-By: Joyee Cheung Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis --- src/node.cc | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/node.cc b/src/node.cc index 8593daeefcfd35..98fb90d1a925c2 100644 --- a/src/node.cc +++ b/src/node.cc @@ -134,11 +134,6 @@ using v8::V8; using v8::Value; namespace per_process { -// TODO(joyeecheung): these are no longer necessary. Remove them. -// See: https://github.com/nodejs/node/pull/25302#discussion_r244924196 -// Isolate on the main thread -static Mutex main_isolate_mutex; -static Isolate* main_isolate; // node_revert.h // Bit flag used to track security reverts. @@ -855,12 +850,6 @@ inline int Start(uv_loop_t* event_loop, UNREACHABLE(); } - { - Mutex::ScopedLock scoped_lock(per_process::main_isolate_mutex); - CHECK_NULL(per_process::main_isolate); - per_process::main_isolate = isolate; - } - int exit_code; { Locker locker(isolate); @@ -881,12 +870,6 @@ inline int Start(uv_loop_t* event_loop, Start(isolate, isolate_data.get(), args, exec_args); } - { - Mutex::ScopedLock scoped_lock(per_process::main_isolate_mutex); - CHECK_EQ(per_process::main_isolate, isolate); - per_process::main_isolate = nullptr; - } - isolate->Dispose(); per_process::v8_platform.Platform()->UnregisterIsolate(isolate); From 01bb7b755927046b6b910cb82ea2887bc7363c35 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 1 Feb 2019 23:47:38 +0100 Subject: [PATCH 166/223] src: split ownsProcessState off isMainThread Embedders may want to control whether a Node.js instance controls the current process, similar to what we currently have with `Worker`s. Previously, the `isMainThread` flag had a bit of a double usage, both for indicating whether we are (not) running a Worker and whether we can modify per-process state. PR-URL: https://github.com/nodejs/node/pull/25881 Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: James M Snell --- lib/internal/bootstrap/node.js | 6 +++--- lib/internal/worker.js | 8 +++++--- lib/trace_events.js | 4 ++-- src/api/environment.cc | 8 ++++++-- src/env-inl.h | 8 ++++++++ src/env.cc | 2 +- src/env.h | 6 +++++- src/inspector/tracing_agent.cc | 2 +- src/inspector_agent.cc | 2 +- src/node.cc | 11 +++++++++-- src/node_credentials.cc | 10 +++++----- src/node_process_methods.cc | 12 ++++++------ src/node_process_object.cc | 32 ++++++++++++++++++-------------- src/node_worker.cc | 6 ++++++ 14 files changed, 76 insertions(+), 41 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index d0b57f136e7ff9..2859ebfa444a21 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -14,7 +14,7 @@ // This file is compiled as if it's wrapped in a function with arguments // passed by node::LoadEnvironment() -/* global process, loaderExports, isMainThread */ +/* global process, loaderExports, isMainThread, ownsProcessState */ const { internalBinding, NativeModule } = loaderExports; @@ -51,7 +51,7 @@ const perThreadSetup = NativeModule.require('internal/process/per_thread'); let mainThreadSetup; // Bootstrappers for the worker threads only let workerThreadSetup; -if (isMainThread) { +if (ownsProcessState) { mainThreadSetup = NativeModule.require( 'internal/process/main_thread_only' ); @@ -140,7 +140,7 @@ if (credentials.implementsPosixCredentials) { process.getegid = credentials.getegid; process.getgroups = credentials.getgroups; - if (isMainThread) { + if (ownsProcessState) { const wrapped = mainThreadSetup.wrapPosixCredentialSetters(credentials); process.initgroups = wrapped.initgroups; process.setgroups = wrapped.setgroups; diff --git a/lib/internal/worker.js b/lib/internal/worker.js index 083ef76184ec2e..6d833bcbd271fb 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -30,9 +30,10 @@ const { deserializeError } = require('internal/error-serdes'); const { pathToFileURL } = require('url'); const { - Worker: WorkerImpl, + ownsProcessState, + isMainThread, threadId, - isMainThread + Worker: WorkerImpl, } = internalBinding('worker'); const kHandle = Symbol('kHandle'); @@ -251,7 +252,8 @@ function pipeWithoutWarning(source, dest) { } module.exports = { + ownsProcessState, + isMainThread, threadId, Worker, - isMainThread }; diff --git a/lib/trace_events.js b/lib/trace_events.js index d2977679e168b8..41c4dbe741cd1d 100644 --- a/lib/trace_events.js +++ b/lib/trace_events.js @@ -13,8 +13,8 @@ const { ERR_INVALID_ARG_TYPE } = require('internal/errors').codes; -const { isMainThread } = require('internal/worker'); -if (!hasTracing || !isMainThread) +const { ownsProcessState } = require('internal/worker'); +if (!hasTracing || !ownsProcessState) throw new ERR_TRACE_EVENTS_UNAVAILABLE(); const { CategorySet, getEnabledCategories } = internalBinding('trace_events'); diff --git a/src/api/environment.cc b/src/api/environment.cc index 22938df37cc41d..2f4a35b975d1c1 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -134,8 +134,12 @@ Environment* CreateEnvironment(IsolateData* isolate_data, std::vector args(argv, argv + argc); std::vector exec_args(exec_argv, exec_argv + exec_argc); // TODO(addaleax): Provide more sensible flags, in an embedder-accessible way. - Environment* env = - new Environment(isolate_data, context, Environment::kIsMainThread); + Environment* env = new Environment( + isolate_data, + context, + static_cast(Environment::kIsMainThread | + Environment::kOwnsProcessState | + Environment::kOwnsInspector)); env->Start(per_process::v8_is_profiling); env->ProcessCliArgs(args, exec_args); return env; diff --git a/src/env-inl.h b/src/env-inl.h index 0a47b7cfcae345..748577a2545ee2 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -650,6 +650,14 @@ inline bool Environment::is_main_thread() const { return flags_ & kIsMainThread; } +inline bool Environment::owns_process_state() const { + return flags_ & kOwnsProcessState; +} + +inline bool Environment::owns_inspector() const { + return flags_ & kOwnsInspector; +} + inline uint64_t Environment::thread_id() const { return thread_id_; } diff --git a/src/env.cc b/src/env.cc index d6ffa93fd69e8b..2e0fa251b35350 100644 --- a/src/env.cc +++ b/src/env.cc @@ -142,7 +142,7 @@ void InitThreadLocalOnce() { } void Environment::TrackingTraceStateObserver::UpdateTraceCategoryState() { - if (!env_->is_main_thread()) { + if (!env_->owns_process_state()) { // Ideally, we’d have a consistent story that treats all threads/Environment // instances equally here. However, tracing is essentially global, and this // callback is called from whichever thread calls `StartTracing()` or diff --git a/src/env.h b/src/env.h index 51775ff1a00155..5560d292468128 100644 --- a/src/env.h +++ b/src/env.h @@ -597,7 +597,9 @@ class Environment { enum Flags { kNoFlags = 0, - kIsMainThread = 1 + kIsMainThread = 1 << 0, + kOwnsProcessState = 1 << 1, + kOwnsInspector = 1 << 2, }; static inline Environment* GetCurrent(v8::Isolate* isolate); @@ -766,6 +768,8 @@ class Environment { inline void set_has_run_bootstrapping_code(bool has_run_bootstrapping_code); inline bool is_main_thread() const; + inline bool owns_process_state() const; + inline bool owns_inspector() const; inline uint64_t thread_id() const; inline worker::Worker* worker_context() const; inline void set_worker_context(worker::Worker* context); diff --git a/src/inspector/tracing_agent.cc b/src/inspector/tracing_agent.cc index fb8467a1b9d3e0..09d213d8ae539f 100644 --- a/src/inspector/tracing_agent.cc +++ b/src/inspector/tracing_agent.cc @@ -141,7 +141,7 @@ DispatchResponse TracingAgent::start( return DispatchResponse::Error( "Call NodeTracing::end to stop tracing before updating the config"); } - if (!env_->is_main_thread()) { + if (!env_->owns_process_state()) { return DispatchResponse::Error( "Tracing properties can only be changed through main thread sessions"); } diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index fb85a54408e19c..f6255489fcbaf5 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -686,7 +686,7 @@ bool Agent::Start(const std::string& path, host_port_ = host_port; client_ = std::make_shared(parent_env_, is_main); - if (parent_env_->is_main_thread()) { + if (parent_env_->owns_inspector()) { CHECK_EQ(start_io_thread_async_initialized.exchange(true), false); CHECK_EQ(0, uv_async_init(parent_env_->event_loop(), &start_io_thread_async, diff --git a/src/node.cc b/src/node.cc index 98fb90d1a925c2..2942b33d8d5c18 100644 --- a/src/node.cc +++ b/src/node.cc @@ -318,16 +318,18 @@ MaybeLocal RunBootstrapping(Environment* env) { loader_exports_obj->Get(context, env->require_string()).ToLocalChecked(); env->set_native_module_require(require.As()); - // process, loaderExports, isMainThread + // process, loaderExports, isMainThread, ownsProcessState, primordials std::vector> node_params = { env->process_string(), FIXED_ONE_BYTE_STRING(isolate, "loaderExports"), FIXED_ONE_BYTE_STRING(isolate, "isMainThread"), + FIXED_ONE_BYTE_STRING(isolate, "ownsProcessState"), env->primordials_string()}; std::vector> node_args = { process, loader_exports_obj, Boolean::New(isolate, env->is_main_thread()), + Boolean::New(isolate, env->owns_process_state()), env->primordials()}; MaybeLocal result = ExecuteBootstrapper( @@ -756,7 +758,12 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, HandleScope handle_scope(isolate); Local context = NewContext(isolate); Context::Scope context_scope(context); - Environment env(isolate_data, context, Environment::kIsMainThread); + Environment env( + isolate_data, + context, + static_cast(Environment::kIsMainThread | + Environment::kOwnsProcessState | + Environment::kOwnsInspector)); env.Start(per_process::v8_is_profiling); env.ProcessCliArgs(args, exec_args); diff --git a/src/node_credentials.cc b/src/node_credentials.cc index 1fea2659f79bb9..8d38c38a0c5706 100644 --- a/src/node_credentials.cc +++ b/src/node_credentials.cc @@ -175,7 +175,7 @@ static void GetEGid(const FunctionCallbackInfo& args) { static void SetGid(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - CHECK(env->is_main_thread()); + CHECK(env->owns_process_state()); CHECK_EQ(args.Length(), 1); CHECK(args[0]->IsUint32() || args[0]->IsString()); @@ -194,7 +194,7 @@ static void SetGid(const FunctionCallbackInfo& args) { static void SetEGid(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - CHECK(env->is_main_thread()); + CHECK(env->owns_process_state()); CHECK_EQ(args.Length(), 1); CHECK(args[0]->IsUint32() || args[0]->IsString()); @@ -213,7 +213,7 @@ static void SetEGid(const FunctionCallbackInfo& args) { static void SetUid(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - CHECK(env->is_main_thread()); + CHECK(env->owns_process_state()); CHECK_EQ(args.Length(), 1); CHECK(args[0]->IsUint32() || args[0]->IsString()); @@ -232,7 +232,7 @@ static void SetUid(const FunctionCallbackInfo& args) { static void SetEUid(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - CHECK(env->is_main_thread()); + CHECK(env->owns_process_state()); CHECK_EQ(args.Length(), 1); CHECK(args[0]->IsUint32() || args[0]->IsString()); @@ -363,7 +363,7 @@ static void Initialize(Local target, env->SetMethodNoSideEffect(target, "getegid", GetEGid); env->SetMethodNoSideEffect(target, "getgroups", GetGroups); - if (env->is_main_thread()) { + if (env->owns_process_state()) { env->SetMethod(target, "initgroups", InitGroups); env->SetMethod(target, "setegid", SetEGid); env->SetMethod(target, "seteuid", SetEUid); diff --git a/src/node_process_methods.cc b/src/node_process_methods.cc index 51758f05f6bc87..a6d2c252e77ac5 100644 --- a/src/node_process_methods.cc +++ b/src/node_process_methods.cc @@ -72,7 +72,7 @@ static void Abort(const FunctionCallbackInfo& args) { static void Chdir(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - CHECK(env->is_main_thread()); + CHECK(env->owns_process_state()); CHECK_EQ(args.Length(), 1); CHECK(args[0]->IsString()); @@ -392,17 +392,17 @@ static void InitializeProcessMethods(Local target, Environment* env = Environment::GetCurrent(context); // define various internal methods - if (env->is_main_thread()) { + if (env->owns_process_state()) { env->SetMethod(target, "_debugProcess", DebugProcess); env->SetMethod(target, "_debugEnd", DebugEnd); - env->SetMethod( - target, "_startProfilerIdleNotifier", StartProfilerIdleNotifier); - env->SetMethod( - target, "_stopProfilerIdleNotifier", StopProfilerIdleNotifier); env->SetMethod(target, "abort", Abort); env->SetMethod(target, "chdir", Chdir); } + env->SetMethod( + target, "_startProfilerIdleNotifier", StartProfilerIdleNotifier); + env->SetMethod(target, "_stopProfilerIdleNotifier", StopProfilerIdleNotifier); + env->SetMethod(target, "umask", Umask); env->SetMethod(target, "_rawDebug", RawDebug); env->SetMethod(target, "memoryUsage", MemoryUsage); diff --git a/src/node_process_object.cc b/src/node_process_object.cc index c1f8806110ffef..a95677686ec904 100644 --- a/src/node_process_object.cc +++ b/src/node_process_object.cc @@ -86,15 +86,17 @@ MaybeLocal CreateProcessObject( // process.title auto title_string = FIXED_ONE_BYTE_STRING(env->isolate(), "title"); - CHECK(process->SetAccessor( - env->context(), - title_string, - ProcessTitleGetter, - env->is_main_thread() ? ProcessTitleSetter : nullptr, - env->as_external(), - DEFAULT, - None, - SideEffectType::kHasNoSideEffect).FromJust()); + CHECK(process + ->SetAccessor( + env->context(), + title_string, + ProcessTitleGetter, + env->owns_process_state() ? ProcessTitleSetter : nullptr, + env->as_external(), + DEFAULT, + None, + SideEffectType::kHasNoSideEffect) + .FromJust()); // process.version READONLY_PROPERTY(process, @@ -302,11 +304,13 @@ MaybeLocal CreateProcessObject( // process.debugPort auto debug_port_string = FIXED_ONE_BYTE_STRING(env->isolate(), "debugPort"); - CHECK(process->SetAccessor(env->context(), - debug_port_string, - DebugPortGetter, - env->is_main_thread() ? DebugPortSetter : nullptr, - env->as_external()).FromJust()); + CHECK(process + ->SetAccessor(env->context(), + debug_port_string, + DebugPortGetter, + env->owns_process_state() ? DebugPortSetter : nullptr, + env->as_external()) + .FromJust()); // process._rawDebug: may be overwritten later in JS land, but should be // availbale from the begining for debugging purposes diff --git a/src/node_worker.cc b/src/node_worker.cc index d457ab0c3e1ff2..2d960f6e4defef 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -569,6 +569,12 @@ void InitWorker(Local target, FIXED_ONE_BYTE_STRING(env->isolate(), "isMainThread"), Boolean::New(env->isolate(), env->is_main_thread())) .FromJust(); + + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "ownsProcessState"), + Boolean::New(env->isolate(), env->owns_process_state())) + .FromJust(); } } // anonymous namespace From d7ed125fd167dad6afc64e05b0bf6a5fee2a35b9 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Tue, 15 Jan 2019 14:12:57 -0500 Subject: [PATCH 167/223] process: stub unsupported worker methods Some process methods are not supported in workers. This commit adds stubs that throw more informative errors. PR-URL: https://github.com/nodejs/node/pull/25587 Fixes: https://github.com/nodejs/node/issues/25448 Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann Reviewed-By: Franziska Hinkelmann Reviewed-By: James M Snell --- lib/internal/bootstrap/node.js | 30 ++++++++++++++-- lib/internal/process/worker_thread_only.js | 10 ++++++ test/parallel/test-process-euid-egid.js | 11 +++--- test/parallel/test-process-initgroups.js | 5 ++- test/parallel/test-process-setgroups.js | 5 ++- test/parallel/test-process-uid-gid.js | 13 +++---- .../test-worker-unsupported-things.js | 34 +++++++++++++------ 7 files changed, 83 insertions(+), 25 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 2859ebfa444a21..701037cb942ff8 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -84,6 +84,8 @@ if (isMainThread) { } else { const wrapped = workerThreadSetup.wrapProcessMethods(rawMethods); + process.abort = workerThreadSetup.unavailable('process.abort()'); + process.chdir = workerThreadSetup.unavailable('process.chdir()'); process.umask = wrapped.umask; } @@ -148,6 +150,14 @@ if (credentials.implementsPosixCredentials) { process.seteuid = wrapped.seteuid; process.setgid = wrapped.setgid; process.setuid = wrapped.setuid; + } else { + process.initgroups = + workerThreadSetup.unavailable('process.initgroups()'); + process.setgroups = workerThreadSetup.unavailable('process.setgroups()'); + process.setegid = workerThreadSetup.unavailable('process.setegid()'); + process.seteuid = workerThreadSetup.unavailable('process.seteuid()'); + process.setgid = workerThreadSetup.unavailable('process.setgid()'); + process.setuid = workerThreadSetup.unavailable('process.setuid()'); } } @@ -174,8 +184,24 @@ if (config.hasInspector) { // This attaches some internal event listeners and creates: // process.send(), process.channel, process.connected, // process.disconnect() -if (isMainThread && process.env.NODE_CHANNEL_FD) { - mainThreadSetup.setupChildProcessIpcChannel(); +if (process.env.NODE_CHANNEL_FD) { + if (ownsProcessState) { + mainThreadSetup.setupChildProcessIpcChannel(); + } else { + Object.defineProperty(process, 'channel', { + enumerable: false, + get: workerThreadSetup.unavailable('process.channel') + }); + + Object.defineProperty(process, 'connected', { + enumerable: false, + get: workerThreadSetup.unavailable('process.connected') + }); + + process.send = workerThreadSetup.unavailable('process.send()'); + process.disconnect = + workerThreadSetup.unavailable('process.disconnect()'); + } } const browserGlobals = !process._noBrowserGlobals; diff --git a/lib/internal/process/worker_thread_only.js b/lib/internal/process/worker_thread_only.js index f05d5e932bebf2..2cc52cbf01b8cd 100644 --- a/lib/internal/process/worker_thread_only.js +++ b/lib/internal/process/worker_thread_only.js @@ -45,7 +45,17 @@ function wrapProcessMethods(binding) { return { umask }; } +function unavailable(name) { + function unavailableInWorker() { + throw new ERR_WORKER_UNSUPPORTED_OPERATION(name); + } + + unavailableInWorker.disabled = true; + return unavailableInWorker; +} + module.exports = { initializeWorkerStdio, + unavailable, wrapProcessMethods }; diff --git a/test/parallel/test-process-euid-egid.js b/test/parallel/test-process-euid-egid.js index 5639163bf31c13..b9e0630dab5eca 100644 --- a/test/parallel/test-process-euid-egid.js +++ b/test/parallel/test-process-euid-egid.js @@ -3,16 +3,17 @@ const common = require('../common'); const assert = require('assert'); -if (common.isWindows || !common.isMainThread) { - if (common.isMainThread) { - assert.strictEqual(process.geteuid, undefined); - assert.strictEqual(process.getegid, undefined); - } +if (common.isWindows) { + assert.strictEqual(process.geteuid, undefined); + assert.strictEqual(process.getegid, undefined); assert.strictEqual(process.seteuid, undefined); assert.strictEqual(process.setegid, undefined); return; } +if (!common.isMainThread) + return; + assert.throws(() => { process.seteuid({}); }, { diff --git a/test/parallel/test-process-initgroups.js b/test/parallel/test-process-initgroups.js index 49b8833f61a7bc..f5e839b1d242af 100644 --- a/test/parallel/test-process-initgroups.js +++ b/test/parallel/test-process-initgroups.js @@ -2,11 +2,14 @@ const common = require('../common'); const assert = require('assert'); -if (common.isWindows || !common.isMainThread) { +if (common.isWindows) { assert.strictEqual(process.initgroups, undefined); return; } +if (!common.isMainThread) + return; + [undefined, null, true, {}, [], () => {}].forEach((val) => { assert.throws( () => { diff --git a/test/parallel/test-process-setgroups.js b/test/parallel/test-process-setgroups.js index a85d6683164a26..74de3e7a2562e7 100644 --- a/test/parallel/test-process-setgroups.js +++ b/test/parallel/test-process-setgroups.js @@ -2,11 +2,14 @@ const common = require('../common'); const assert = require('assert'); -if (common.isWindows || !common.isMainThread) { +if (common.isWindows) { assert.strictEqual(process.setgroups, undefined); return; } +if (!common.isMainThread) + return; + assert.throws( () => { process.setgroups(); diff --git a/test/parallel/test-process-uid-gid.js b/test/parallel/test-process-uid-gid.js index 456cba7f4dc027..49086792b9e7b1 100644 --- a/test/parallel/test-process-uid-gid.js +++ b/test/parallel/test-process-uid-gid.js @@ -24,17 +24,18 @@ const common = require('../common'); const assert = require('assert'); -if (common.isWindows || !common.isMainThread) { - // uid/gid functions are POSIX only, setters are main-thread only. - if (common.isMainThread) { - assert.strictEqual(process.getuid, undefined); - assert.strictEqual(process.getgid, undefined); - } +if (common.isWindows) { + // uid/gid functions are POSIX only. + assert.strictEqual(process.getuid, undefined); + assert.strictEqual(process.getgid, undefined); assert.strictEqual(process.setuid, undefined); assert.strictEqual(process.setgid, undefined); return; } +if (!common.isMainThread) + return; + assert.throws(() => { process.setuid({}); }, { diff --git a/test/parallel/test-worker-unsupported-things.js b/test/parallel/test-worker-unsupported-things.js index 66b10ad1577d2c..cc9eec4af67760 100644 --- a/test/parallel/test-worker-unsupported-things.js +++ b/test/parallel/test-worker-unsupported-things.js @@ -1,9 +1,12 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const { Worker, isMainThread, parentPort } = require('worker_threads'); +const { Worker, parentPort } = require('worker_threads'); -if (isMainThread) { +// Do not use isMainThread so that this test itself can be run inside a Worker. +if (!process.env.HAS_STARTED_WORKER) { + process.env.HAS_STARTED_WORKER = 1; + process.env.NODE_CHANNEL_FD = 'foo'; // Make worker think it has IPC. const w = new Worker(__filename); w.on('message', common.mustCall((message) => { assert.strictEqual(message, true); @@ -21,14 +24,25 @@ if (isMainThread) { assert.strictEqual(process.debugPort, before); } - assert.strictEqual('abort' in process, false); - assert.strictEqual('chdir' in process, false); - assert.strictEqual('setuid' in process, false); - assert.strictEqual('seteuid' in process, false); - assert.strictEqual('setgid' in process, false); - assert.strictEqual('setegid' in process, false); - assert.strictEqual('setgroups' in process, false); - assert.strictEqual('initgroups' in process, false); + const stubs = ['abort', 'chdir', 'send', 'disconnect']; + + if (!common.isWindows) { + stubs.push('setuid', 'seteuid', 'setgid', + 'setegid', 'setgroups', 'initgroups'); + } + + stubs.forEach((fn) => { + assert.strictEqual(process[fn].disabled, true); + assert.throws(() => { + process[fn](); + }, { code: 'ERR_WORKER_UNSUPPORTED_OPERATION' }); + }); + + ['channel', 'connected'].forEach((fn) => { + assert.throws(() => { + process[fn]; + }, { code: 'ERR_WORKER_UNSUPPORTED_OPERATION' }); + }); assert.strictEqual('_startProfilerIdleNotifier' in process, false); assert.strictEqual('_stopProfilerIdleNotifier' in process, false); From c47eb932bcb9af521b13323f5441afb94ef562de Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 1 Feb 2019 08:00:23 +0800 Subject: [PATCH 168/223] src: move process.reallyExit impl into node_process_methods.cc Because the part that is shared by `process.reallyExit` and the Node.js teardown is `WaitForInspectorDisconnect()`, move that into node_internals.h instead, and move the C++ binding code into `node_process_methods.cc` since that's the only place it's needed. PR-URL: https://github.com/nodejs/node/pull/25860 Reviewed-By: Anna Henningsen Reviewed-By: Minwoo Jung Reviewed-By: Jeremiah Senkpiel --- src/node.cc | 10 +--------- src/node_internals.h | 2 +- src/node_process_methods.cc | 9 ++++++++- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/node.cc b/src/node.cc index 2942b33d8d5c18..a0409b2519516f 100644 --- a/src/node.cc +++ b/src/node.cc @@ -118,7 +118,6 @@ using v8::Exception; using v8::Function; using v8::FunctionCallbackInfo; using v8::HandleScope; -using v8::Int32; using v8::Isolate; using v8::Just; using v8::Local; @@ -158,7 +157,7 @@ struct V8Platform v8_platform; static const unsigned kMaxSignal = 32; #endif -static void WaitForInspectorDisconnect(Environment* env) { +void WaitForInspectorDisconnect(Environment* env) { #if HAVE_INSPECTOR if (env->inspector_agent()->IsActive()) { // Restore signal dispositions, the app is done and is no longer @@ -178,13 +177,6 @@ static void WaitForInspectorDisconnect(Environment* env) { #endif } -void Exit(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args); - WaitForInspectorDisconnect(env); - int code = args[0]->Int32Value(env->context()).FromMaybe(0); - env->Exit(code); -} - void SignalExit(int signo) { uv_tty_reset_mode(); #ifdef __FreeBSD__ diff --git a/src/node_internals.h b/src/node_internals.h index b34e6f90e7d28c..c94be6ebe9155d 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -86,7 +86,7 @@ void GetSockOrPeerName(const v8::FunctionCallbackInfo& args) { args.GetReturnValue().Set(err); } -void Exit(const v8::FunctionCallbackInfo& args); +void WaitForInspectorDisconnect(Environment* env); void SignalExit(int signo); #ifdef __POSIX__ void RegisterSignalHandler(int signal, diff --git a/src/node_process_methods.cc b/src/node_process_methods.cc index a6d2c252e77ac5..be91a11f566baa 100644 --- a/src/node_process_methods.cc +++ b/src/node_process_methods.cc @@ -385,6 +385,13 @@ static void DebugEnd(const FunctionCallbackInfo& args) { #endif } +static void ReallyExit(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + WaitForInspectorDisconnect(env); + int code = args[0]->Int32Value(env->context()).FromMaybe(0); + env->Exit(code); +} + static void InitializeProcessMethods(Local target, Local unused, Local context, @@ -416,7 +423,7 @@ static void InitializeProcessMethods(Local target, env->SetMethodNoSideEffect(target, "cwd", Cwd); env->SetMethod(target, "dlopen", binding::DLOpen); - env->SetMethod(target, "reallyExit", Exit); + env->SetMethod(target, "reallyExit", ReallyExit); env->SetMethodNoSideEffect(target, "uptime", Uptime); } From 5de103430fc6845fd6c7ac499331c25926e3c647 Mon Sep 17 00:00:00 2001 From: ZYSzys <17367077526@163.com> Date: Mon, 4 Feb 2019 15:38:51 +0800 Subject: [PATCH 169/223] src: use NULL check macros to check nullptr PR-URL: https://github.com/nodejs/node/pull/25916 Refs: https://github.com/nodejs/node/pull/20914 Reviewed-By: Masashi Hirano Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Richard Lau --- src/async_wrap.cc | 2 +- src/env-inl.h | 2 +- src/inspector/main_thread_interface.cc | 4 ++-- src/inspector_agent.cc | 2 +- src/inspector_socket_server.cc | 2 +- src/node.cc | 2 +- src/node_api.cc | 14 +++++++------- src/node_crypto.cc | 2 +- src/node_http2.cc | 2 +- src/node_http_parser_impl.h | 2 +- src/node_messaging.cc | 6 +++--- src/node_native_module.cc | 2 +- src/node_platform.cc | 4 ++-- src/node_union_bytes.h | 8 ++++---- src/node_worker.cc | 12 ++++++------ src/sharedarraybuffer_metadata.cc | 2 +- 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 4550312abd1b02..4c8647604ae1df 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -210,7 +210,7 @@ PromiseWrap* PromiseWrap::New(Environment* env, obj->SetInternalField(PromiseWrap::kIsChainedPromiseField, parent_wrap != nullptr ? v8::True(env->isolate()) : v8::False(env->isolate())); - CHECK_EQ(promise->GetAlignedPointerFromInternalField(0), nullptr); + CHECK_NULL(promise->GetAlignedPointerFromInternalField(0)); promise->SetInternalField(0, obj); return new PromiseWrap(env, obj, silent); } diff --git a/src/env-inl.h b/src/env-inl.h index 748577a2545ee2..60dafc04e16516 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -667,7 +667,7 @@ inline worker::Worker* Environment::worker_context() const { } inline void Environment::set_worker_context(worker::Worker* context) { - CHECK_EQ(worker_context_, nullptr); // Should be set only once. + CHECK_NULL(worker_context_); // Should be set only once. worker_context_ = context; } diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc index 15ffb49d74d1d4..1bcf65134fb48a 100644 --- a/src/inspector/main_thread_interface.cc +++ b/src/inspector/main_thread_interface.cc @@ -307,7 +307,7 @@ std::shared_ptr MainThreadInterface::GetHandle() { void MainThreadInterface::AddObject(int id, std::unique_ptr object) { - CHECK_NE(nullptr, object); + CHECK_NOT_NULL(object); managed_objects_[id] = std::move(object); } @@ -319,7 +319,7 @@ Deletable* MainThreadInterface::GetObject(int id) { Deletable* pointer = GetObjectIfExists(id); // This would mean the object is requested after it was disposed, which is // a coding error. - CHECK_NE(nullptr, pointer); + CHECK_NOT_NULL(pointer); return pointer; } diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index f6255489fcbaf5..272f1a986da71f 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -682,7 +682,7 @@ bool Agent::Start(const std::string& path, bool is_main) { path_ = path; debug_options_ = options; - CHECK_NE(host_port, nullptr); + CHECK_NOT_NULL(host_port); host_port_ = host_port; client_ = std::make_shared(parent_env_, is_main); diff --git a/src/inspector_socket_server.cc b/src/inspector_socket_server.cc index 1621b408b43274..5e77ff5b3f403a 100644 --- a/src/inspector_socket_server.cc +++ b/src/inspector_socket_server.cc @@ -352,7 +352,7 @@ std::string InspectorSocketServer::GetFrontendURL(bool is_compat, } bool InspectorSocketServer::Start() { - CHECK_NE(delegate_, nullptr); + CHECK_NOT_NULL(delegate_); CHECK_EQ(state_, ServerState::kNew); std::unique_ptr delegate_holder; // We will return it if startup is successful diff --git a/src/node.cc b/src/node.cc index a0409b2519516f..f815f7285d19be 100644 --- a/src/node.cc +++ b/src/node.cc @@ -340,7 +340,7 @@ void MarkBootstrapComplete(const FunctionCallbackInfo& args) { MaybeLocal StartExecution(Environment* env, const char* main_script_id) { EscapableHandleScope scope(env->isolate()); - CHECK_NE(main_script_id, nullptr); + CHECK_NOT_NULL(main_script_id); std::vector> parameters = { env->process_string(), diff --git a/src/node_api.cc b/src/node_api.cc index 7d843c08f5a69d..ff2e12f571a0f3 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -1043,8 +1043,8 @@ napi_create_threadsafe_function(napi_env env, napi_status napi_get_threadsafe_function_context(napi_threadsafe_function func, void** result) { - CHECK(func != nullptr); - CHECK(result != nullptr); + CHECK_NOT_NULL(func); + CHECK_NOT_NULL(result); *result = reinterpret_cast(func)->Context(); return napi_ok; @@ -1054,32 +1054,32 @@ napi_status napi_call_threadsafe_function(napi_threadsafe_function func, void* data, napi_threadsafe_function_call_mode is_blocking) { - CHECK(func != nullptr); + CHECK_NOT_NULL(func); return reinterpret_cast(func)->Push(data, is_blocking); } napi_status napi_acquire_threadsafe_function(napi_threadsafe_function func) { - CHECK(func != nullptr); + CHECK_NOT_NULL(func); return reinterpret_cast(func)->Acquire(); } napi_status napi_release_threadsafe_function(napi_threadsafe_function func, napi_threadsafe_function_release_mode mode) { - CHECK(func != nullptr); + CHECK_NOT_NULL(func); return reinterpret_cast(func)->Release(mode); } napi_status napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func) { - CHECK(func != nullptr); + CHECK_NOT_NULL(func); return reinterpret_cast(func)->Unref(); } napi_status napi_ref_threadsafe_function(napi_env env, napi_threadsafe_function func) { - CHECK(func != nullptr); + CHECK_NOT_NULL(func); return reinterpret_cast(func)->Ref(); } diff --git a/src/node_crypto.cc b/src/node_crypto.cc index be40b91feb9286..bab55a738f3208 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -5383,7 +5383,7 @@ void CryptoJob::AfterThreadPoolWork(int status) { void CryptoJob::Run(std::unique_ptr job, Local wrap) { CHECK(wrap->IsObject()); - CHECK_EQ(nullptr, job->async_wrap); + CHECK_NULL(job->async_wrap); job->async_wrap.reset(Unwrap(wrap.As())); CHECK_EQ(false, job->async_wrap->persistent().IsWeak()); job->ScheduleWork(); diff --git a/src/node_http2.cc b/src/node_http2.cc index 0d349df060a5b4..f549cafd8c4245 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -521,7 +521,7 @@ class Http2Session::MemoryAllocatorInfo { static void H2Free(void* ptr, void* user_data) { if (ptr == nullptr) return; // free(null); happens quite often. void* result = H2Realloc(ptr, 0, user_data); - CHECK_EQ(result, nullptr); + CHECK_NULL(result); } static void* H2Realloc(void* ptr, size_t size, void* user_data) { diff --git a/src/node_http_parser_impl.h b/src/node_http_parser_impl.h index 7a955cc1e9eca6..7d5ea347202c59 100644 --- a/src/node_http_parser_impl.h +++ b/src/node_http_parser_impl.h @@ -744,7 +744,7 @@ class Parser : public AsyncWrap, public StreamListener { Local reason; if (err == HPE_USER) { const char* colon = strchr(errno_reason, ':'); - CHECK_NE(colon, nullptr); + CHECK_NOT_NULL(colon); code = OneByteString(env()->isolate(), errno_reason, colon - errno_reason); reason = OneByteString(env()->isolate(), colon + 1); diff --git a/src/node_messaging.cc b/src/node_messaging.cc index 9952043f7b4c34..896f43cd23d372 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -376,7 +376,7 @@ void Message::MemoryInfo(MemoryTracker* tracker) const { MessagePortData::MessagePortData(MessagePort* owner) : owner_(owner) { } MessagePortData::~MessagePortData() { - CHECK_EQ(owner_, nullptr); + CHECK_NULL(owner_); Disentangle(); } @@ -402,8 +402,8 @@ bool MessagePortData::IsSiblingClosed() const { } void MessagePortData::Entangle(MessagePortData* a, MessagePortData* b) { - CHECK_EQ(a->sibling_, nullptr); - CHECK_EQ(b->sibling_, nullptr); + CHECK_NULL(a->sibling_); + CHECK_NULL(b->sibling_); a->sibling_ = b; b->sibling_ = a; a->sibling_mutex_ = b->sibling_mutex_; diff --git a/src/node_native_module.cc b/src/node_native_module.cc index 662aad31d5d159..2d3769ebf5c949 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -270,7 +270,7 @@ MaybeLocal NativeModuleLoader::LookupAndCompile( // Generate new cache for next compilation std::unique_ptr new_cached_data( ScriptCompiler::CreateCodeCacheForFunction(fun)); - CHECK_NE(new_cached_data, nullptr); + CHECK_NOT_NULL(new_cached_data); // The old entry should've been erased by now so we can just emplace code_cache_.emplace(id, std::move(new_cached_data)); diff --git a/src/node_platform.cc b/src/node_platform.cc index f591a074a530da..139e2ebfc1f5ec 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -241,14 +241,14 @@ void PerIsolatePlatformData::PostIdleTask(std::unique_ptr task) { } void PerIsolatePlatformData::PostTask(std::unique_ptr task) { - CHECK_NE(flush_tasks_, nullptr); + CHECK_NOT_NULL(flush_tasks_); foreground_tasks_.Push(std::move(task)); uv_async_send(flush_tasks_); } void PerIsolatePlatformData::PostDelayedTask( std::unique_ptr task, double delay_in_seconds) { - CHECK_NE(flush_tasks_, nullptr); + CHECK_NOT_NULL(flush_tasks_); std::unique_ptr delayed(new DelayedTask()); delayed->task = std::move(task); delayed->platform_data = shared_from_this(); diff --git a/src/node_union_bytes.h b/src/node_union_bytes.h index 66d8509beaf188..33fada73039e2c 100644 --- a/src/node_union_bytes.h +++ b/src/node_union_bytes.h @@ -64,22 +64,22 @@ class UnionBytes { bool is_one_byte() const { return is_one_byte_; } const uint16_t* two_bytes_data() const { CHECK(!is_one_byte_); - CHECK_NE(two_bytes_, nullptr); + CHECK_NOT_NULL(two_bytes_); return two_bytes_; } const uint8_t* one_bytes_data() const { CHECK(is_one_byte_); - CHECK_NE(one_bytes_, nullptr); + CHECK_NOT_NULL(one_bytes_); return one_bytes_; } v8::Local ToStringChecked(v8::Isolate* isolate) const { if (is_one_byte_) { - CHECK_NE(one_bytes_, nullptr); + CHECK_NOT_NULL(one_bytes_); NonOwningExternalOneByteResource* source = new NonOwningExternalOneByteResource(one_bytes_, length_); return v8::String::NewExternalOneByte(isolate, source).ToLocalChecked(); } else { - CHECK_NE(two_bytes_, nullptr); + CHECK_NOT_NULL(two_bytes_); NonOwningExternalTwoByteResource* source = new NonOwningExternalTwoByteResource(two_bytes_, length_); return v8::String::NewExternalTwoByte(isolate, source).ToLocalChecked(); diff --git a/src/node_worker.cc b/src/node_worker.cc index 2d960f6e4defef..3fd19de97ce3de 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -92,7 +92,7 @@ Worker::Worker(Environment* env, CHECK_EQ(uv_loop_init(&loop_), 0); isolate_ = NewIsolate(array_buffer_allocator_.get(), &loop_); - CHECK_NE(isolate_, nullptr); + CHECK_NOT_NULL(isolate_); { // Enter an environment capable of executing code in the child Isolate @@ -115,7 +115,7 @@ Worker::Worker(Environment* env, // TODO(addaleax): Use CreateEnvironment(), or generally another public API. env_.reset(new Environment(isolate_data_.get(), context)); - CHECK_NE(env_, nullptr); + CHECK_NOT_NULL(env_); env_->set_abort_on_uncaught_exception(false); env_->set_worker_context(this); thread_id_ = env_->thread_id(); @@ -153,7 +153,7 @@ void Worker::Run() { "__metadata", "thread_name", "name", TRACE_STR_COPY(name.c_str())); MultiIsolatePlatform* platform = isolate_data_->platform(); - CHECK_NE(platform, nullptr); + CHECK_NOT_NULL(platform); Debug(this, "Starting worker with id %llu", thread_id_); { @@ -339,7 +339,7 @@ void Worker::OnThreadStopped() { CHECK(stopped_); } - CHECK_EQ(child_port_, nullptr); + CHECK_NULL(child_port_); parent_port_ = nullptr; } @@ -369,7 +369,7 @@ Worker::~Worker() { CHECK(stopped_); CHECK(thread_joined_); - CHECK_EQ(child_port_, nullptr); + CHECK_NULL(child_port_); // This has most likely already happened within the worker thread -- this // is just in case Worker creation failed early. @@ -509,7 +509,7 @@ void Worker::Exit(int code) { Debug(this, "Worker %llu called Exit(%d)", thread_id_, code); if (!stopped_) { - CHECK_NE(env_, nullptr); + CHECK_NOT_NULL(env_); stopped_ = true; exit_code_ = code; if (child_port_ != nullptr) diff --git a/src/sharedarraybuffer_metadata.cc b/src/sharedarraybuffer_metadata.cc index 671ad6d6820440..4e6f5a349d1d57 100644 --- a/src/sharedarraybuffer_metadata.cc +++ b/src/sharedarraybuffer_metadata.cc @@ -75,7 +75,7 @@ SharedArrayBufferMetadata::ForSharedArrayBuffer( CHECK(source->IsExternal()); SABLifetimePartner* partner = Unwrap(lifetime_partner.As()); - CHECK_NE(partner, nullptr); + CHECK_NOT_NULL(partner); return partner->reference; } From 8ade433f5164ec60607c293e24237c899ca74ea6 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 1 Feb 2019 06:40:57 +0800 Subject: [PATCH 170/223] lib: move signal event handling into bootstrap/node.js Moves the `process.on()` and `promise.emit()` calls happened during bootstrap for signal events into `bootstrap/node.js` so it's easier to tell the side effects. Drive-by changes: - Moves the signal event re-arming to a point later during the bootstrap - as early as it were it's unlikely that there could be any existing signal events to re-arm for node-report. - Use a Map instead of an Object for signal wraps since it is used as a deletable dictionary anyway. PR-URL: https://github.com/nodejs/node/pull/25859 Reviewed-By: Anna Henningsen --- lib/internal/bootstrap/node.js | 20 +++++++-- lib/internal/process/main_thread_only.js | 53 ++++++++++++------------ 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 701037cb942ff8..7a59b4f369bf54 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -67,9 +67,6 @@ process.config = JSON.parse(internalBinding('native_module').config); const rawMethods = internalBinding('process_methods'); // Set up methods and events on the process object for the main thread if (isMainThread) { - // This depends on process being an event emitter - mainThreadSetup.setupSignalHandlers(internalBinding); - process.abort = rawMethods.abort; const wrapped = mainThreadSetup.wrapProcessMethods(rawMethods); process.umask = wrapped.umask; @@ -358,6 +355,23 @@ if (process.env.NODE_V8_COVERAGE) { }; } +// Worker threads don't receive signals. +if (isMainThread) { + const { + isSignal, + startListeningIfSignal, + stopListeningIfSignal + } = mainThreadSetup.createSignalHandlers(); + process.on('newListener', startListeningIfSignal); + process.on('removeListener', stopListeningIfSignal); + // re-arm pre-existing signal event registrations + // with this signal wrap capabilities. + const signalEvents = process.eventNames().filter(isSignal); + for (const ev of signalEvents) { + process.emit('newListener', ev); + } +} + if (getOptionValue('--experimental-report')) { const { config, diff --git a/lib/internal/process/main_thread_only.js b/lib/internal/process/main_thread_only.js index 42579e9da8acd1..290d2f7e9e2eb8 100644 --- a/lib/internal/process/main_thread_only.js +++ b/lib/internal/process/main_thread_only.js @@ -16,6 +16,8 @@ const { validateString } = require('internal/validators'); +const { signals } = internalBinding('constants').os; + // The execution of this function itself should not cause any side effects. function wrapProcessMethods(binding) { function chdir(directory) { @@ -104,19 +106,18 @@ function wrapPosixCredentialSetters(credentials) { }; } -// Worker threads don't receive signals. -function setupSignalHandlers(internalBinding) { - const constants = internalBinding('constants').os.signals; - const signalWraps = Object.create(null); - let Signal; +let Signal; +function isSignal(event) { + return typeof event === 'string' && signals[event] !== undefined; +} - function isSignal(event) { - return typeof event === 'string' && constants[event] !== undefined; - } +// Worker threads don't receive signals. +function createSignalHandlers() { + const signalWraps = new Map(); // Detect presence of a listener for the special signal types - process.on('newListener', function(type) { - if (isSignal(type) && signalWraps[type] === undefined) { + function startListeningIfSignal(type) { + if (isSignal(type) && !signalWraps.has(type)) { if (Signal === undefined) Signal = internalBinding('signal_wrap').Signal; const wrap = new Signal(); @@ -125,30 +126,30 @@ function setupSignalHandlers(internalBinding) { wrap.onsignal = process.emit.bind(process, type, type); - const signum = constants[type]; + const signum = signals[type]; const err = wrap.start(signum); if (err) { wrap.close(); throw errnoException(err, 'uv_signal_start'); } - signalWraps[type] = wrap; + signalWraps.set(type, wrap); } - }); + } - process.on('removeListener', function(type) { - if (signalWraps[type] !== undefined && this.listenerCount(type) === 0) { - signalWraps[type].close(); - delete signalWraps[type]; + function stopListeningIfSignal(type) { + const wrap = signalWraps.get(type); + if (wrap !== undefined && process.listenerCount(type) === 0) { + wrap.close(); + signalWraps.delete(type); } - }); - - // re-arm pre-existing signal event registrations - // with this signal wrap capabilities. - process.eventNames().forEach((ev) => { - if (isSignal(ev)) - process.emit('newListener', ev); - }); + } + + return { + isSignal, + startListeningIfSignal, + stopListeningIfSignal + }; } function setupChildProcessIpcChannel() { @@ -166,7 +167,7 @@ function setupChildProcessIpcChannel() { module.exports = { wrapProcessMethods, - setupSignalHandlers, + createSignalHandlers, setupChildProcessIpcChannel, wrapPosixCredentialSetters }; From f40e0fcdcb77ad072cf9ce394bb4bad99cc5f359 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 5 Feb 2019 21:45:46 -0800 Subject: [PATCH 171/223] lib: replace 'assert' with 'internal/assert' for many built-ins Replace large 'assert' module with tiny 'internal/assert' module for many built-in uses. PR-URL: https://github.com/nodejs/node/pull/25956 Reviewed-By: Ruben Bridgewater Reviewed-By: Minwoo Jung --- lib/_http_client.js | 2 +- lib/_http_outgoing.js | 2 +- lib/_http_server.js | 2 +- lib/_tls_wrap.js | 2 +- lib/internal/child_process.js | 2 +- lib/internal/cluster/child.js | 2 +- lib/internal/cluster/master.js | 2 +- lib/internal/cluster/shared_handle.js | 2 +- lib/internal/crypto/cipher.js | 2 +- lib/internal/errors.js | 2 +- lib/internal/fs/watchers.js | 2 +- lib/internal/http2/compat.js | 2 +- lib/internal/modules/cjs/loader.js | 2 +- lib/internal/modules/esm/module_job.js | 2 +- lib/internal/process/main_thread_only.js | 2 +- lib/internal/test/heap.js | 9 +++++---- lib/net.js | 2 +- lib/zlib.js | 2 +- 18 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lib/_http_client.js b/lib/_http_client.js index c4259184a6c5b3..fdbce5af266879 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -24,7 +24,7 @@ const util = require('util'); const net = require('net'); const url = require('url'); -const assert = require('assert').ok; +const assert = require('internal/assert'); const { _checkIsHttpToken: checkIsHttpToken, debug, diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 7395a02f331af0..667d07801c6497 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -21,7 +21,7 @@ 'use strict'; -const assert = require('assert').ok; +const assert = require('internal/assert'); const Stream = require('stream'); const util = require('util'); const internalUtil = require('internal/util'); diff --git a/lib/_http_server.js b/lib/_http_server.js index a22189b486f612..fae91018519dd1 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -23,7 +23,7 @@ const util = require('util'); const net = require('net'); -const assert = require('assert').ok; +const assert = require('internal/assert'); const { parsers, freeParser, diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 098ed76f27b5d0..5e3239ae200832 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -23,7 +23,7 @@ require('internal/util').assertCrypto(); -const assert = require('assert'); +const assert = require('internal/assert'); const crypto = require('crypto'); const net = require('net'); const tls = require('tls'); diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index ba8bca9220713a..f15bf14d230139 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -19,7 +19,7 @@ const EventEmitter = require('events'); const net = require('net'); const dgram = require('dgram'); const util = require('util'); -const assert = require('assert'); +const assert = require('internal/assert'); const { Process } = internalBinding('process_wrap'); const { diff --git a/lib/internal/cluster/child.js b/lib/internal/cluster/child.js index 272b0d2bd95008..38d52948e56da3 100644 --- a/lib/internal/cluster/child.js +++ b/lib/internal/cluster/child.js @@ -1,5 +1,5 @@ 'use strict'; -const assert = require('assert'); +const assert = require('internal/assert'); const path = require('path'); const EventEmitter = require('events'); const { owner_symbol } = require('internal/async_hooks').symbols; diff --git a/lib/internal/cluster/master.js b/lib/internal/cluster/master.js index c4f8e2b0efa299..a0e194c63ef3c3 100644 --- a/lib/internal/cluster/master.js +++ b/lib/internal/cluster/master.js @@ -1,5 +1,5 @@ 'use strict'; -const assert = require('assert'); +const assert = require('internal/assert'); const { fork } = require('child_process'); const path = require('path'); const EventEmitter = require('events'); diff --git a/lib/internal/cluster/shared_handle.js b/lib/internal/cluster/shared_handle.js index 0b5f1531931b6c..408657623b2e3b 100644 --- a/lib/internal/cluster/shared_handle.js +++ b/lib/internal/cluster/shared_handle.js @@ -1,5 +1,5 @@ 'use strict'; -const assert = require('assert'); +const assert = require('internal/assert'); const dgram = require('internal/dgram'); const net = require('net'); diff --git a/lib/internal/crypto/cipher.js b/lib/internal/crypto/cipher.js index 0a0514103399a0..0be2ee668ec95f 100644 --- a/lib/internal/crypto/cipher.js +++ b/lib/internal/crypto/cipher.js @@ -34,7 +34,7 @@ const { publicEncrypt: _publicEncrypt } = internalBinding('crypto'); -const assert = require('assert'); +const assert = require('internal/assert'); const LazyTransform = require('internal/streams/lazy_transform'); const { inherits } = require('util'); diff --git a/lib/internal/errors.js b/lib/internal/errors.js index d8071e00639a6b..13a6194d0cb016 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -208,7 +208,7 @@ function getMessage(key, args) { const msg = messages.get(key); if (util === undefined) util = require('util'); - if (assert === undefined) assert = require('assert'); + if (assert === undefined) assert = require('internal/assert'); if (typeof msg === 'function') { assert( diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js index e026aa8192c3cf..7bc6f2ac97365a 100644 --- a/lib/internal/fs/watchers.js +++ b/lib/internal/fs/watchers.js @@ -20,7 +20,7 @@ const { toNamespacedPath } = require('path'); const { validateUint32 } = require('internal/validators'); const { toPathIfFileURL } = require('internal/url'); const util = require('util'); -const assert = require('assert'); +const assert = require('internal/assert'); const kOldStatus = Symbol('kOldStatus'); const kUseBigint = Symbol('kUseBigint'); diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index faecf2441ce4c8..8043bd492a8990 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -1,6 +1,6 @@ 'use strict'; -const assert = require('assert'); +const assert = require('internal/assert'); const Stream = require('stream'); const Readable = Stream.Readable; const binding = internalBinding('http2'); diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 0da026843f6232..c37233ffd45252 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -25,7 +25,7 @@ const { NativeModule } = require('internal/bootstrap/loaders'); const { pathToFileURL } = require('internal/url'); const util = require('util'); const vm = require('vm'); -const assert = require('assert').ok; +const assert = require('internal/assert'); const fs = require('fs'); const internalFS = require('internal/fs/utils'); const path = require('path'); diff --git a/lib/internal/modules/esm/module_job.js b/lib/internal/modules/esm/module_job.js index e900babefd6261..016495096c3b33 100644 --- a/lib/internal/modules/esm/module_job.js +++ b/lib/internal/modules/esm/module_job.js @@ -7,7 +7,7 @@ const { } = primordials; const { decorateErrorStack } = require('internal/util'); -const assert = require('assert'); +const assert = require('internal/assert'); const resolvedPromise = SafePromise.resolve(); function noop() {} diff --git a/lib/internal/process/main_thread_only.js b/lib/internal/process/main_thread_only.js index 290d2f7e9e2eb8..0ce063f928974a 100644 --- a/lib/internal/process/main_thread_only.js +++ b/lib/internal/process/main_thread_only.js @@ -153,7 +153,7 @@ function createSignalHandlers() { } function setupChildProcessIpcChannel() { - const assert = require('assert').strict; + const assert = require('internal/assert'); const fd = parseInt(process.env.NODE_CHANNEL_FD, 10); assert(fd >= 0); diff --git a/lib/internal/test/heap.js b/lib/internal/test/heap.js index 3f4a905fc51836..52e00b9da5e136 100644 --- a/lib/internal/test/heap.js +++ b/lib/internal/test/heap.js @@ -5,7 +5,7 @@ process.emitWarning( 'internal/test/heap'); const { createHeapDump, buildEmbedderGraph } = internalBinding('heap_utils'); -const assert = require('assert'); +const assert = require('internal/assert'); // This is not suitable for production code. It creates a full V8 heap dump, // parses it as JSON, and then creates complex objects from it, leading @@ -44,9 +44,10 @@ function createJSHeapDump() { edgeIndex++; } - for (const node of nodes) - assert.strictEqual(node.edge_count, node.outgoingEdges.length); - + for (const node of nodes) { + assert(node.edge_count === node.outgoingEdges.length, + `${node.edge_count} !== ${node.outgoingEdges.length}`); + } return nodes; } diff --git a/lib/net.js b/lib/net.js index d2925b060eb658..46d4994927a6d0 100644 --- a/lib/net.js +++ b/lib/net.js @@ -33,7 +33,7 @@ const { normalizedArgsSymbol, makeSyncWrite } = require('internal/net'); -const assert = require('assert'); +const assert = require('internal/assert'); const { UV_EADDRINUSE, UV_EINVAL diff --git a/lib/zlib.js b/lib/zlib.js index 2a840fe036abad..560435d7f1fff8 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -38,7 +38,7 @@ const { } } = require('util'); const binding = internalBinding('zlib'); -const assert = require('assert').ok; +const assert = require('internal/assert'); const { Buffer, kMaxLength From c8ceece815ab92e054ce174063ae05a300517b9d Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 7 Feb 2019 13:10:21 -0500 Subject: [PATCH 172/223] report: refactor report option validation PR-URL: https://github.com/nodejs/node/pull/25990 Reviewed-By: Richard Lau Reviewed-By: Anna Henningsen --- lib/internal/process/report.js | 133 +++++++++++++-------------------- 1 file changed, 50 insertions(+), 83 deletions(-) diff --git a/lib/internal/process/report.js b/lib/internal/process/report.js index 4ef03885ec64a7..3a0afaf76335dd 100644 --- a/lib/internal/process/report.js +++ b/lib/internal/process/report.js @@ -1,17 +1,13 @@ 'use strict'; - -const { emitExperimentalWarning } = require('internal/util'); +const { + convertToValidSignal, + emitExperimentalWarning +} = require('internal/util'); const { ERR_INVALID_ARG_TYPE, ERR_SYNTHETIC } = require('internal/errors').codes; -const REPORTEVENTS = 1; -const REPORTSIGNAL = 2; -const REPORTFILENAME = 3; -const REPORTPATH = 4; -const REPORTVERBOSE = 5; - // If report is enabled, extract the binding and // wrap the APIs with thin layers, with some error checks. // user options can come in from CLI / ENV / API. @@ -35,68 +31,56 @@ let config = { const report = { setDiagnosticReportOptions(options) { emitExperimentalWarning('report'); - // Reuse the null and undefined checks. Save - // space when dealing with large number of arguments. - const list = parseOptions(options); + const previousConfig = config; + const newConfig = {}; - // Flush the stale entries from report, as - // we are refreshing it, items that the users did not - // touch may be hanging around stale otherwise. - config = {}; + if (options === null || typeof options !== 'object') + options = {}; - // The parseOption method returns an array that include - // the indices at which valid params are present. - list.forEach((i) => { - switch (i) { - case REPORTEVENTS: - if (Array.isArray(options.events)) - config.events = options.events; - else - throw new ERR_INVALID_ARG_TYPE('events', - 'Array', - options.events); - break; - case REPORTSIGNAL: - if (typeof options.signal !== 'string') { - throw new ERR_INVALID_ARG_TYPE('signal', - 'String', - options.signal); - } - process.removeListener(config.signal, handleSignal); - if (config.events.includes('signal')) - process.on(options.signal, handleSignal); - config.signal = options.signal; - break; - case REPORTFILENAME: - if (typeof options.filename !== 'string') { - throw new ERR_INVALID_ARG_TYPE('filename', - 'String', - options.filename); - } - config.filename = options.filename; - break; - case REPORTPATH: - if (typeof options.path !== 'string') - throw new ERR_INVALID_ARG_TYPE('path', 'String', options.path); - config.path = options.path; - break; - case REPORTVERBOSE: - if (typeof options.verbose !== 'string' && - typeof options.verbose !== 'boolean') { - throw new ERR_INVALID_ARG_TYPE('verbose', - 'Booelan | String' + - ' (true|false|yes|no)', - options.verbose); - } - config.verbose = options.verbose; - break; - } - }); - // Upload this new config to C++ land - nr.syncConfig(config, true); - }, + if (Array.isArray(options.events)) + newConfig.events = options.events.slice(); + else if (options.events === undefined) + newConfig.events = []; + else + throw new ERR_INVALID_ARG_TYPE('events', 'Array', options.events); + + if (typeof options.filename === 'string') + newConfig.filename = options.filename; + else if (options.filename === undefined) + newConfig.filename = ''; + else + throw new ERR_INVALID_ARG_TYPE('filename', 'string', options.filename); + + if (typeof options.path === 'string') + newConfig.path = options.path; + else if (options.path === undefined) + newConfig.path = ''; + else + throw new ERR_INVALID_ARG_TYPE('path', 'string', options.path); + if (typeof options.verbose === 'boolean') + newConfig.verbose = options.verbose; + else if (options.verbose === undefined) + newConfig.verbose = false; + else + throw new ERR_INVALID_ARG_TYPE('verbose', 'boolean', options.verbose); + if (typeof options.signal === 'string') + newConfig.signal = convertToValidSignal(options.signal); + else if (options.signal === undefined) + newConfig.signal = 'SIGUSR2'; + else + throw new ERR_INVALID_ARG_TYPE('signal', 'string', options.signal); + + if (previousConfig.signal) + process.removeListener(previousConfig.signal, handleSignal); + + if (newConfig.events.includes('signal')) + process.on(newConfig.signal, handleSignal); + + config = newConfig; + nr.syncConfig(config, true); + }, triggerReport(file, err) { emitExperimentalWarning('report'); if (err == null) { @@ -133,23 +117,6 @@ function handleSignal(signo) { nr.onUserSignal(signo); } -function parseOptions(obj) { - const list = []; - if (obj == null) - return list; - if (obj.events != null) - list.push(REPORTEVENTS); - if (obj.signal != null) - list.push(REPORTSIGNAL); - if (obj.filename != null) - list.push(REPORTFILENAME); - if (obj.path != null) - list.push(REPORTPATH); - if (obj.verbose != null) - list.push(REPORTVERBOSE); - return list; -} - module.exports = { config, handleSignal, From 88019b051ccd52d61dc0dfa245d7ebe71d7d8877 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 7 Feb 2019 13:20:32 -0500 Subject: [PATCH 173/223] report: rename setDiagnosticReportOptions() setDiagnosticReportOptions() is a method on process.report, making the "DiagnosticReport" part redundant. Rename the function to setOptions(). PR-URL: https://github.com/nodejs/node/pull/25990 Reviewed-By: Richard Lau Reviewed-By: Anna Henningsen --- doc/api/process.md | 19 +++++++------------ doc/api/report.md | 10 +++++----- lib/internal/process/report.js | 2 +- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index 7fb503d74f6505..b87223b9c41289 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1687,7 +1687,7 @@ console.log(data); Additional documentation is available in the [report documentation][]. -### process.report.setDiagnosticReportOptions([options]); +### process.report.setOptions([options]); @@ -1712,23 +1712,18 @@ are shown below. ```js // Trigger a report on uncaught exceptions or fatal errors. -process.report.setDiagnosticReportOptions({ - events: ['exception', 'fatalerror'] -}); +process.report.setOptions({ events: ['exception', 'fatalerror'] }); // Change the default path and filename of the report. -process.report.setDiagnosticReportOptions({ - filename: 'foo.json', - path: '/home' -}); +process.report.setOptions({ filename: 'foo.json', path: '/home' }); // Produce the report onto stdout, when generated. Special meaning is attached // to `stdout` and `stderr`. Usage of these will result in report being written // to the associated standard streams. URLs are not supported. -process.report.setDiagnosticReportOptions({ filename: 'stdout' }); +process.report.setOptions({ filename: 'stdout' }); // Enable verbose option on report generation. -process.report.setDiagnosticReportOptions({ verbose: true }); +process.report.setOptions({ verbose: true }); ``` Signal based report generation is not supported on Windows. @@ -1742,8 +1737,8 @@ added: v11.8.0 * `filename` {string} Name of the file where the report is written. This should be a relative path, that will be appended to the directory specified in - `process.report.setDiagnosticReportOptions`, or the current working directory - of the Node.js process, if unspecified. + `process.report.setOptions`, or the current working directory of the Node.js + process, if unspecified. * `err` {Error} A custom error used for reporting the JavsScript stack. * Returns: {string} Returns the filename of the generated report. diff --git a/doc/api/report.md b/doc/api/report.md index 3937f88cc1be4a..89bb203691f7c9 100644 --- a/doc/api/report.md +++ b/doc/api/report.md @@ -445,10 +445,10 @@ times for the same Node.js process. ## Configuration Additional runtime configuration that influences the report generation -constraints are available using `setDiagnosticReportOptions()` API. +constraints are available using `setOptions()` API. ```js -process.report.setDiagnosticReportOptions({ +process.report.setOptions({ events: ['exception', 'fatalerror', 'signal'], signal: 'SIGUSR2', filename: 'myreport.json', @@ -481,13 +481,13 @@ pertinent to the report generation. Defaults to `false`. ```js // Trigger report only on uncaught exceptions. -process.report.setDiagnosticReportOptions({ events: ['exception'] }); +process.report.setOptions({ events: ['exception'] }); // Trigger report for both internal errors as well as external signal. -process.report.setDiagnosticReportOptions({ events: ['fatalerror', 'signal'] }); +process.report.setOptions({ events: ['fatalerror', 'signal'] }); // Change the default signal to `SIGQUIT` and enable it. -process.report.setDiagnosticReportOptions( +process.report.setOptions( { events: ['signal'], signal: 'SIGQUIT' }); ``` diff --git a/lib/internal/process/report.js b/lib/internal/process/report.js index 3a0afaf76335dd..95972773b18ecf 100644 --- a/lib/internal/process/report.js +++ b/lib/internal/process/report.js @@ -29,7 +29,7 @@ let config = { verbose: false }; const report = { - setDiagnosticReportOptions(options) { + setOptions(options) { emitExperimentalWarning('report'); const previousConfig = config; const newConfig = {}; From d7bf070652882cc099863c15dbf9ce14fa0776cb Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 31 Jan 2019 03:08:25 +0800 Subject: [PATCH 174/223] process: move deprecation warning initialization into pre_execution.js Since this is only necessary when user code execution is expected. PR-URL: https://github.com/nodejs/node/pull/25825 Reviewed-By: Anna Henningsen Reviewed-By: Daniel Bevenius Reviewed-By: James M Snell --- lib/internal/bootstrap/node.js | 23 +------------- lib/internal/bootstrap/pre_execution.js | 40 +++++++++++++++++++++++++ lib/internal/main/check_syntax.js | 2 ++ lib/internal/main/eval_stdin.js | 2 ++ lib/internal/main/eval_string.js | 2 ++ lib/internal/main/repl.js | 2 ++ lib/internal/main/run_main_module.js | 2 ++ lib/internal/main/worker_thread.js | 2 ++ 8 files changed, 53 insertions(+), 22 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 7a59b4f369bf54..338abcf55bb03e 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -241,28 +241,6 @@ if (process._invalidDebug) { } const { deprecate } = NativeModule.require('internal/util'); -{ - // Install legacy getters on the `util` binding for typechecking. - // TODO(addaleax): Turn into a full runtime deprecation. - const pendingDeprecation = getOptionValue('--pending-deprecation'); - const utilBinding = internalBinding('util'); - const types = NativeModule.require('internal/util/types'); - for (const name of [ - 'isArrayBuffer', 'isArrayBufferView', 'isAsyncFunction', - 'isDataView', 'isDate', 'isExternal', 'isMap', 'isMapIterator', - 'isNativeError', 'isPromise', 'isRegExp', 'isSet', 'isSetIterator', - 'isTypedArray', 'isUint8Array', 'isAnyArrayBuffer' - ]) { - utilBinding[name] = pendingDeprecation ? - deprecate(types[name], - 'Accessing native typechecking bindings of Node ' + - 'directly is deprecated. ' + - `Please use \`util.types.${name}\` instead.`, - 'DEP0103') : - types[name]; - } -} - // TODO(jasnell): The following have been globals since around 2012. // That's just silly. The underlying perfctr support has been removed // so these are now deprecated non-ops that can be removed after one @@ -307,6 +285,7 @@ Object.defineProperty(process, 'allowedNodeEnvironmentFlags', { enumerable: true, configurable: true }); + // process.assert process.assert = deprecate( perThreadSetup.assert, diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 798c581a721735..d09fdb131a2ca9 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -2,6 +2,45 @@ const { getOptionValue } = require('internal/options'); +// In general deprecations are intialized wherever the APIs are implemented, +// this is used to deprecate APIs implemented in C++ where the deprecation +// utitlities are not easily accessible. +function initializeDeprecations() { + const { deprecate } = require('internal/util'); + const pendingDeprecation = getOptionValue('--pending-deprecation'); + + // DEP0103: access to `process.binding('util').isX` type checkers + // TODO(addaleax): Turn into a full runtime deprecation. + const utilBinding = internalBinding('util'); + const types = require('internal/util/types'); + for (const name of [ + 'isArrayBuffer', + 'isArrayBufferView', + 'isAsyncFunction', + 'isDataView', + 'isDate', + 'isExternal', + 'isMap', + 'isMapIterator', + 'isNativeError', + 'isPromise', + 'isRegExp', + 'isSet', + 'isSetIterator', + 'isTypedArray', + 'isUint8Array', + 'isAnyArrayBuffer' + ]) { + utilBinding[name] = pendingDeprecation ? + deprecate(types[name], + 'Accessing native typechecking bindings of Node ' + + 'directly is deprecated. ' + + `Please use \`util.types.${name}\` instead.`, + 'DEP0103') : + types[name]; + } +} + function initializeClusterIPC() { // If this is a worker in cluster mode, start up the communication // channel. This needs to be done before any user code gets executed @@ -75,6 +114,7 @@ function loadPreloadModules() { } module.exports = { + initializeDeprecations, initializeClusterIPC, initializePolicy, initializeESMLoader, diff --git a/lib/internal/main/check_syntax.js b/lib/internal/main/check_syntax.js index 5d4d7a04ebd0eb..97584841b3a0c2 100644 --- a/lib/internal/main/check_syntax.js +++ b/lib/internal/main/check_syntax.js @@ -4,6 +4,7 @@ // instead of actually running the file. const { + initializeDeprecations, initializeClusterIPC, initializePolicy, initializeESMLoader, @@ -21,6 +22,7 @@ const { } = require('internal/modules/cjs/helpers'); // TODO(joyeecheung): not every one of these are necessary +initializeDeprecations(); initializeClusterIPC(); initializePolicy(); initializeESMLoader(); diff --git a/lib/internal/main/eval_stdin.js b/lib/internal/main/eval_stdin.js index ad15fdb93cd49d..f02d9ffa0cea03 100644 --- a/lib/internal/main/eval_stdin.js +++ b/lib/internal/main/eval_stdin.js @@ -3,6 +3,7 @@ // Stdin is not a TTY, we will read it and execute it. const { + initializeDeprecations, initializeClusterIPC, initializePolicy, initializeESMLoader, @@ -14,6 +15,7 @@ const { readStdin } = require('internal/process/execution'); +initializeDeprecations(); initializeClusterIPC(); initializePolicy(); initializeESMLoader(); diff --git a/lib/internal/main/eval_string.js b/lib/internal/main/eval_string.js index cd382b48e76663..7f746a6b11a951 100644 --- a/lib/internal/main/eval_string.js +++ b/lib/internal/main/eval_string.js @@ -4,6 +4,7 @@ // `--interactive`. const { + initializeDeprecations, initializeClusterIPC, initializePolicy, initializeESMLoader, @@ -13,6 +14,7 @@ const { evalScript } = require('internal/process/execution'); const { addBuiltinLibsToObject } = require('internal/modules/cjs/helpers'); const source = require('internal/options').getOptionValue('--eval'); +initializeDeprecations(); initializeClusterIPC(); initializePolicy(); initializeESMLoader(); diff --git a/lib/internal/main/repl.js b/lib/internal/main/repl.js index 4ca328421bcb9a..e931444ef32502 100644 --- a/lib/internal/main/repl.js +++ b/lib/internal/main/repl.js @@ -4,6 +4,7 @@ // the main module is not specified and stdin is a TTY. const { + initializeDeprecations, initializeClusterIPC, initializePolicy, initializeESMLoader, @@ -14,6 +15,7 @@ const { evalScript } = require('internal/process/execution'); +initializeDeprecations(); initializeClusterIPC(); initializePolicy(); initializeESMLoader(); diff --git a/lib/internal/main/run_main_module.js b/lib/internal/main/run_main_module.js index b5049cffc5250c..abc41fc20220f0 100644 --- a/lib/internal/main/run_main_module.js +++ b/lib/internal/main/run_main_module.js @@ -1,12 +1,14 @@ 'use strict'; const { + initializeDeprecations, initializeClusterIPC, initializePolicy, initializeESMLoader, loadPreloadModules } = require('internal/bootstrap/pre_execution'); +initializeDeprecations(); initializeClusterIPC(); initializePolicy(); initializeESMLoader(); diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js index 94d0e613e8ce38..7e4466c24d0c31 100644 --- a/lib/internal/main/worker_thread.js +++ b/lib/internal/main/worker_thread.js @@ -4,6 +4,7 @@ // message port. const { + initializeDeprecations, initializeClusterIPC, initializeESMLoader, loadPreloadModules @@ -55,6 +56,7 @@ port.on('message', (message) => { if (manifestSrc) { require('internal/process/policy').setup(manifestSrc, manifestURL); } + initializeDeprecations(); initializeClusterIPC(); initializeESMLoader(); loadPreloadModules(); From 9a7e883b83687c31e340f105b590a72a7a02f3a5 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 1 Feb 2019 04:03:25 +0800 Subject: [PATCH 175/223] process: group main thread execution preparation code This patch groups the preparation of main thread execution into `prepareMainThreadExecution()` and removes the cluster IPC setup in worker thread bootstrap since clusters do not use worker threads for its implementation and it's unlikely to change. PR-URL: https://github.com/nodejs/node/pull/26000 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Minwoo Jung --- lib/internal/bootstrap/node.js | 25 -------------- lib/internal/bootstrap/pre_execution.js | 42 +++++++++++++++++++++--- lib/internal/main/check_syntax.js | 12 ++----- lib/internal/main/eval_stdin.js | 12 ++----- lib/internal/main/eval_string.js | 12 ++----- lib/internal/main/repl.js | 12 ++----- lib/internal/main/run_main_module.js | 12 ++----- lib/internal/main/worker_thread.js | 22 +++++++++++-- lib/internal/process/main_thread_only.js | 14 -------- 9 files changed, 67 insertions(+), 96 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 338abcf55bb03e..78d04fe4446d5b 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -176,31 +176,6 @@ if (config.hasInspector) { internalBinding('inspector').registerAsyncHook(enable, disable); } -// If the process is spawned with env NODE_CHANNEL_FD, it's probably -// spawned by our child_process module, then initialize IPC. -// This attaches some internal event listeners and creates: -// process.send(), process.channel, process.connected, -// process.disconnect() -if (process.env.NODE_CHANNEL_FD) { - if (ownsProcessState) { - mainThreadSetup.setupChildProcessIpcChannel(); - } else { - Object.defineProperty(process, 'channel', { - enumerable: false, - get: workerThreadSetup.unavailable('process.channel') - }); - - Object.defineProperty(process, 'connected', { - enumerable: false, - get: workerThreadSetup.unavailable('process.connected') - }); - - process.send = workerThreadSetup.unavailable('process.send()'); - process.disconnect = - workerThreadSetup.unavailable('process.disconnect()'); - } -} - const browserGlobals = !process._noBrowserGlobals; if (browserGlobals) { setupGlobalTimeouts(); diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index d09fdb131a2ca9..ce4af115badaab 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -2,6 +2,27 @@ const { getOptionValue } = require('internal/options'); +function prepareMainThreadExecution() { + // If the process is spawned with env NODE_CHANNEL_FD, it's probably + // spawned by our child_process module, then initialize IPC. + // This attaches some internal event listeners and creates: + // process.send(), process.channel, process.connected, + // process.disconnect(). + setupChildProcessIpcChannel(); + + // Load policy from disk and parse it. + initializePolicy(); + + // If this is a worker in cluster mode, start up the communication + // channel. This needs to be done before any user code gets executed + // (including preload modules). + initializeClusterIPC(); + + initializeDeprecations(); + initializeESMLoader(); + loadPreloadModules(); +} + // In general deprecations are intialized wherever the APIs are implemented, // this is used to deprecate APIs implemented in C++ where the deprecation // utitlities are not easily accessible. @@ -41,10 +62,22 @@ function initializeDeprecations() { } } +function setupChildProcessIpcChannel() { + if (process.env.NODE_CHANNEL_FD) { + const assert = require('internal/assert'); + + const fd = parseInt(process.env.NODE_CHANNEL_FD, 10); + assert(fd >= 0); + + // Make sure it's not accidentally inherited by child processes. + delete process.env.NODE_CHANNEL_FD; + + require('child_process')._forkChild(fd); + assert(process.send); + } +} + function initializeClusterIPC() { - // If this is a worker in cluster mode, start up the communication - // channel. This needs to be done before any user code gets executed - // (including preload modules). if (process.argv[1] && process.env.NODE_UNIQUE_ID) { const cluster = require('cluster'); cluster._setupWorker(); @@ -114,9 +147,8 @@ function loadPreloadModules() { } module.exports = { + prepareMainThreadExecution, initializeDeprecations, - initializeClusterIPC, - initializePolicy, initializeESMLoader, loadPreloadModules }; diff --git a/lib/internal/main/check_syntax.js b/lib/internal/main/check_syntax.js index 97584841b3a0c2..5d98701132f0e8 100644 --- a/lib/internal/main/check_syntax.js +++ b/lib/internal/main/check_syntax.js @@ -4,11 +4,7 @@ // instead of actually running the file. const { - initializeDeprecations, - initializeClusterIPC, - initializePolicy, - initializeESMLoader, - loadPreloadModules + prepareMainThreadExecution } = require('internal/bootstrap/pre_execution'); const { @@ -22,11 +18,7 @@ const { } = require('internal/modules/cjs/helpers'); // TODO(joyeecheung): not every one of these are necessary -initializeDeprecations(); -initializeClusterIPC(); -initializePolicy(); -initializeESMLoader(); -loadPreloadModules(); +prepareMainThreadExecution(); markBootstrapComplete(); if (process.argv[1] && process.argv[1] !== '-') { diff --git a/lib/internal/main/eval_stdin.js b/lib/internal/main/eval_stdin.js index f02d9ffa0cea03..2a2ef6d38a1fe8 100644 --- a/lib/internal/main/eval_stdin.js +++ b/lib/internal/main/eval_stdin.js @@ -3,11 +3,7 @@ // Stdin is not a TTY, we will read it and execute it. const { - initializeDeprecations, - initializeClusterIPC, - initializePolicy, - initializeESMLoader, - loadPreloadModules + prepareMainThreadExecution } = require('internal/bootstrap/pre_execution'); const { @@ -15,11 +11,7 @@ const { readStdin } = require('internal/process/execution'); -initializeDeprecations(); -initializeClusterIPC(); -initializePolicy(); -initializeESMLoader(); -loadPreloadModules(); +prepareMainThreadExecution(); markBootstrapComplete(); readStdin((code) => { diff --git a/lib/internal/main/eval_string.js b/lib/internal/main/eval_string.js index 7f746a6b11a951..953fab386d0671 100644 --- a/lib/internal/main/eval_string.js +++ b/lib/internal/main/eval_string.js @@ -4,21 +4,13 @@ // `--interactive`. const { - initializeDeprecations, - initializeClusterIPC, - initializePolicy, - initializeESMLoader, - loadPreloadModules + prepareMainThreadExecution } = require('internal/bootstrap/pre_execution'); const { evalScript } = require('internal/process/execution'); const { addBuiltinLibsToObject } = require('internal/modules/cjs/helpers'); const source = require('internal/options').getOptionValue('--eval'); -initializeDeprecations(); -initializeClusterIPC(); -initializePolicy(); -initializeESMLoader(); -loadPreloadModules(); +prepareMainThreadExecution(); addBuiltinLibsToObject(global); markBootstrapComplete(); evalScript('[eval]', source, process._breakFirstLine); diff --git a/lib/internal/main/repl.js b/lib/internal/main/repl.js index e931444ef32502..e6b98853511d11 100644 --- a/lib/internal/main/repl.js +++ b/lib/internal/main/repl.js @@ -4,22 +4,14 @@ // the main module is not specified and stdin is a TTY. const { - initializeDeprecations, - initializeClusterIPC, - initializePolicy, - initializeESMLoader, - loadPreloadModules + prepareMainThreadExecution } = require('internal/bootstrap/pre_execution'); const { evalScript } = require('internal/process/execution'); -initializeDeprecations(); -initializeClusterIPC(); -initializePolicy(); -initializeESMLoader(); -loadPreloadModules(); +prepareMainThreadExecution(); const cliRepl = require('internal/repl'); cliRepl.createInternalRepl(process.env, (err, repl) => { diff --git a/lib/internal/main/run_main_module.js b/lib/internal/main/run_main_module.js index abc41fc20220f0..97a4e33be2e629 100644 --- a/lib/internal/main/run_main_module.js +++ b/lib/internal/main/run_main_module.js @@ -1,18 +1,10 @@ 'use strict'; const { - initializeDeprecations, - initializeClusterIPC, - initializePolicy, - initializeESMLoader, - loadPreloadModules + prepareMainThreadExecution } = require('internal/bootstrap/pre_execution'); -initializeDeprecations(); -initializeClusterIPC(); -initializePolicy(); -initializeESMLoader(); -loadPreloadModules(); +prepareMainThreadExecution(); // Expand process.argv[1] into a full path. const path = require('path'); diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js index 7e4466c24d0c31..ac161b7588f04c 100644 --- a/lib/internal/main/worker_thread.js +++ b/lib/internal/main/worker_thread.js @@ -5,7 +5,6 @@ const { initializeDeprecations, - initializeClusterIPC, initializeESMLoader, loadPreloadModules } = require('internal/bootstrap/pre_execution'); @@ -42,6 +41,26 @@ debug(`[${threadId}] is setting up worker child environment`); // Set up the message port and start listening const port = getEnvMessagePort(); +// If the main thread is spawned with env NODE_CHANNEL_FD, it's probably +// spawned by our child_process module. In the work threads, mark the +// related IPC properties as unavailable. +if (process.env.NODE_CHANNEL_FD) { + const workerThreadSetup = require('internal/process/worker_thread_only'); + Object.defineProperty(process, 'channel', { + enumerable: false, + get: workerThreadSetup.unavailable('process.channel') + }); + + Object.defineProperty(process, 'connected', { + enumerable: false, + get: workerThreadSetup.unavailable('process.connected') + }); + + process.send = workerThreadSetup.unavailable('process.send()'); + process.disconnect = + workerThreadSetup.unavailable('process.disconnect()'); +} + port.on('message', (message) => { if (message.type === LOAD_SCRIPT) { const { @@ -57,7 +76,6 @@ port.on('message', (message) => { require('internal/process/policy').setup(manifestSrc, manifestURL); } initializeDeprecations(); - initializeClusterIPC(); initializeESMLoader(); loadPreloadModules(); publicWorker.parentPort = publicPort; diff --git a/lib/internal/process/main_thread_only.js b/lib/internal/process/main_thread_only.js index 0ce063f928974a..96c57fda35c755 100644 --- a/lib/internal/process/main_thread_only.js +++ b/lib/internal/process/main_thread_only.js @@ -152,22 +152,8 @@ function createSignalHandlers() { }; } -function setupChildProcessIpcChannel() { - const assert = require('internal/assert'); - - const fd = parseInt(process.env.NODE_CHANNEL_FD, 10); - assert(fd >= 0); - - // Make sure it's not accidentally inherited by child processes. - delete process.env.NODE_CHANNEL_FD; - - require('child_process')._forkChild(fd); - assert(process.send); -} - module.exports = { wrapProcessMethods, createSignalHandlers, - setupChildProcessIpcChannel, wrapPosixCredentialSetters }; From 614bb9f3c81f0509a6f9228b687316cdbe264d17 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 8 Feb 2019 11:22:37 +0800 Subject: [PATCH 176/223] process: normalize process.argv before user code execution And make sure that `process.argv` from the preloaded modules is the same as the one in the main module. Refs: https://github.com/nodejs/node/issues/25967 PR-URL: https://github.com/nodejs/node/pull/26000 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Minwoo Jung --- lib/internal/main/check_syntax.js | 11 ++++-- lib/internal/main/run_main_module.js | 4 +- .../test-preload-print-process-argv.js | 38 +++++++++++++++++++ 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 test/parallel/test-preload-print-process-argv.js diff --git a/lib/internal/main/check_syntax.js b/lib/internal/main/check_syntax.js index 5d98701132f0e8..392fadb99ff668 100644 --- a/lib/internal/main/check_syntax.js +++ b/lib/internal/main/check_syntax.js @@ -17,9 +17,6 @@ const { stripShebang, stripBOM } = require('internal/modules/cjs/helpers'); -// TODO(joyeecheung): not every one of these are necessary -prepareMainThreadExecution(); -markBootstrapComplete(); if (process.argv[1] && process.argv[1] !== '-') { // Expand process.argv[1] into a full path. @@ -31,8 +28,16 @@ if (process.argv[1] && process.argv[1] !== '-') { const fs = require('fs'); const source = fs.readFileSync(filename, 'utf-8'); + // TODO(joyeecheung): not every one of these are necessary + prepareMainThreadExecution(); + markBootstrapComplete(); + checkScriptSyntax(source, filename); } else { + // TODO(joyeecheung): not every one of these are necessary + prepareMainThreadExecution(); + markBootstrapComplete(); + readStdin((code) => { checkScriptSyntax(code, '[stdin]'); }); diff --git a/lib/internal/main/run_main_module.js b/lib/internal/main/run_main_module.js index 97a4e33be2e629..634abe493ea60e 100644 --- a/lib/internal/main/run_main_module.js +++ b/lib/internal/main/run_main_module.js @@ -4,12 +4,12 @@ const { prepareMainThreadExecution } = require('internal/bootstrap/pre_execution'); -prepareMainThreadExecution(); - // Expand process.argv[1] into a full path. const path = require('path'); process.argv[1] = path.resolve(process.argv[1]); +prepareMainThreadExecution(); + const CJSModule = require('internal/modules/cjs/loader'); markBootstrapComplete(); diff --git a/test/parallel/test-preload-print-process-argv.js b/test/parallel/test-preload-print-process-argv.js new file mode 100644 index 00000000000000..ace20dfb3947c4 --- /dev/null +++ b/test/parallel/test-preload-print-process-argv.js @@ -0,0 +1,38 @@ +'use strict'; + +// This tests that process.argv is the same in the preloaded module +// and the user module. + +const common = require('../common'); + +const tmpdir = require('../common/tmpdir'); +const assert = require('assert'); +const { spawnSync } = require('child_process'); +const fs = require('fs'); + +if (!common.isMainThread) { + common.skip('Cannot chdir to the tmp directory in workers'); +} + +tmpdir.refresh(); + +process.chdir(tmpdir.path); +fs.writeFileSync( + 'preload.js', + 'console.log(JSON.stringify(process.argv));', + 'utf-8'); + +fs.writeFileSync( + 'main.js', + 'console.log(JSON.stringify(process.argv));', + 'utf-8'); + +const child = spawnSync(process.execPath, ['-r', './preload.js', 'main.js']); + +if (child.status !== 0) { + console.log(child.stderr.toString()); + assert.strictEqual(child.status, 0); +} + +const lines = child.stdout.toString().trim().split('\n'); +assert.deepStrictEqual(JSON.parse(lines[0]), JSON.parse(lines[1])); From 24d9e9c8b6473371d0571d13052be3e944fba09f Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Fri, 8 Feb 2019 09:34:46 +0800 Subject: [PATCH 177/223] src: remove redundant void PR-URL: https://github.com/nodejs/node/pull/26003 Reviewed-By: Ben Noordhuis Reviewed-By: Daniel Bevenius Reviewed-By: Colin Ihrig --- src/inspector_socket.cc | 2 +- src/node_object_wrap.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inspector_socket.cc b/src/inspector_socket.cc index dcc42f25b4acb8..b17ee767439d46 100644 --- a/src/inspector_socket.cc +++ b/src/inspector_socket.cc @@ -365,7 +365,7 @@ class WsHandler : public ProtocolHandler { } private: - using Callback = void (WsHandler::*)(void); + using Callback = void (WsHandler::*)(); static void OnCloseFrameWritten(uv_write_t* req, int status) { WriteRequest* wr = WriteRequest::from_write_req(req); diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h index b8ed2f99135a65..96b9115adac860 100644 --- a/src/node_object_wrap.h +++ b/src/node_object_wrap.h @@ -81,7 +81,7 @@ class ObjectWrap { } - inline void MakeWeak(void) { + inline void MakeWeak() { persistent().SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); } From 3cd134cec45b291b12f91b825c9efc3fb19a97ee Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 30 Jan 2019 21:07:11 +0100 Subject: [PATCH 178/223] src,lib: remove dead `process.binding()` code There are no non-internal builtin modules left, so this should be safe to remove to a large degree. PR-URL: https://github.com/nodejs/node/pull/25829 Reviewed-By: Joyee Cheung Reviewed-By: Colin Ihrig Reviewed-By: Anto Aravinth Reviewed-By: Gus Caplan Reviewed-By: Ben Noordhuis --- lib/internal/bootstrap/cache.js | 2 +- lib/internal/bootstrap/loaders.js | 10 +++----- lib/internal/crypto/diffiehellman.js | 2 +- lib/internal/crypto/hash.js | 2 +- src/node.cc | 4 ---- src/node_binding.cc | 36 +++------------------------- src/node_binding.h | 8 +------ 7 files changed, 10 insertions(+), 54 deletions(-) diff --git a/lib/internal/bootstrap/cache.js b/lib/internal/bootstrap/cache.js index 5d5c441e65a7b7..9cfa30aef7ee6f 100644 --- a/lib/internal/bootstrap/cache.js +++ b/lib/internal/bootstrap/cache.js @@ -9,7 +9,7 @@ const { NativeModule } = require('internal/bootstrap/loaders'); const { getCodeCache, compileFunction } = internalBinding('native_module'); -const { hasTracing, hasInspector } = process.binding('config'); +const { hasTracing, hasInspector } = internalBinding('config'); // Modules with source code compiled in js2c that // cannot be compiled with the code cache. diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 1007b41069c723..d21fddbf5239a1 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -41,7 +41,7 @@ // This file is compiled as if it's wrapped in a function with arguments // passed by node::RunBootstrapping() -/* global process, getBinding, getLinkedBinding, getInternalBinding */ +/* global process, getLinkedBinding, getInternalBinding */ /* global experimentalModules, exposeInternals, primordials */ const { @@ -108,12 +108,8 @@ const internalBindingWhitelist = new SafeSet([ if (internalBindingWhitelist.has(module)) { return internalBinding(module); } - let mod = bindingObj[module]; - if (typeof mod !== 'object') { - mod = bindingObj[module] = getBinding(module); - moduleLoadList.push(`Binding ${module}`); - } - return mod; + // eslint-disable-next-line no-restricted-syntax + throw new Error(`No such module: ${module}`); }; process._linkedBinding = function _linkedBinding(module) { diff --git a/lib/internal/crypto/diffiehellman.js b/lib/internal/crypto/diffiehellman.js index 81204cfda3e676..3bfc531455ca1c 100644 --- a/lib/internal/crypto/diffiehellman.js +++ b/lib/internal/crypto/diffiehellman.js @@ -19,7 +19,7 @@ const { DiffieHellmanGroup: _DiffieHellmanGroup, ECDH: _ECDH, ECDHConvertKey: _ECDHConvertKey -} = process.binding('crypto'); +} = internalBinding('crypto'); const { POINT_CONVERSION_COMPRESSED, POINT_CONVERSION_HYBRID, diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js index 3284604495026e..f3724ab1d56f7a 100644 --- a/lib/internal/crypto/hash.js +++ b/lib/internal/crypto/hash.js @@ -3,7 +3,7 @@ const { Hash: _Hash, Hmac: _Hmac -} = process.binding('crypto'); +} = internalBinding('crypto'); const { getDefaultEncoding, diff --git a/src/node.cc b/src/node.cc index f815f7285d19be..7d9075b5e0a16e 100644 --- a/src/node.cc +++ b/src/node.cc @@ -269,7 +269,6 @@ MaybeLocal RunBootstrapping(Environment* env) { // Create binding loaders std::vector> loaders_params = { env->process_string(), - FIXED_ONE_BYTE_STRING(isolate, "getBinding"), FIXED_ONE_BYTE_STRING(isolate, "getLinkedBinding"), FIXED_ONE_BYTE_STRING(isolate, "getInternalBinding"), // --experimental-modules @@ -279,9 +278,6 @@ MaybeLocal RunBootstrapping(Environment* env) { env->primordials_string()}; std::vector> loaders_args = { process, - env->NewFunctionTemplate(binding::GetBinding) - ->GetFunction(context) - .ToLocalChecked(), env->NewFunctionTemplate(binding::GetLinkedBinding) ->GetFunction(context) .ToLocalChecked(), diff --git a/src/node_binding.cc b/src/node_binding.cc index 85f3c19e690182..08d55567d4904a 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc @@ -84,7 +84,7 @@ // function for each built-in modules explicitly in // binding::RegisterBuiltinModules(). This is only forward declaration. // The definitions are in each module's implementation when calling -// the NODE_BUILTIN_MODULE_CONTEXT_AWARE. +// the NODE_MODULE_CONTEXT_AWARE_INTERNAL. #define V(modname) void _register_##modname(); NODE_BUILTIN_MODULES(V) #undef V @@ -101,7 +101,6 @@ using v8::String; using v8::Value; // Globals per process -static node_module* modlist_builtin; static node_module* modlist_internal; static node_module* modlist_linked; static node_module* modlist_addon; @@ -114,10 +113,7 @@ bool node_is_initialized = false; extern "C" void node_module_register(void* m) { struct node_module* mp = reinterpret_cast(m); - if (mp->nm_flags & NM_F_BUILTIN) { - mp->nm_link = modlist_builtin; - modlist_builtin = mp; - } else if (mp->nm_flags & NM_F_INTERNAL) { + if (mp->nm_flags & NM_F_INTERNAL) { mp->nm_link = modlist_internal; modlist_internal = mp; } else if (!node_is_initialized) { @@ -295,11 +291,7 @@ void DLOpen(const FunctionCallbackInfo& args) { env->ThrowError(errmsg); return false; } - if (mp->nm_flags & NM_F_BUILTIN) { - dlib->Close(); - env->ThrowError("Built-in module self-registered."); - return false; - } + CHECK_EQ(mp->nm_flags & NM_F_BUILTIN, 0); mp->nm_dso_handle = dlib->handle_; mp->nm_link = modlist_addon; @@ -335,9 +327,6 @@ inline struct node_module* FindModule(struct node_module* list, return mp; } -node_module* get_builtin_module(const char* name) { - return FindModule(modlist_builtin, name, NM_F_BUILTIN); -} node_module* get_internal_module(const char* name) { return FindModule(modlist_internal, name, NM_F_INTERNAL); } @@ -363,25 +352,6 @@ static void ThrowIfNoSuchModule(Environment* env, const char* module_v) { env->ThrowError(errmsg); } -void GetBinding(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args); - - CHECK(args[0]->IsString()); - - Local module = args[0].As(); - node::Utf8Value module_v(env->isolate(), module); - - node_module* mod = get_builtin_module(*module_v); - Local exports; - if (mod != nullptr) { - exports = InitModule(env, mod, module); - } else { - return ThrowIfNoSuchModule(env, *module_v); - } - - args.GetReturnValue().Set(exports); -} - void GetInternalBinding(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); diff --git a/src/node_binding.h b/src/node_binding.h index 7d79dae80d8e39..d73e18548ff47e 100644 --- a/src/node_binding.h +++ b/src/node_binding.h @@ -15,7 +15,7 @@ #include "v8.h" enum { - NM_F_BUILTIN = 1 << 0, + NM_F_BUILTIN = 1 << 0, // Unused. NM_F_LINKED = 1 << 1, NM_F_INTERNAL = 1 << 2, }; @@ -33,9 +33,6 @@ enum { nullptr}; \ void _register_##modname() { node_module_register(&_module); } -#define NODE_BUILTIN_MODULE_CONTEXT_AWARE(modname, regfunc) \ - NODE_MODULE_CONTEXT_AWARE_CPP(modname, regfunc, nullptr, NM_F_BUILTIN) - void napi_module_register_by_symbol(v8::Local exports, v8::Local module, v8::Local context, @@ -83,7 +80,6 @@ class DLib { // use the __attribute__((constructor)). Need to // explicitly call the _register* functions. void RegisterBuiltinModules(); -void GetBinding(const v8::FunctionCallbackInfo& args); void GetInternalBinding(const v8::FunctionCallbackInfo& args); void GetLinkedBinding(const v8::FunctionCallbackInfo& args); void DLOpen(const v8::FunctionCallbackInfo& args); @@ -92,7 +88,5 @@ void DLOpen(const v8::FunctionCallbackInfo& args); } // namespace node -#include "node_binding.h" - #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #endif // SRC_NODE_BINDING_H_ From 3eb6f6130ac39128ee154af8a77d5ebee969d966 Mon Sep 17 00:00:00 2001 From: Gireesh Punathil Date: Fri, 8 Feb 2019 07:52:02 -0500 Subject: [PATCH 179/223] test: capture stderr from child processes If the test fails with errors from the child commands, there is no debug info. Suppliment the stderr data so that we know what to look for. Refs: https://github.com/nodejs/node/issues/25988 PR-URL: https://github.com/nodejs/node/pull/26007 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig --- .../test-child-process-pipe-dataflow.js | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/test/parallel/test-child-process-pipe-dataflow.js b/test/parallel/test-child-process-pipe-dataflow.js index 501fb29032b3c8..f5068b5d366468 100644 --- a/test/parallel/test-child-process-pipe-dataflow.js +++ b/test/parallel/test-child-process-pipe-dataflow.js @@ -33,19 +33,17 @@ const MB = KB * KB; grep = spawn('grep', ['x'], { stdio: [cat.stdout, 'pipe', 'pipe'] }); wc = spawn('wc', ['-c'], { stdio: [grep.stdout, 'pipe', 'pipe'] }); + [cat, grep, wc].forEach((child, index) => { + child.stderr.on('data', (d) => { + // Don't want to assert here, as we might miss error code info. + console.error(`got unexpected data from child #${index}:\n${d}`); + }); + child.on('exit', common.mustCall(function(code) { + assert.strictEqual(code, 0); + })); + }); + wc.stdout.on('data', common.mustCall(function(data) { assert.strictEqual(data.toString().trim(), MB.toString()); })); - - cat.on('exit', common.mustCall(function(code) { - assert.strictEqual(code, 0); - })); - - grep.on('exit', common.mustCall(function(code) { - assert.strictEqual(code, 0); - })); - - wc.on('exit', common.mustCall(function(code) { - assert.strictEqual(code, 0); - })); } From 6c6e678eaa4a15b8f8afa148214eb6ca6eb3f3b7 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Thu, 7 Feb 2019 16:03:02 +0800 Subject: [PATCH 180/223] src: remove unused class in node_errors.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/25980 Reviewed-By: Anna Henningsen Reviewed-By: Michaël Zasso --- src/node_errors.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/node_errors.h b/src/node_errors.h index eefc5706374298..70b81ba7857a6c 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -23,17 +23,6 @@ void AppendExceptionLine(Environment* env, [[noreturn]] void FatalError(const char* location, const char* message); void OnFatalError(const char* location, const char* message); -// Like a `TryCatch` but exits the process if an exception was caught. -class FatalTryCatch : public v8::TryCatch { - public: - explicit FatalTryCatch(Environment* env) - : TryCatch(env->isolate()), env_(env) {} - ~FatalTryCatch(); - - private: - Environment* env_; -}; - void PrintErrorString(const char* format, ...); void ReportException(Environment* env, const v8::TryCatch& try_catch); From 90c9f1d3235cf14d5887e63a24b9608b94352279 Mon Sep 17 00:00:00 2001 From: Weijia Wang Date: Fri, 8 Feb 2019 13:53:57 +0800 Subject: [PATCH 181/223] http: reduce multiple output arrays into one Now we are using `output`, `outputEncodings` and `outputCallbacks` to hold pending data. Reducing them into one array `outputData` can slightly improve performance and reduce some redundant codes. PR-URL: https://github.com/nodejs/node/pull/26004 Reviewed-By: Ben Noordhuis Reviewed-By: Luigi Pinca Reviewed-By: Minwoo Jung --- lib/_http_client.js | 6 +-- lib/_http_outgoing.js | 43 +++++++++---------- .../test-http-destroyed-socket-write2.js | 3 +- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/lib/_http_client.js b/lib/_http_client.js index fdbce5af266879..0fd027a00d753b 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -376,10 +376,8 @@ function socketCloseListener() { // Too bad. That output wasn't getting written. // This is pretty terrible that it doesn't raise an error. // Fixed better in v0.10 - if (req.output) - req.output.length = 0; - if (req.outputEncodings) - req.outputEncodings.length = 0; + if (req.outputData) + req.outputData.length = 0; if (parser) { parser.finish(); diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 667d07801c6497..671a1477d8be1a 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -70,9 +70,7 @@ function OutgoingMessage() { // Queue that holds all currently pending data, until the response will be // assigned to the socket (until it will its turn in the HTTP pipeline). - this.output = []; - this.outputEncodings = []; - this.outputCallbacks = []; + this.outputData = []; // `outputSize` is an approximate measure of how much data is queued on this // response. `_onPendingData` will be invoked to update similar global @@ -219,14 +217,18 @@ OutgoingMessage.prototype._send = function _send(data, encoding, callback) { data = this._header + data; } else { var header = this._header; - if (this.output.length === 0) { - this.output = [header]; - this.outputEncodings = ['latin1']; - this.outputCallbacks = [null]; + if (this.outputData.length === 0) { + this.outputData = [{ + data: header, + encoding: 'latin1', + callback: null + }]; } else { - this.output.unshift(header); - this.outputEncodings.unshift('latin1'); - this.outputCallbacks.unshift(null); + this.outputData.unshift({ + data: header, + encoding: 'latin1', + callback: null + }); } this.outputSize += header.length; this._onPendingData(header.length); @@ -253,7 +255,7 @@ function _writeRaw(data, encoding, callback) { if (conn && conn._httpMessage === this && conn.writable && !conn.destroyed) { // There might be pending data in the this.output buffer. - if (this.output.length) { + if (this.outputData.length) { this._flushOutput(conn); } else if (!data.length) { if (typeof callback === 'function') { @@ -272,9 +274,7 @@ function _writeRaw(data, encoding, callback) { return conn.write(data, encoding, callback); } // Buffer, as long as we're not destroyed. - this.output.push(data); - this.outputEncodings.push(encoding); - this.outputCallbacks.push(callback); + this.outputData.push({ data, encoding, callback }); this.outputSize += data.length; this._onPendingData(data.length); return false; @@ -737,7 +737,7 @@ OutgoingMessage.prototype.end = function end(chunk, encoding, callback) { // There is the first message on the outgoing queue, and we've sent // everything to the socket. debug('outgoing message end.'); - if (this.output.length === 0 && + if (this.outputData.length === 0 && this.connection && this.connection._httpMessage === this) { this._finish(); @@ -792,22 +792,19 @@ OutgoingMessage.prototype._flush = function _flush() { OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) { var ret; - var outputLength = this.output.length; + var outputLength = this.outputData.length; if (outputLength <= 0) return ret; - var output = this.output; - var outputEncodings = this.outputEncodings; - var outputCallbacks = this.outputCallbacks; + var outputData = this.outputData; socket.cork(); for (var i = 0; i < outputLength; i++) { - ret = socket.write(output[i], outputEncodings[i], outputCallbacks[i]); + const { data, encoding, callback } = outputData[i]; + ret = socket.write(data, encoding, callback); } socket.uncork(); - this.output = []; - this.outputEncodings = []; - this.outputCallbacks = []; + this.outputData = []; this._onPendingData(-this.outputSize); this.outputSize = 0; diff --git a/test/parallel/test-http-destroyed-socket-write2.js b/test/parallel/test-http-destroyed-socket-write2.js index 48899415e37a4f..551cea19829d93 100644 --- a/test/parallel/test-http-destroyed-socket-write2.js +++ b/test/parallel/test-http-destroyed-socket-write2.js @@ -69,8 +69,7 @@ server.listen(0, function() { } - assert.strictEqual(req.output.length, 0); - assert.strictEqual(req.outputEncodings.length, 0); + assert.strictEqual(req.outputData.length, 0); server.close(); })); From d7ae1054ef69030b5d4a3729afbac9f953b24f82 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Thu, 7 Feb 2019 17:04:51 +0800 Subject: [PATCH 182/223] src: remove redundant cast in node_file.cc PR-URL: https://github.com/nodejs/node/pull/25977 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig --- src/node_file.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/node_file.cc b/src/node_file.cc index 5513be3d7c77c1..606900f2273866 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -608,8 +608,7 @@ void AfterScanDir(uv_fs_t* req) { break; if (r != 0) { return req_wrap->Reject( - UVException(r, nullptr, req_wrap->syscall(), - static_cast(req->path))); + UVException(r, nullptr, req_wrap->syscall(), req->path)); } MaybeLocal filename = @@ -650,8 +649,7 @@ void AfterScanDirWithTypes(uv_fs_t* req) { break; if (r != 0) { return req_wrap->Reject( - UVException(r, nullptr, req_wrap->syscall(), - static_cast(req->path))); + UVException(r, nullptr, req_wrap->syscall(), req->path)); } MaybeLocal filename = From d5d163d8b90d8f7a97ed48c93c908ac800da3945 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Thu, 7 Feb 2019 19:20:25 +0000 Subject: [PATCH 183/223] build: export deprecated OpenSSL symbols on Windows Methods such as `TLSv1_server_method` are categorized as `DEPRECATEDIN_1_1_0`. Add the deprecated categories to the list of categories to include passed to `mkssldef.py`. Adds a regression test to `test/addons/openssl-binding`. PR-URL: https://github.com/nodejs/node/pull/25991 Refs: https://github.com/nodejs/node/issues/20369 Refs: https://github.com/nodejs/node/issues/25981 Reviewed-By: Sam Roberts Reviewed-By: Ben Noordhuis --- node.gyp | 2 +- test/addons/openssl-binding/binding.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/node.gyp b/node.gyp index ae5578b72ec952..a84bd5b7818009 100644 --- a/node.gyp +++ b/node.gyp @@ -709,7 +709,7 @@ '-CAES,BF,BIO,DES,DH,DSA,EC,ECDH,ECDSA,ENGINE,EVP,HMAC,MD4,MD5,' 'PSK,RC2,RC4,RSA,SHA,SHA0,SHA1,SHA256,SHA512,SOCK,STDIO,TLSEXT,' 'FP_API,TLS1_METHOD,TLS1_1_METHOD,TLS1_2_METHOD,SCRYPT,OCSP,' - 'NEXTPROTONEG,RMD160,CAST', + 'NEXTPROTONEG,RMD160,CAST,DEPRECATEDIN_1_1_0,DEPRECATEDIN_1_2_0', # Defines. '-DWIN32', # Symbols to filter from the export list. diff --git a/test/addons/openssl-binding/binding.cc b/test/addons/openssl-binding/binding.cc index 122d420bc14e0b..ecda40f4cb50a3 100644 --- a/test/addons/openssl-binding/binding.cc +++ b/test/addons/openssl-binding/binding.cc @@ -1,6 +1,7 @@ #include #include #include +#include namespace { @@ -28,6 +29,9 @@ inline void Initialize(v8::Local exports, ->GetFunction(context) .ToLocalChecked(); assert(exports->Set(context, key, value).IsJust()); + + const SSL_METHOD* method = TLSv1_2_server_method(); + assert(method != nullptr); } } // anonymous namespace From 0899c8bb32537aabb22b332ed2201dde84739685 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Fri, 18 Jan 2019 15:31:46 +0100 Subject: [PATCH 184/223] http2: improve compat performance This bunch of commits help me improve the performance of a http2 server by 8-10%. The benchmarks reports several 1-2% improvements in various areas. PR-URL: https://github.com/nodejs/node/pull/25567 Reviewed-By: Benedikt Meurer Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- benchmark/http2/compat.js | 35 +++++++++++++++++++++++++++++++++++ lib/internal/http2/compat.js | 4 +--- lib/internal/http2/core.js | 26 ++++++++++++++++++++++---- lib/internal/http2/util.js | 8 ++++++-- src/stream_wrap.cc | 20 +++++++++++++++++++- 5 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 benchmark/http2/compat.js diff --git a/benchmark/http2/compat.js b/benchmark/http2/compat.js new file mode 100644 index 00000000000000..5d06ccf3178257 --- /dev/null +++ b/benchmark/http2/compat.js @@ -0,0 +1,35 @@ +'use strict'; + +const common = require('../common.js'); +const path = require('path'); +const fs = require('fs'); +const file = path.join(path.resolve(__dirname, '../fixtures'), 'alice.html'); + +const bench = common.createBenchmark(main, { + requests: [100, 1000, 5000], + streams: [1, 10, 20, 40, 100, 200], + clients: [2], + benchmarker: ['h2load'] +}, { flags: ['--no-warnings'] }); + +function main({ requests, streams, clients }) { + const http2 = require('http2'); + const server = http2.createServer(); + server.on('request', (req, res) => { + const out = fs.createReadStream(file); + res.setHeader('content-type', 'text/html'); + out.pipe(res); + out.on('error', (err) => { + res.destroy(); + }); + }); + server.listen(common.PORT, () => { + bench.http({ + path: '/', + requests, + maxConcurrentStreams: streams, + clients, + threads: clients + }, () => { server.close(); }); + }); +} diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index 8043bd492a8990..da88f4d880ad67 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -18,18 +18,16 @@ const { ERR_INVALID_HTTP_TOKEN } = require('internal/errors').codes; const { validateString } = require('internal/validators'); -const { kSocket } = require('internal/http2/util'); +const { kSocket, kRequest, kProxySocket } = require('internal/http2/util'); const kBeginSend = Symbol('begin-send'); const kState = Symbol('state'); const kStream = Symbol('stream'); -const kRequest = Symbol('request'); const kResponse = Symbol('response'); const kHeaders = Symbol('headers'); const kRawHeaders = Symbol('rawHeaders'); const kTrailers = Symbol('trailers'); const kRawTrailers = Symbol('rawTrailers'); -const kProxySocket = Symbol('proxySocket'); const kSetHeader = Symbol('setHeader'); const kAborted = Symbol('aborted'); diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index aa7682be4daf46..038c91443c7ea0 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -96,6 +96,8 @@ const { getStreamState, isPayloadMeaningless, kSocket, + kRequest, + kProxySocket, mapToHeaders, NghttpError, sessionName, @@ -119,6 +121,8 @@ const { } = require('internal/timers'); const { isArrayBufferView } = require('internal/util/types'); +const hasOwnProperty = Object.prototype.hasOwnProperty; + const { FileHandle } = internalBinding('fs'); const binding = internalBinding('http2'); const { @@ -157,7 +161,6 @@ const kOwner = owner_symbol; const kOrigin = Symbol('origin'); const kProceed = Symbol('proceed'); const kProtocol = Symbol('protocol'); -const kProxySocket = Symbol('proxy-socket'); const kRemoteSettings = Symbol('remote-settings'); const kSelectPadding = Symbol('select-padding'); const kSentHeaders = Symbol('sent-headers'); @@ -1625,6 +1628,10 @@ class Http2Stream extends Duplex { endAfterHeaders: false }; + // Fields used by the compat API to avoid megamorphisms. + this[kRequest] = null; + this[kProxySocket] = null; + this.on('pause', streamOnPause); } @@ -2004,9 +2011,20 @@ class Http2Stream extends Duplex { } } -function processHeaders(headers) { - assertIsObject(headers, 'headers'); - headers = Object.assign(Object.create(null), headers); +function processHeaders(oldHeaders) { + assertIsObject(oldHeaders, 'headers'); + const headers = Object.create(null); + + if (oldHeaders !== null && oldHeaders !== undefined) { + const hop = hasOwnProperty.bind(oldHeaders); + // This loop is here for performance reason. Do not change. + for (var key in oldHeaders) { + if (hop(key)) { + headers[key] = oldHeaders[key]; + } + } + } + const statusCode = headers[HTTP2_HEADER_STATUS] = headers[HTTP2_HEADER_STATUS] | 0 || HTTP_STATUS_OK; diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index f62d936025229f..0a3faa23557a96 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -10,6 +10,8 @@ const { } = require('internal/errors').codes; const kSocket = Symbol('socket'); +const kProxySocket = Symbol('proxySocket'); +const kRequest = Symbol('request'); const { NGHTTP2_SESSION_CLIENT, @@ -499,12 +501,12 @@ class NghttpError extends Error { } } -function assertIsObject(value, name, types = 'Object') { +function assertIsObject(value, name, types) { if (value !== undefined && (value === null || typeof value !== 'object' || Array.isArray(value))) { - const err = new ERR_INVALID_ARG_TYPE(name, types, value); + const err = new ERR_INVALID_ARG_TYPE(name, types || 'Object', value); Error.captureStackTrace(err, assertIsObject); throw err; } @@ -592,6 +594,8 @@ module.exports = { getStreamState, isPayloadMeaningless, kSocket, + kProxySocket, + kRequest, mapToHeaders, NghttpError, sessionName, diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index e957cb172533c3..d126f90eef829e 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -64,11 +64,29 @@ void LibuvStreamWrap::Initialize(Local target, }; Local sw = FunctionTemplate::New(env->isolate(), is_construct_call_callback); - sw->InstanceTemplate()->SetInternalFieldCount(StreamReq::kStreamReqField + 1); + sw->InstanceTemplate()->SetInternalFieldCount( + StreamReq::kStreamReqField + 1 + 3); Local wrapString = FIXED_ONE_BYTE_STRING(env->isolate(), "ShutdownWrap"); sw->SetClassName(wrapString); + + // we need to set handle and callback to null, + // so that those fields are created and functions + // do not become megamorphic + // Fields: + // - oncomplete + // - callback + // - handle + sw->InstanceTemplate()->Set( + FIXED_ONE_BYTE_STRING(env->isolate(), "oncomplete"), + v8::Null(env->isolate())); + sw->InstanceTemplate()->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "callback"), + v8::Null(env->isolate())); + sw->InstanceTemplate()->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "handle"), + v8::Null(env->isolate())); + sw->Inherit(AsyncWrap::GetConstructorTemplate(env)); + target->Set(env->context(), wrapString, sw->GetFunction(env->context()).ToLocalChecked()).FromJust(); From 7ab34ae421ebfafe32e53d53d4dd9274391a7d9a Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Thu, 7 Feb 2019 16:37:07 +0800 Subject: [PATCH 185/223] src: remove unused method in class Http2Stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/25979 Reviewed-By: Anna Henningsen Reviewed-By: Michaël Zasso --- src/node_http2.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/node_http2.h b/src/node_http2.h index fb90e3ed85111c..61858aecf60962 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -465,10 +465,6 @@ class Http2Stream : public AsyncWrap, void EmitStatistics(); - // Process a Data Chunk - void OnDataChunk(uv_buf_t* chunk); - - // Required for StreamBase int ReadStart() override; From 1764aae19391785592b9685a9da95f18d123dd0f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 8 Feb 2019 19:22:35 +0100 Subject: [PATCH 186/223] worker: pre-allocate thread id Allocate a thread id before actually creating the Environment instance. PR-URL: https://github.com/nodejs/node/pull/26011 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Ben Noordhuis Reviewed-By: Gireesh Punathil Reviewed-By: Joyee Cheung --- src/env.cc | 9 +++++++-- src/env.h | 6 +++++- src/node_worker.cc | 7 ++++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/env.cc b/src/env.cc index 2e0fa251b35350..5507fc7b7ba638 100644 --- a/src/env.cc +++ b/src/env.cc @@ -169,9 +169,14 @@ void Environment::TrackingTraceStateObserver::UpdateTraceCategoryState() { static std::atomic next_thread_id{0}; +uint64_t Environment::AllocateThreadId() { + return next_thread_id++; +} + Environment::Environment(IsolateData* isolate_data, Local context, - Flags flags) + Flags flags, + uint64_t thread_id) : isolate_(context->GetIsolate()), isolate_data_(isolate_data), immediate_info_(context->GetIsolate()), @@ -181,7 +186,7 @@ Environment::Environment(IsolateData* isolate_data, trace_category_state_(isolate_, kTraceCategoryCount), stream_base_state_(isolate_, StreamBase::kNumStreamBaseStateFields), flags_(flags), - thread_id_(next_thread_id++), + thread_id_(thread_id == kNoThreadId ? AllocateThreadId() : thread_id), fs_stats_field_array_(isolate_, kFsStatsBufferLength), fs_stats_field_bigint_array_(isolate_, kFsStatsBufferLength), context_(context->GetIsolate(), context) { diff --git a/src/env.h b/src/env.h index 5560d292468128..48aaa63a39cab4 100644 --- a/src/env.h +++ b/src/env.h @@ -616,7 +616,8 @@ class Environment { Environment(IsolateData* isolate_data, v8::Local context, - Flags flags = Flags()); + Flags flags = Flags(), + uint64_t thread_id = kNoThreadId); ~Environment(); void Start(bool start_profiler_idle_notifier); @@ -767,6 +768,9 @@ class Environment { inline bool has_run_bootstrapping_code() const; inline void set_has_run_bootstrapping_code(bool has_run_bootstrapping_code); + static uint64_t AllocateThreadId(); + static constexpr uint64_t kNoThreadId = -1; + inline bool is_main_thread() const; inline bool owns_process_state() const; inline bool owns_inspector() const; diff --git a/src/node_worker.cc b/src/node_worker.cc index 3fd19de97ce3de..36b4106d137eb5 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -71,7 +71,8 @@ Worker::Worker(Environment* env, Local wrap, const std::string& url, std::shared_ptr per_isolate_opts) - : AsyncWrap(env, wrap, AsyncWrap::PROVIDER_WORKER), url_(url) { + : AsyncWrap(env, wrap, AsyncWrap::PROVIDER_WORKER), url_(url), + thread_id_(Environment::AllocateThreadId()) { Debug(this, "Creating new worker instance at %p", static_cast(this)); // Set up everything that needs to be set up in the parent environment. @@ -114,11 +115,11 @@ Worker::Worker(Environment* env, Context::Scope context_scope(context); // TODO(addaleax): Use CreateEnvironment(), or generally another public API. - env_.reset(new Environment(isolate_data_.get(), context)); + env_.reset(new Environment( + isolate_data_.get(), context, Flags::kNoFlags, thread_id_)); CHECK_NOT_NULL(env_); env_->set_abort_on_uncaught_exception(false); env_->set_worker_context(this); - thread_id_ = env_->thread_id(); env_->Start(env->profiler_idle_notifier_started()); env_->ProcessCliArgs(std::vector{}, From 6c1e92817f9662f18a7b6b581982cced9ad3d5a4 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 8 Feb 2019 19:23:09 +0100 Subject: [PATCH 187/223] worker: set up child Isolate inside Worker thread Refs: https://github.com/nodejs/node/issues/24016 PR-URL: https://github.com/nodejs/node/pull/26011 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Ben Noordhuis Reviewed-By: Gireesh Punathil Reviewed-By: Joyee Cheung --- src/inspector_agent.cc | 14 +- src/inspector_agent.h | 4 +- src/node_worker.cc | 333 ++++++++++++++++++++++------------------- src/node_worker.h | 22 ++- 4 files changed, 201 insertions(+), 172 deletions(-) diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 272f1a986da71f..8d7aad70e600e4 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -885,12 +885,14 @@ bool Agent::IsActive() { return io_ != nullptr || client_->IsActive(); } -void Agent::AddWorkerInspector(int thread_id, - const std::string& url, - Agent* agent) { - CHECK_NOT_NULL(client_); - agent->parent_handle_ = - client_->getWorkerManager()->NewParentHandle(thread_id, url); +void Agent::SetParentHandle( + std::unique_ptr parent_handle) { + parent_handle_ = std::move(parent_handle); +} + +std::unique_ptr Agent::GetParentHandle( + int thread_id, const std::string& url) { + return client_->getWorkerManager()->NewParentHandle(thread_id, url); } void Agent::WaitForConnect() { diff --git a/src/inspector_agent.h b/src/inspector_agent.h index 5e599a6339e903..905b1e2841ebc8 100644 --- a/src/inspector_agent.h +++ b/src/inspector_agent.h @@ -85,7 +85,9 @@ class Agent { void EnableAsyncHook(); void DisableAsyncHook(); - void AddWorkerInspector(int thread_id, const std::string& url, Agent* agent); + void SetParentHandle(std::unique_ptr parent_handle); + std::unique_ptr GetParentHandle( + int thread_id, const std::string& url); // Called to create inspector sessions that can be used from the main thread. // The inspector responds by using the delegate to send messages back. diff --git a/src/node_worker.cc b/src/node_worker.cc index 36b4106d137eb5..ebd1924b8f2479 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -8,6 +8,10 @@ #include "async_wrap.h" #include "async_wrap-inl.h" +#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR +#include "inspector/worker_inspector.h" // ParentInspectorHandle +#endif + #include #include @@ -35,34 +39,21 @@ namespace worker { namespace { #if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR -void StartWorkerInspector(Environment* child, const std::string& url) { +void StartWorkerInspector( + Environment* child, + std::unique_ptr parent_handle, + const std::string& url) { + child->inspector_agent()->SetParentHandle(std::move(parent_handle)); child->inspector_agent()->Start(url, child->options()->debug_options(), child->inspector_host_port(), false); } -void AddWorkerInspector(Environment* parent, - Environment* child, - int id, - const std::string& url) { - parent->inspector_agent()->AddWorkerInspector(id, url, - child->inspector_agent()); -} - void WaitForWorkerInspectorToStop(Environment* child) { child->inspector_agent()->WaitForDisconnect(); child->inspector_agent()->Stop(); } - -#else -// No-ops -void StartWorkerInspector(Environment* child, const std::string& url) {} -void AddWorkerInspector(Environment* parent, - Environment* child, - int id, - const std::string& url) {} -void WaitForWorkerInspectorToStop(Environment* child) {} #endif } // anonymous namespace @@ -71,9 +62,13 @@ Worker::Worker(Environment* env, Local wrap, const std::string& url, std::shared_ptr per_isolate_opts) - : AsyncWrap(env, wrap, AsyncWrap::PROVIDER_WORKER), url_(url), + : AsyncWrap(env, wrap, AsyncWrap::PROVIDER_WORKER), + url_(url), + per_isolate_opts_(per_isolate_opts), + platform_(env->isolate_data()->platform()), + profiler_idle_notifier_started_(env->profiler_idle_notifier_started()), thread_id_(Environment::AllocateThreadId()) { - Debug(this, "Creating new worker instance at %p", static_cast(this)); + Debug(this, "Creating new worker instance with thread id %llu", thread_id_); // Set up everything that needs to be set up in the parent environment. parent_port_ = MessagePort::New(env, env->context()); @@ -89,57 +84,17 @@ Worker::Worker(Environment* env, env->message_port_string(), parent_port_->object()).FromJust(); - array_buffer_allocator_.reset(CreateArrayBufferAllocator()); - - CHECK_EQ(uv_loop_init(&loop_), 0); - isolate_ = NewIsolate(array_buffer_allocator_.get(), &loop_); - CHECK_NOT_NULL(isolate_); - - { - // Enter an environment capable of executing code in the child Isolate - // (and only in it). - Locker locker(isolate_); - Isolate::Scope isolate_scope(isolate_); - HandleScope handle_scope(isolate_); - - isolate_data_.reset(CreateIsolateData(isolate_, - &loop_, - env->isolate_data()->platform(), - array_buffer_allocator_.get())); - if (per_isolate_opts != nullptr) { - isolate_data_->set_options(per_isolate_opts); - } - CHECK(isolate_data_); - - Local context = NewContext(isolate_); - Context::Scope context_scope(context); - - // TODO(addaleax): Use CreateEnvironment(), or generally another public API. - env_.reset(new Environment( - isolate_data_.get(), context, Flags::kNoFlags, thread_id_)); - CHECK_NOT_NULL(env_); - env_->set_abort_on_uncaught_exception(false); - env_->set_worker_context(this); - - env_->Start(env->profiler_idle_notifier_started()); - env_->ProcessCliArgs(std::vector{}, - std::vector{}); - // Done while on the parent thread - AddWorkerInspector(env, env_.get(), thread_id_, url_); - } - - // The new isolate won't be bothered on this thread again. - isolate_->DiscardThreadSpecificMetadata(); - - wrap->Set(env->context(), - env->thread_id_string(), - Number::New(env->isolate(), static_cast(thread_id_))) + object()->Set(env->context(), + env->thread_id_string(), + Number::New(env->isolate(), static_cast(thread_id_))) .FromJust(); - Debug(this, - "Set up worker at %p with id %llu", - static_cast(this), - thread_id_); +#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR + inspector_parent_handle_ = + env->inspector_agent()->GetParentHandle(thread_id_, url); +#endif + + Debug(this, "Preparation for worker %llu finished", thread_id_); } bool Worker::is_stopped() const { @@ -147,14 +102,79 @@ bool Worker::is_stopped() const { return stopped_; } +// This class contains data that is only relevant to the child thread itself, +// and only while it is running. +// (Eventually, the Environment instance should probably also be moved here.) +class WorkerThreadData { + public: + explicit WorkerThreadData(Worker* w) + : w_(w), + array_buffer_allocator_(CreateArrayBufferAllocator()) { + CHECK_EQ(uv_loop_init(&loop_), 0); + + Isolate* isolate = NewIsolate(array_buffer_allocator_.get(), &loop_); + CHECK_NOT_NULL(isolate); + + { + Locker locker(isolate); + Isolate::Scope isolate_scope(isolate); + HandleScope handle_scope(isolate); + isolate_data_.reset(CreateIsolateData(isolate, + &loop_, + w_->platform_, + array_buffer_allocator_.get())); + CHECK(isolate_data_); + if (w_->per_isolate_opts_) + isolate_data_->set_options(std::move(w_->per_isolate_opts_)); + } + + Mutex::ScopedLock lock(w_->mutex_); + w_->isolate_ = isolate; + } + + ~WorkerThreadData() { + Debug(w_, "Worker %llu dispose isolate", w_->thread_id_); + Isolate* isolate; + { + Mutex::ScopedLock lock(w_->mutex_); + isolate = w_->isolate_; + w_->isolate_ = nullptr; + } + + w_->platform_->CancelPendingDelayedTasks(isolate); + + isolate_data_.reset(); + w_->platform_->UnregisterIsolate(isolate); + + isolate->Dispose(); + + // Need to run the loop one more time to close the platform's uv_async_t + uv_run(&loop_, UV_RUN_ONCE); + + CheckedUvLoopClose(&loop_); + } + + private: + Worker* const w_; + uv_loop_t loop_; + DeleteFnPtr + array_buffer_allocator_; + DeleteFnPtr isolate_data_; + + friend class Worker; +}; + void Worker::Run() { std::string name = "WorkerThread "; name += std::to_string(thread_id_); TRACE_EVENT_METADATA1( "__metadata", "thread_name", "name", TRACE_STR_COPY(name.c_str())); - MultiIsolatePlatform* platform = isolate_data_->platform(); - CHECK_NOT_NULL(platform); + CHECK_NOT_NULL(platform_); + + Debug(this, "Creating isolate for worker with id %llu", thread_id_); + + WorkerThreadData data(this); Debug(this, "Starting worker with id %llu", thread_id_); { @@ -163,10 +183,73 @@ void Worker::Run() { SealHandleScope outer_seal(isolate_); bool inspector_started = false; + DeleteFnPtr env_; + OnScopeLeave cleanup_env([&]() { + if (!env_) return; + env_->set_can_call_into_js(false); + Isolate::DisallowJavascriptExecutionScope disallow_js(isolate_, + Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE); + + // Grab the parent-to-child channel and render is unusable. + MessagePort* child_port; + { + Mutex::ScopedLock lock(mutex_); + child_port = child_port_; + child_port_ = nullptr; + } + + { + Context::Scope context_scope(env_->context()); + if (child_port != nullptr) + child_port->Close(); + env_->stop_sub_worker_contexts(); + env_->RunCleanup(); + RunAtExit(env_.get()); +#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR + if (inspector_started) + WaitForWorkerInspectorToStop(env_.get()); +#endif + + { + Mutex::ScopedLock stopped_lock(stopped_mutex_); + stopped_ = true; + } + + env_->RunCleanup(); + + // This call needs to be made while the `Environment` is still alive + // because we assume that it is available for async tracking in the + // NodePlatform implementation. + platform_->DrainTasks(isolate_); + } + }); + { - Context::Scope context_scope(env_->context()); HandleScope handle_scope(isolate_); + Local context = NewContext(isolate_); + if (is_stopped()) return; + + CHECK(!context.IsEmpty()); + Context::Scope context_scope(context); + { + // TODO(addaleax): Use CreateEnvironment(), or generally another + // public API. + env_.reset(new Environment(data.isolate_data_.get(), + context, + Environment::kNoFlags, + thread_id_)); + CHECK_NOT_NULL(env_); + env_->set_abort_on_uncaught_exception(false); + env_->set_worker_context(this); + + env_->Start(profiler_idle_notifier_started_); + env_->ProcessCliArgs(std::vector{}, + std::vector{}); + } + + Debug(this, "Created Environment for worker with id %llu", thread_id_); + if (is_stopped()) return; { HandleScope handle_scope(isolate_); Mutex::ScopedLock lock(mutex_); @@ -182,8 +265,13 @@ void Worker::Run() { Debug(this, "Created message port for worker %llu", thread_id_); } - if (!is_stopped()) { - StartWorkerInspector(env_.get(), url_); + if (is_stopped()) return; + { +#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR + StartWorkerInspector(env_.get(), + std::move(inspector_parent_handle_), + url_); +#endif inspector_started = true; HandleScope handle_scope(isolate_); @@ -198,6 +286,7 @@ void Worker::Run() { Debug(this, "Loaded environment for worker %llu", thread_id_); } + if (is_stopped()) return; { SealHandleScope seal(isolate_); bool more; @@ -205,12 +294,12 @@ void Worker::Run() { node::performance::NODE_PERFORMANCE_MILESTONE_LOOP_START); do { if (is_stopped()) break; - uv_run(&loop_, UV_RUN_DEFAULT); + uv_run(&data.loop_, UV_RUN_DEFAULT); if (is_stopped()) break; - platform->DrainTasks(isolate_); + platform_->DrainTasks(isolate_); - more = uv_loop_alive(&loop_); + more = uv_loop_alive(&data.loop_); if (more && !is_stopped()) continue; @@ -218,7 +307,7 @@ void Worker::Run() { // Emit `beforeExit` if the loop became alive either after emitting // event, or after running some callbacks. - more = uv_loop_alive(&loop_); + more = uv_loop_alive(&data.loop_); } while (more == true); env_->performance_state()->Mark( node::performance::NODE_PERFORMANCE_MILESTONE_LOOP_EXIT); @@ -237,79 +326,11 @@ void Worker::Run() { Debug(this, "Exiting thread for worker %llu with exit code %d", thread_id_, exit_code_); } - - env_->set_can_call_into_js(false); - Isolate::DisallowJavascriptExecutionScope disallow_js(isolate_, - Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE); - - // Grab the parent-to-child channel and render is unusable. - MessagePort* child_port; - { - Mutex::ScopedLock lock(mutex_); - child_port = child_port_; - child_port_ = nullptr; - } - - { - Context::Scope context_scope(env_->context()); - child_port->Close(); - env_->stop_sub_worker_contexts(); - env_->RunCleanup(); - RunAtExit(env_.get()); - if (inspector_started) - WaitForWorkerInspectorToStop(env_.get()); - - { - Mutex::ScopedLock stopped_lock(stopped_mutex_); - stopped_ = true; - } - - env_->RunCleanup(); - - // This call needs to be made while the `Environment` is still alive - // because we assume that it is available for async tracking in the - // NodePlatform implementation. - platform->DrainTasks(isolate_); - } - - env_.reset(); - } - - DisposeIsolate(); - - { - Mutex::ScopedLock lock(mutex_); - CHECK(thread_exit_async_); - scheduled_on_thread_stopped_ = true; - uv_async_send(thread_exit_async_.get()); } Debug(this, "Worker %llu thread stops", thread_id_); } -void Worker::DisposeIsolate() { - if (env_) { - CHECK_NOT_NULL(isolate_); - Locker locker(isolate_); - Isolate::Scope isolate_scope(isolate_); - env_.reset(); - } - - if (isolate_ == nullptr) - return; - - Debug(this, "Worker %llu dispose isolate", thread_id_); - CHECK(isolate_data_); - MultiIsolatePlatform* platform = isolate_data_->platform(); - platform->CancelPendingDelayedTasks(isolate_); - - isolate_data_.reset(); - platform->UnregisterIsolate(isolate_); - - isolate_->Dispose(); - isolate_ = nullptr; -} - void Worker::JoinThread() { if (thread_joined_) return; @@ -340,7 +361,6 @@ void Worker::OnThreadStopped() { CHECK(stopped_); } - CHECK_NULL(child_port_); parent_port_ = nullptr; } @@ -370,16 +390,9 @@ Worker::~Worker() { CHECK(stopped_); CHECK(thread_joined_); - CHECK_NULL(child_port_); // This has most likely already happened within the worker thread -- this // is just in case Worker creation failed early. - DisposeIsolate(); - - // Need to run the loop one more time to close the platform's uv_async_t - uv_run(&loop_, UV_RUN_ONCE); - - CheckedUvLoopClose(&loop_); Debug(this, "Worker %llu destroyed", thread_id_); } @@ -476,7 +489,13 @@ void Worker::StartThread(const FunctionCallbackInfo& args) { }), 0); CHECK_EQ(uv_thread_create(&w->tid_, [](void* arg) { - static_cast(arg)->Run(); + Worker* w = static_cast(arg); + w->Run(); + + Mutex::ScopedLock lock(w->mutex_); + CHECK(w->thread_exit_async_); + w->scheduled_on_thread_stopped_ = true; + uv_async_send(w->thread_exit_async_.get()); }, static_cast(w)), 0); } @@ -510,12 +529,12 @@ void Worker::Exit(int code) { Debug(this, "Worker %llu called Exit(%d)", thread_id_, code); if (!stopped_) { - CHECK_NOT_NULL(env_); stopped_ = true; exit_code_ = code; if (child_port_ != nullptr) child_port_->StopEventLoop(); - isolate_->TerminateExecution(); + if (isolate_ != nullptr) + isolate_->TerminateExecution(); } } diff --git a/src/node_worker.h b/src/node_worker.h index 5ba9ceade3dc6b..4d7a7335ca6d63 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -9,6 +9,8 @@ namespace node { namespace worker { +class WorkerThreadData; + // A worker thread, as represented in its parent thread. class Worker : public AsyncWrap { public: @@ -49,17 +51,19 @@ class Worker : public AsyncWrap { private: void OnThreadStopped(); - void DisposeIsolate(); - uv_loop_t loop_; - DeleteFnPtr isolate_data_; - DeleteFnPtr env_; const std::string url_; + + std::shared_ptr per_isolate_opts_; + MultiIsolatePlatform* platform_; v8::Isolate* isolate_ = nullptr; - DeleteFnPtr - array_buffer_allocator_; + bool profiler_idle_notifier_started_; uv_thread_t tid_; +#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR + std::unique_ptr inspector_parent_handle_; +#endif + // This mutex protects access to all variables listed below it. mutable Mutex mutex_; @@ -79,12 +83,14 @@ class Worker : public AsyncWrap { std::unique_ptr child_port_data_; - // The child port is always kept alive by the child Environment's persistent - // handle to it. + // The child port is kept alive by the child Environment's persistent + // handle to it, as long as that child Environment exists. MessagePort* child_port_ = nullptr; // This is always kept alive because the JS object associated with the Worker // instance refers to it via its [kPort] property. MessagePort* parent_port_ = nullptr; + + friend class WorkerThreadData; }; } // namespace worker From 896962fd08d6c40fe86172f9555fe6252cdc3fc4 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 8 Feb 2019 19:13:35 +0100 Subject: [PATCH 188/223] test: add `Worker` + `--prof` regression test Fixes: https://github.com/nodejs/node/issues/24016 PR-URL: https://github.com/nodejs/node/pull/26011 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Ben Noordhuis Reviewed-By: Gireesh Punathil Reviewed-By: Joyee Cheung --- test/parallel/test-worker-prof.js | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 test/parallel/test-worker-prof.js diff --git a/test/parallel/test-worker-prof.js b/test/parallel/test-worker-prof.js new file mode 100644 index 00000000000000..5b0703f5f9b5ca --- /dev/null +++ b/test/parallel/test-worker-prof.js @@ -0,0 +1,41 @@ +'use strict'; +const common = require('../common'); +const tmpdir = require('../common/tmpdir'); +const fs = require('fs'); +const assert = require('assert'); +const { spawnSync } = require('child_process'); +const { Worker } = require('worker_threads'); + +if (!common.isMainThread) + common.skip('process.chdir is not available in Workers'); + +// Test that --prof also tracks Worker threads. +// Refs: https://github.com/nodejs/node/issues/24016 + +if (process.argv[2] === 'child') { + const spin = ` + const start = Date.now(); + while (Date.now() - start < 200); + `; + new Worker(spin, { eval: true }); + eval(spin); + return; +} + +tmpdir.refresh(); +process.chdir(tmpdir.path); +spawnSync(process.execPath, ['--prof', __filename, 'child']); +const logfiles = fs.readdirSync('.').filter((name) => /\.log$/.test(name)); +assert.strictEqual(logfiles.length, 2); // Parent thread + child thread. + +for (const logfile of logfiles) { + const lines = fs.readFileSync(logfile, 'utf8').split('\n'); + const ticks = lines.filter((line) => /^tick,/.test(line)).length; + + // Test that at least 20 ticks have been recorded for both parent and child + // threads. When not tracking Worker threads, only 1 or 2 ticks would + // have been recorded. + // When running locally on x64 Linux, this number is usually at least 150 + // for both threads, so 15 seems like a very safe threshold. + assert(ticks >= 15, `${ticks} >= 15`); +} From 4c22d6eaa1aba14b199f929bb8cf3d8b4759d021 Mon Sep 17 00:00:00 2001 From: Lance Ball Date: Fri, 1 Feb 2019 12:49:16 -0500 Subject: [PATCH 189/223] repl: add repl.setupHistory for programmatic repl Adds a `repl.setupHistory()` instance method so that programmatic REPLs can also write history to a file. This change also refactors all of the history file management to `lib/internal/repl/history.js`, cleaning up and simplifying `lib/internal/repl.js`. PR-URL: https://github.com/nodejs/node/pull/25895 Reviewed-By: Daniel Bevenius --- doc/api/repl.md | 16 ++ lib/internal/repl.js | 160 +----------- lib/internal/repl/history.js | 153 +++++++++++ lib/repl.js | 5 + node.gyp | 1 + .../test-repl-programmatic-history.js | 245 ++++++++++++++++++ 6 files changed, 422 insertions(+), 158 deletions(-) create mode 100644 lib/internal/repl/history.js create mode 100644 test/parallel/test-repl-programmatic-history.js diff --git a/doc/api/repl.md b/doc/api/repl.md index 60adbf641d1592..4395193de20326 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -448,6 +448,22 @@ deprecated: v9.0.0 An internal method used to parse and execute `REPLServer` keywords. Returns `true` if `keyword` is a valid keyword, otherwise `false`. +### replServer.setupHistory(historyPath, callback) + + +* `historyPath` {string} the path to the history file +* `callback` {Function} called when history writes are ready or upon error + * `err` {Error} + * `repl` {repl.REPLServer} + +Initializes a history log file for the REPL instance. When executing the +Node.js binary and using the command line REPL, a history file is initialized +by default. However, this is not the case when creating a REPL +programmatically. Use this method to initialize a history log file when working +with REPL instances programmatically. + ## repl.start([options]) * `options` {Object} * `resolution` {number} The sampling rate in milliseconds. Must be greater - than zero. Defaults to `10`. + than zero. **Default:** `10`. * Returns: {Histogram} Creates a `Histogram` object that samples and reports the event loop delay @@ -421,7 +421,7 @@ detect. const { monitorEventLoopDelay } = require('perf_hooks'); const h = monitorEventLoopDelay({ resolution: 20 }); h.enable(); -// Do something +// Do something. h.disable(); console.log(h.min); console.log(h.max); @@ -459,21 +459,30 @@ Enables the event loop delay sample timer. Returns `true` if the timer was started, `false` if it was already started. #### histogram.exceeds + -* Value: {number} +* {number} The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold. #### histogram.max + -* Value: {number} +* {number} The maximum recorded event loop delay. #### histogram.mean + -* Value: {number} +* {number} The mean of the recorded event loop delays. @@ -482,19 +491,26 @@ The mean of the recorded event loop delays. added: REPLACEME --> -* Value: {number} +* {number} The minimum recorded event loop delay. #### histogram.percentile(percentile) + * `percentile` {number} A percentile value between 1 and 100. +* Returns: {number} Returns the value at the given percentile. #### histogram.percentiles + -* Value: {Map} +* {Map} Returns a `Map` object detailing the accumulated percentile distribution. @@ -506,8 +522,11 @@ added: REPLACEME Resets the collected histogram data. #### histogram.stddev + -* Value: {number} +* {number} The standard deviation of the recorded event loop delays. diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index ffbec9115c272e..c11ec2604d018b 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -75,8 +75,6 @@ const customTypesMap = { 'fs.Stats': 'fs.html#fs_class_fs_stats', 'fs.WriteStream': 'fs.html#fs_class_fs_writestream', - 'Histogram': 'perf_hooks.html#perf_hooks_class_histogram', - 'http.Agent': 'http.html#http_class_http_agent', 'http.ClientRequest': 'http.html#http_class_http_clientrequest', 'http.IncomingMessage': 'http.html#http_class_http_incomingmessage', @@ -107,6 +105,7 @@ const customTypesMap = { 'os.constants.dlopen': 'os.html#os_dlopen_constants', + 'Histogram': 'perf_hooks.html#perf_hooks_class_histogram', 'PerformanceEntry': 'perf_hooks.html#perf_hooks_class_performanceentry', 'PerformanceNodeTiming': 'perf_hooks.html#perf_hooks_class_performancenodetiming_extends_performanceentry', // eslint-disable-line max-len From 731c2731d22951e99d4c86e323c442961a11b943 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 7 Feb 2019 21:18:25 +0100 Subject: [PATCH 195/223] src: add WeakReference utility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a simple `WeakReference` utility that we can use until the language provides something on its own. PR-URL: https://github.com/nodejs/node/pull/25993 Fixes: https://github.com/nodejs/node/issues/23862 Reviewed-By: Matteo Collina Reviewed-By: Ruben Bridgewater Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Vladimir de Turckheim Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: Refael Ackermann --- src/node_util.cc | 43 +++++++++++++++++++ .../test-internal-util-weakreference.js | 17 ++++++++ 2 files changed, 60 insertions(+) create mode 100644 test/parallel/test-internal-util-weakreference.js diff --git a/src/node_util.cc b/src/node_util.cc index 2a7d90cfe2b661..4cca0cbb72aed0 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -1,6 +1,7 @@ #include "node_errors.h" #include "node_watchdog.h" #include "util.h" +#include "base_object-inl.h" namespace node { namespace util { @@ -11,6 +12,7 @@ using v8::Boolean; using v8::Context; using v8::Function; using v8::FunctionCallbackInfo; +using v8::FunctionTemplate; using v8::IndexFilter; using v8::Integer; using v8::Isolate; @@ -181,6 +183,37 @@ void EnqueueMicrotask(const FunctionCallbackInfo& args) { isolate->EnqueueMicrotask(args[0].As()); } +class WeakReference : public BaseObject { + public: + WeakReference(Environment* env, Local object, Local target) + : BaseObject(env, object) { + MakeWeak(); + target_.Reset(env->isolate(), target); + target_.SetWeak(); + } + + static void New(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + CHECK(args.IsConstructCall()); + CHECK(args[0]->IsObject()); + new WeakReference(env, args.This(), args[0].As()); + } + + static void Get(const FunctionCallbackInfo& args) { + WeakReference* weak_ref = Unwrap(args.Holder()); + Isolate* isolate = args.GetIsolate(); + if (!weak_ref->target_.IsEmpty()) + args.GetReturnValue().Set(weak_ref->target_.Get(isolate)); + } + + SET_MEMORY_INFO_NAME(WeakReference) + SET_SELF_SIZE(WeakReference) + SET_NO_MEMORY_INFO() + + private: + Persistent target_; +}; + void Initialize(Local target, Local unused, Local context, @@ -241,6 +274,16 @@ void Initialize(Local target, should_abort_on_uncaught_toggle, env->should_abort_on_uncaught_toggle().GetJSArray()) .FromJust()); + + Local weak_ref_string = + FIXED_ONE_BYTE_STRING(env->isolate(), "WeakReference"); + Local weak_ref = + env->NewFunctionTemplate(WeakReference::New); + weak_ref->InstanceTemplate()->SetInternalFieldCount(1); + weak_ref->SetClassName(weak_ref_string); + env->SetProtoMethod(weak_ref, "get", WeakReference::Get); + target->Set(context, weak_ref_string, + weak_ref->GetFunction(context).ToLocalChecked()).FromJust(); } } // namespace util diff --git a/test/parallel/test-internal-util-weakreference.js b/test/parallel/test-internal-util-weakreference.js new file mode 100644 index 00000000000000..b48b34fe2309ea --- /dev/null +++ b/test/parallel/test-internal-util-weakreference.js @@ -0,0 +1,17 @@ +// Flags: --expose-internals --expose-gc +'use strict'; +require('../common'); +const assert = require('assert'); +const { internalBinding } = require('internal/test/binding'); +const { WeakReference } = internalBinding('util'); + +let obj = { hello: 'world' }; +const ref = new WeakReference(obj); +assert.strictEqual(ref.get(), obj); + +setImmediate(() => { + obj = null; + global.gc(); + + assert.strictEqual(ref.get(), undefined); +}); From 60c5099f4b6b67fa7723f1b39ecbc6a75dc320ea Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 7 Feb 2019 21:19:07 +0100 Subject: [PATCH 196/223] domain: avoid circular memory references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid circular references that the JS engine cannot see through because it involves an `async id` ⇒ `domain` link. Using weak references is not a great solution, because it increases the domain module’s dependency on internals and the added calls into C++ may affect performance, but it seems like the least bad one. PR-URL: https://github.com/nodejs/node/pull/25993 Fixes: https://github.com/nodejs/node/issues/23862 Reviewed-By: Matteo Collina Reviewed-By: Ruben Bridgewater Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Vladimir de Turckheim Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: Refael Ackermann --- lib/domain.js | 13 +++++-- .../parallel/test-domain-async-id-map-leak.js | 36 +++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 test/parallel/test-domain-async-id-map-leak.js diff --git a/lib/domain.js b/lib/domain.js index a60147b49eacbd..5032fd8e454c42 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -35,6 +35,10 @@ const { } = require('internal/errors').codes; const { createHook } = require('async_hooks'); +// TODO(addaleax): Use a non-internal solution for this. +const kWeak = Symbol('kWeak'); +const { WeakReference } = internalBinding('util'); + // Overwrite process.domain with a getter/setter that will allow for more // effective optimizations var _domain = [null]; @@ -53,7 +57,7 @@ const asyncHook = createHook({ init(asyncId, type, triggerAsyncId, resource) { if (process.domain !== null && process.domain !== undefined) { // If this operation is created while in a domain, let's mark it - pairing.set(asyncId, process.domain); + pairing.set(asyncId, process.domain[kWeak]); resource.domain = process.domain; if (resource.promise !== undefined && resource.promise instanceof Promise) { @@ -67,13 +71,15 @@ const asyncHook = createHook({ before(asyncId) { const current = pairing.get(asyncId); if (current !== undefined) { // enter domain for this cb - current.enter(); + // We will get the domain through current.get(), because the resource + // object's .domain property makes sure it is not garbage collected. + current.get().enter(); } }, after(asyncId) { const current = pairing.get(asyncId); if (current !== undefined) { // exit domain for this cb - current.exit(); + current.get().exit(); } }, destroy(asyncId) { @@ -174,6 +180,7 @@ class Domain extends EventEmitter { super(); this.members = []; + this[kWeak] = new WeakReference(this); asyncHook.enable(); this.on('removeListener', updateExceptionCapture); diff --git a/test/parallel/test-domain-async-id-map-leak.js b/test/parallel/test-domain-async-id-map-leak.js new file mode 100644 index 00000000000000..e720241841d130 --- /dev/null +++ b/test/parallel/test-domain-async-id-map-leak.js @@ -0,0 +1,36 @@ +// Flags: --expose-gc +'use strict'; +const common = require('../common'); +const onGC = require('../common/ongc'); +const assert = require('assert'); +const async_hooks = require('async_hooks'); +const domain = require('domain'); +const EventEmitter = require('events'); + +// This test makes sure that the (async id → domain) map which is part of the +// domain module does not get in the way of garbage collection. +// See: https://github.com/nodejs/node/issues/23862 + +let d = domain.create(); +d.run(() => { + const resource = new async_hooks.AsyncResource('TestResource'); + const emitter = new EventEmitter(); + + d.remove(emitter); + d.add(emitter); + + emitter.linkToResource = resource; + assert.strictEqual(emitter.domain, d); + assert.strictEqual(resource.domain, d); + + // This would otherwise be a circular chain now: + // emitter → resource → async id ⇒ domain → emitter. + // Make sure that all of these objects are released: + + onGC(resource, { ongc: common.mustCall() }); + onGC(d, { ongc: common.mustCall() }); + onGC(emitter, { ongc: common.mustCall() }); +}); + +d = null; +global.gc(); From adaa2ae70b80bebebe05d1e09c36072fe4b67779 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 8 Feb 2019 20:47:20 +0100 Subject: [PATCH 197/223] src: add lock to inspector `MainThreadHandle` dtor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, the `CHECK` is reported to be a race condition by automated tooling. It’s not easy to tell from looking at the source code whether that is actually the case or not, but adding this lock should be a safe way to resolve it. PR-URL: https://github.com/nodejs/node/pull/26010 Reviewed-By: Eugene Ostroukhov Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- src/inspector/main_thread_interface.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/inspector/main_thread_interface.h b/src/inspector/main_thread_interface.h index 3e8eb13645b009..a7d9f8a3c939d8 100644 --- a/src/inspector/main_thread_interface.h +++ b/src/inspector/main_thread_interface.h @@ -45,6 +45,7 @@ class MainThreadHandle : public std::enable_shared_from_this { : main_thread_(main_thread) { } ~MainThreadHandle() { + Mutex::ScopedLock scoped_lock(block_lock_); CHECK_NULL(main_thread_); // main_thread_ should have called Reset } std::unique_ptr Connect( From 61330b2f849c1b2dc829b93dac283b9bc086c1a4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 9 Feb 2019 20:57:36 -0800 Subject: [PATCH 198/223] test: add assert test for position indicator This test adds coverage for a ternary in assertion_error.js that checks if stderr is a TTY. PR-URL: https://github.com/nodejs/node/pull/26024 Reviewed-By: Colin Ihrig Reviewed-By: Anto Aravinth --- .../test-assert-position-indicator.js | 18 ++++++++++++++++++ .../test-assert-position-indicator.out | 0 2 files changed, 18 insertions(+) create mode 100644 test/pseudo-tty/test-assert-position-indicator.js create mode 100644 test/pseudo-tty/test-assert-position-indicator.out diff --git a/test/pseudo-tty/test-assert-position-indicator.js b/test/pseudo-tty/test-assert-position-indicator.js new file mode 100644 index 00000000000000..26f82b5b13fb1b --- /dev/null +++ b/test/pseudo-tty/test-assert-position-indicator.js @@ -0,0 +1,18 @@ +'use strict'; +require('../common'); +const assert = require('assert'); + +process.env.NODE_DISABLE_COLORS = true; +process.stderr.columns = 20; + +// Confirm that there is no position indicator. +assert.throws( + () => { assert.deepStrictEqual('a'.repeat(30), 'a'.repeat(31)); }, + (err) => !err.message.includes('^') +); + +// Confirm that there is a position indicator. +assert.throws( + () => { assert.deepStrictEqual('aaa', 'aaaa'); }, + (err) => err.message.includes('^') +); diff --git a/test/pseudo-tty/test-assert-position-indicator.out b/test/pseudo-tty/test-assert-position-indicator.out new file mode 100644 index 00000000000000..e69de29bb2d1d6 From 6323a9fc57f17366f6c0e5dc10dab66c0f0a862b Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sun, 13 Jan 2019 15:30:50 +0100 Subject: [PATCH 199/223] test: refactor two http client timeout tests Refactor test-http-client-set-timeout and test-http-client-timeout-option-with-agent. PR-URL: https://github.com/nodejs/node/pull/25473 Reviewed-By: Rich Trott Reviewed-By: James M Snell --- test/parallel/test-http-client-set-timeout.js | 70 ++++++++++--------- ...t-http-client-timeout-option-with-agent.js | 65 ++++------------- 2 files changed, 51 insertions(+), 84 deletions(-) diff --git a/test/parallel/test-http-client-set-timeout.js b/test/parallel/test-http-client-set-timeout.js index 51284b42765493..15aae7023bf3f1 100644 --- a/test/parallel/test-http-client-set-timeout.js +++ b/test/parallel/test-http-client-set-timeout.js @@ -1,46 +1,48 @@ 'use strict'; -const common = require('../common'); -// Test that `req.setTimeout` will fired exactly once. +// Test that the `'timeout'` event is emitted exactly once if the `timeout` +// option and `request.setTimeout()` are used together. -const assert = require('assert'); -const http = require('http'); +const { expectsError, mustCall } = require('../common'); +const { strictEqual } = require('assert'); +const { createServer, get } = require('http'); -const HTTP_CLIENT_TIMEOUT = 2000; - -const options = { - method: 'GET', - port: undefined, - host: '127.0.0.1', - path: '/', - timeout: HTTP_CLIENT_TIMEOUT, -}; - -const server = http.createServer(() => { +const server = createServer(() => { // Never respond. }); -server.listen(0, options.host, function() { - doRequest(); -}); - -function doRequest() { - options.port = server.address().port; - const req = http.request(options); - req.setTimeout(HTTP_CLIENT_TIMEOUT / 2); - req.on('error', () => { - // This space is intentionally left blank. +server.listen(0, mustCall(() => { + const req = get({ + port: server.address().port, + timeout: 2000, }); - req.on('close', common.mustCall(() => server.close())); - let timeout_events = 0; - req.on('timeout', common.mustCall(() => { - timeout_events += 1; + req.setTimeout(1000); + + req.on('socket', mustCall((socket) => { + strictEqual(socket.timeout, 2000); + + socket.on('connect', mustCall(() => { + strictEqual(socket.timeout, 1000); + + // Reschedule the timer to not wait 1 sec and make the test finish faster. + socket.setTimeout(10); + strictEqual(socket.timeout, 10); + })); + })); + + req.on('error', expectsError({ + type: Error, + code: 'ECONNRESET', + message: 'socket hang up' })); - req.end(); - setTimeout(function() { + req.on('close', mustCall(() => { + server.close(); + })); + + req.on('timeout', mustCall(() => { + strictEqual(req.socket.listenerCount('timeout'), 0); req.destroy(); - assert.strictEqual(timeout_events, 1); - }, common.platformTimeout(HTTP_CLIENT_TIMEOUT)); -} + })); +})); diff --git a/test/parallel/test-http-client-timeout-option-with-agent.js b/test/parallel/test-http-client-timeout-option-with-agent.js index 11a2db419c3529..594dd1215f43e5 100644 --- a/test/parallel/test-http-client-timeout-option-with-agent.js +++ b/test/parallel/test-http-client-timeout-option-with-agent.js @@ -1,58 +1,23 @@ 'use strict'; -const common = require('../common'); -// Test that when http request uses both timeout and agent, -// timeout will work as expected. +// Test that the request `timeout` option has precedence over the agent +// `timeout` option. -const assert = require('assert'); -const http = require('http'); +const { mustCall } = require('../common'); +const { Agent, get } = require('http'); +const { strictEqual } = require('assert'); -const HTTP_AGENT_TIMEOUT = 1000; -const HTTP_CLIENT_TIMEOUT = 3000; - -const agent = new http.Agent({ timeout: HTTP_AGENT_TIMEOUT }); -const options = { - method: 'GET', - port: undefined, - host: '127.0.0.1', - path: '/', - timeout: HTTP_CLIENT_TIMEOUT, - agent, -}; - -const server = http.createServer(() => { - // Never respond. -}); - -server.listen(0, options.host, () => { - doRequest(); +const request = get({ + agent: new Agent({ timeout: 50 }), + lookup: () => {}, + timeout: 100 }); -function doRequest() { - options.port = server.address().port; - const start = process.hrtime.bigint(); - const req = http.request(options); - req.on('error', () => { - // This space is intentionally left blank. - }); - req.on('close', common.mustCall(() => server.close())); +request.on('socket', mustCall((socket) => { + strictEqual(socket.timeout, 100); - let timeout_events = 0; - req.on('timeout', common.mustCall(() => { - timeout_events += 1; - const duration = process.hrtime.bigint() - start; - // The timeout event cannot be precisely timed. It will delay - // some number of milliseconds. - assert.ok( - duration >= BigInt(HTTP_CLIENT_TIMEOUT * 1e6), - `duration ${duration}ms less than timeout ${HTTP_CLIENT_TIMEOUT}ms` - ); - })); - req.end(); + const listeners = socket.listeners('timeout'); - setTimeout(() => { - req.destroy(); - assert.strictEqual(timeout_events, 1); - // Ensure the `timeout` event fired only once. - }, common.platformTimeout(HTTP_CLIENT_TIMEOUT * 2)); -} + strictEqual(listeners.length, 1); + strictEqual(listeners[0], request.timeoutCb); +})); From 1c5fbeab34eb7f116ed6dbd044a4f257cd8cef84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Tue, 29 Jan 2019 14:43:00 -0800 Subject: [PATCH 200/223] deps: upgrade npm to 6.7.0 PR-URL: https://github.com/nodejs/node/pull/25804 Reviewed-By: Myles Borins --- deps/npm/AUTHORS | 7 + deps/npm/CHANGELOG.md | 309 +- deps/npm/doc/cli/npm-access.md | 8 + deps/npm/doc/cli/npm-dist-tag.md | 2 + deps/npm/doc/cli/npm-org.md | 50 + deps/npm/doc/cli/npm-prefix.md | 3 +- deps/npm/doc/cli/npm-token.md | 2 +- deps/npm/doc/misc/npm-index.md | 4 + deps/npm/doc/misc/semver.md | 21 +- deps/npm/html/doc/README.html | 4 +- deps/npm/html/doc/cli/npm-access.html | 10 +- deps/npm/html/doc/cli/npm-adduser.html | 2 +- deps/npm/html/doc/cli/npm-audit.html | 2 +- deps/npm/html/doc/cli/npm-bin.html | 2 +- deps/npm/html/doc/cli/npm-bugs.html | 2 +- deps/npm/html/doc/cli/npm-build.html | 2 +- deps/npm/html/doc/cli/npm-bundle.html | 2 +- deps/npm/html/doc/cli/npm-cache.html | 4 +- deps/npm/html/doc/cli/npm-ci.html | 2 +- deps/npm/html/doc/cli/npm-completion.html | 2 +- deps/npm/html/doc/cli/npm-config.html | 2 +- deps/npm/html/doc/cli/npm-dedupe.html | 2 +- deps/npm/html/doc/cli/npm-deprecate.html | 2 +- deps/npm/html/doc/cli/npm-dist-tag.html | 3 +- deps/npm/html/doc/cli/npm-docs.html | 2 +- deps/npm/html/doc/cli/npm-doctor.html | 6 +- deps/npm/html/doc/cli/npm-edit.html | 2 +- deps/npm/html/doc/cli/npm-explore.html | 2 +- deps/npm/html/doc/cli/npm-help-search.html | 2 +- deps/npm/html/doc/cli/npm-help.html | 2 +- deps/npm/html/doc/cli/npm-hook.html | 2 +- deps/npm/html/doc/cli/npm-init.html | 2 +- .../npm/html/doc/cli/npm-install-ci-test.html | 2 +- deps/npm/html/doc/cli/npm-install-test.html | 2 +- deps/npm/html/doc/cli/npm-install.html | 4 +- deps/npm/html/doc/cli/npm-link.html | 2 +- deps/npm/html/doc/cli/npm-logout.html | 2 +- deps/npm/html/doc/cli/npm-ls.html | 8 +- deps/npm/html/doc/cli/npm-org.html | 43 + deps/npm/html/doc/cli/npm-outdated.html | 2 +- deps/npm/html/doc/cli/npm-owner.html | 2 +- deps/npm/html/doc/cli/npm-pack.html | 2 +- deps/npm/html/doc/cli/npm-ping.html | 2 +- deps/npm/html/doc/cli/npm-prefix.html | 5 +- deps/npm/html/doc/cli/npm-profile.html | 2 +- deps/npm/html/doc/cli/npm-prune.html | 2 +- deps/npm/html/doc/cli/npm-publish.html | 2 +- deps/npm/html/doc/cli/npm-rebuild.html | 2 +- deps/npm/html/doc/cli/npm-repo.html | 2 +- deps/npm/html/doc/cli/npm-restart.html | 2 +- deps/npm/html/doc/cli/npm-root.html | 2 +- deps/npm/html/doc/cli/npm-run-script.html | 2 +- deps/npm/html/doc/cli/npm-search.html | 4 +- deps/npm/html/doc/cli/npm-shrinkwrap.html | 2 +- deps/npm/html/doc/cli/npm-star.html | 2 +- deps/npm/html/doc/cli/npm-stars.html | 2 +- deps/npm/html/doc/cli/npm-start.html | 2 +- deps/npm/html/doc/cli/npm-stop.html | 2 +- deps/npm/html/doc/cli/npm-team.html | 2 +- deps/npm/html/doc/cli/npm-test.html | 2 +- deps/npm/html/doc/cli/npm-token.html | 51 +- deps/npm/html/doc/cli/npm-uninstall.html | 2 +- deps/npm/html/doc/cli/npm-unpublish.html | 2 +- deps/npm/html/doc/cli/npm-update.html | 4 +- deps/npm/html/doc/cli/npm-version.html | 2 +- deps/npm/html/doc/cli/npm-view.html | 2 +- deps/npm/html/doc/cli/npm-whoami.html | 2 +- deps/npm/html/doc/cli/npm.html | 6 +- deps/npm/html/doc/files/npm-folders.html | 4 +- deps/npm/html/doc/files/npm-global.html | 4 +- deps/npm/html/doc/files/npm-json.html | 16 +- .../npm/html/doc/files/npm-package-locks.html | 2 +- .../html/doc/files/npm-shrinkwrap.json.html | 2 +- deps/npm/html/doc/files/npmrc.html | 2 +- .../npm/html/doc/files/package-lock.json.html | 6 +- deps/npm/html/doc/files/package.json.html | 16 +- deps/npm/html/doc/index.html | 154 +- deps/npm/html/doc/misc/npm-coding-style.html | 6 +- deps/npm/html/doc/misc/npm-config.html | 4 +- deps/npm/html/doc/misc/npm-developers.html | 4 +- deps/npm/html/doc/misc/npm-disputes.html | 14 +- deps/npm/html/doc/misc/npm-index.html | 154 +- deps/npm/html/doc/misc/npm-orgs.html | 2 +- deps/npm/html/doc/misc/npm-registry.html | 14 +- deps/npm/html/doc/misc/npm-scope.html | 2 +- deps/npm/html/doc/misc/npm-scripts.html | 6 +- deps/npm/html/doc/misc/removing-npm.html | 2 +- deps/npm/html/doc/misc/semver.html | 37 +- deps/npm/lib/access.js | 216 +- deps/npm/lib/audit.js | 65 +- deps/npm/lib/auth/legacy.js | 72 +- deps/npm/lib/auth/sso.js | 103 +- deps/npm/lib/cache.js | 6 +- deps/npm/lib/ci.js | 35 +- deps/npm/lib/config/cmd-list.js | 5 +- deps/npm/lib/config/defaults.js | 2 +- deps/npm/lib/config/figgy-config.js | 87 + deps/npm/lib/config/pacote.js | 141 - deps/npm/lib/config/reg-client.js | 29 - deps/npm/lib/deprecate.js | 101 +- deps/npm/lib/dist-tag.js | 208 +- deps/npm/lib/doctor/check-ping.js | 8 +- deps/npm/lib/fetch-package-metadata.js | 16 +- deps/npm/lib/hook.js | 203 +- deps/npm/lib/install/action/extract-worker.js | 10 +- deps/npm/lib/install/action/extract.js | 43 +- deps/npm/lib/install/action/fetch.js | 4 +- deps/npm/lib/install/audit.js | 141 +- deps/npm/lib/install/is-only-dev.js | 1 + deps/npm/lib/install/is-only-optional.js | 1 + deps/npm/lib/logout.js | 51 +- deps/npm/lib/npm.js | 16 +- deps/npm/lib/org.js | 151 + deps/npm/lib/outdated.js | 90 +- deps/npm/lib/owner.js | 340 +- deps/npm/lib/pack.js | 6 +- deps/npm/lib/ping.js | 46 +- deps/npm/lib/profile.js | 125 +- deps/npm/lib/publish.js | 188 +- deps/npm/lib/repo.js | 20 +- deps/npm/lib/search.js | 70 +- deps/npm/lib/search/all-package-metadata.js | 290 +- deps/npm/lib/search/all-package-search.js | 2 +- deps/npm/lib/search/esearch.js | 64 - deps/npm/lib/shrinkwrap.js | 2 + deps/npm/lib/star.js | 82 +- deps/npm/lib/stars.js | 66 +- deps/npm/lib/team.js | 157 +- deps/npm/lib/token.js | 2 +- deps/npm/lib/unpublish.js | 201 +- deps/npm/lib/utils/error-handler.js | 2 +- deps/npm/lib/utils/error-message.js | 3 +- deps/npm/lib/utils/get-publish-config.js | 29 - deps/npm/lib/utils/map-to-registry.js | 103 - deps/npm/lib/utils/metrics.js | 34 +- deps/npm/lib/utils/otplease.js | 27 + deps/npm/lib/view.js | 266 +- deps/npm/lib/whoami.js | 80 +- deps/npm/man/man1/npm-README.1 | 2 +- deps/npm/man/man1/npm-access.1 | 11 +- deps/npm/man/man1/npm-adduser.1 | 2 +- deps/npm/man/man1/npm-audit.1 | 2 +- deps/npm/man/man1/npm-bin.1 | 2 +- deps/npm/man/man1/npm-bugs.1 | 2 +- deps/npm/man/man1/npm-build.1 | 2 +- deps/npm/man/man1/npm-bundle.1 | 2 +- deps/npm/man/man1/npm-cache.1 | 2 +- deps/npm/man/man1/npm-ci.1 | 2 +- deps/npm/man/man1/npm-completion.1 | 2 +- deps/npm/man/man1/npm-config.1 | 2 +- deps/npm/man/man1/npm-dedupe.1 | 2 +- deps/npm/man/man1/npm-deprecate.1 | 2 +- deps/npm/man/man1/npm-dist-tag.1 | 3 +- deps/npm/man/man1/npm-docs.1 | 2 +- deps/npm/man/man1/npm-doctor.1 | 2 +- deps/npm/man/man1/npm-edit.1 | 2 +- deps/npm/man/man1/npm-explore.1 | 2 +- deps/npm/man/man1/npm-help-search.1 | 2 +- deps/npm/man/man1/npm-help.1 | 2 +- deps/npm/man/man1/npm-hook.1 | 2 +- deps/npm/man/man1/npm-init.1 | 2 +- deps/npm/man/man1/npm-install-ci-test.1 | 2 +- deps/npm/man/man1/npm-install-test.1 | 2 +- deps/npm/man/man1/npm-install.1 | 2 +- deps/npm/man/man1/npm-link.1 | 2 +- deps/npm/man/man1/npm-logout.1 | 2 +- deps/npm/man/man1/npm-ls.1 | 4 +- deps/npm/man/man1/npm-org.1 | 72 + deps/npm/man/man1/npm-outdated.1 | 2 +- deps/npm/man/man1/npm-owner.1 | 2 +- deps/npm/man/man1/npm-pack.1 | 2 +- deps/npm/man/man1/npm-ping.1 | 2 +- deps/npm/man/man1/npm-prefix.1 | 5 +- deps/npm/man/man1/npm-profile.1 | 2 +- deps/npm/man/man1/npm-prune.1 | 2 +- deps/npm/man/man1/npm-publish.1 | 2 +- deps/npm/man/man1/npm-rebuild.1 | 2 +- deps/npm/man/man1/npm-repo.1 | 2 +- deps/npm/man/man1/npm-restart.1 | 2 +- deps/npm/man/man1/npm-root.1 | 2 +- deps/npm/man/man1/npm-run-script.1 | 2 +- deps/npm/man/man1/npm-search.1 | 2 +- deps/npm/man/man1/npm-shrinkwrap.1 | 2 +- deps/npm/man/man1/npm-star.1 | 2 +- deps/npm/man/man1/npm-stars.1 | 2 +- deps/npm/man/man1/npm-start.1 | 2 +- deps/npm/man/man1/npm-stop.1 | 2 +- deps/npm/man/man1/npm-team.1 | 2 +- deps/npm/man/man1/npm-test.1 | 2 +- deps/npm/man/man1/npm-token.1 | 4 +- deps/npm/man/man1/npm-uninstall.1 | 2 +- deps/npm/man/man1/npm-unpublish.1 | 2 +- deps/npm/man/man1/npm-update.1 | 2 +- deps/npm/man/man1/npm-version.1 | 2 +- deps/npm/man/man1/npm-view.1 | 2 +- deps/npm/man/man1/npm-whoami.1 | 2 +- deps/npm/man/man1/npm.1 | 4 +- deps/npm/man/man5/npm-folders.5 | 2 +- deps/npm/man/man5/npm-global.5 | 2 +- deps/npm/man/man5/npm-json.5 | 2 +- deps/npm/man/man5/npm-package-locks.5 | 2 +- deps/npm/man/man5/npm-shrinkwrap.json.5 | 2 +- deps/npm/man/man5/npmrc.5 | 2 +- deps/npm/man/man5/package-lock.json.5 | 2 +- deps/npm/man/man5/package.json.5 | 2 +- deps/npm/man/man7/npm-coding-style.7 | 2 +- deps/npm/man/man7/npm-config.7 | 2 +- deps/npm/man/man7/npm-developers.7 | 2 +- deps/npm/man/man7/npm-disputes.7 | 2 +- deps/npm/man/man7/npm-index.7 | 5 +- deps/npm/man/man7/npm-orgs.7 | 2 +- deps/npm/man/man7/npm-registry.7 | 2 +- deps/npm/man/man7/npm-scope.7 | 2 +- deps/npm/man/man7/npm-scripts.7 | 2 +- deps/npm/man/man7/removing-npm.7 | 2 +- deps/npm/man/man7/semver.7 | 27 +- deps/npm/node_modules/JSONStream/index.js | 4 +- deps/npm/node_modules/JSONStream/package.json | 27 +- .../node_modules/JSONStream/test/parsejson.js | 6 +- deps/npm/node_modules/JSONStream/test/run.js | 13 + deps/npm/node_modules/aproba/CHANGELOG.md | 4 + deps/npm/node_modules/aproba/index.js | 66 +- deps/npm/node_modules/aproba/package.json | 44 +- .../node_modules}/readable-stream/.travis.yml | 0 .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 2 - .../readable-stream/duplex-browser.js | 0 .../node_modules}/readable-stream/duplex.js | 0 .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 0 .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 81 + .../readable-stream/passthrough.js | 0 .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../readable-stream/transform.js | 0 .../readable-stream/writable-browser.js | 0 .../node_modules}/readable-stream/writable.js | 0 .../node_modules}/string_decoder/.travis.yml | 0 .../node_modules/string_decoder/LICENSE | 47 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 59 + deps/npm/node_modules/byte-size/README.hbs | 28 + deps/npm/node_modules/byte-size/README.md | 30 +- deps/npm/node_modules/byte-size/dist/index.js | 152 + .../byte-size/{index.js => index.mjs} | 15 +- deps/npm/node_modules/byte-size/package.json | 49 +- deps/npm/node_modules/cacache/CHANGELOG.md | 30 + deps/npm/node_modules/cacache/get.js | 51 +- .../node_modules/cacache/lib/entry-index.js | 107 +- .../cacache/lib/util/fix-owner.js | 46 + deps/npm/node_modules/cacache/locales/en.js | 3 + deps/npm/node_modules/cacache/locales/es.js | 3 + .../node_modules/chownr}/LICENSE | 0 .../cacache/node_modules/chownr/README.md | 3 + .../cacache/node_modules/chownr/chownr.js | 88 + .../cacache/node_modules/chownr/package.json | 59 + .../cacache/node_modules/lru-cache/LICENSE | 15 + .../cacache/node_modules/lru-cache/README.md | 166 + .../cacache/node_modules/lru-cache/index.js | 334 + .../node_modules/lru-cache/package.json | 67 + .../node_modules/unique-filename/LICENSE | 5 + .../node_modules/unique-filename/README.md | 33 + .../coverage/__root__/index.html | 73 + .../coverage/__root__/index.js.html | 69 + .../unique-filename/coverage/base.css | 182 + .../unique-filename/coverage/index.html | 73 + .../unique-filename/coverage/prettify.css | 1 + .../unique-filename/coverage/prettify.js | 1 + .../coverage/sort-arrow-sprite.png | Bin 0 -> 209 bytes .../unique-filename/coverage/sorter.js | 156 + .../node_modules/unique-filename/index.js | 8 + .../node_modules/unique-filename/package.json | 56 + .../unique-filename/test/index.js | 23 + .../cacache/node_modules/yallist/LICENSE | 15 + .../cacache/node_modules/yallist/README.md | 204 + .../cacache/node_modules/yallist/iterator.js | 8 + .../cacache/node_modules/yallist/package.json | 62 + .../cacache/node_modules/yallist/yallist.js | 376 + deps/npm/node_modules/cacache/package.json | 44 +- deps/npm/node_modules/chownr/chownr.js | 112 +- deps/npm/node_modules/chownr/package.json | 43 +- deps/npm/node_modules/ci-info/CHANGELOG.md | 16 + deps/npm/node_modules/ci-info/README.md | 73 +- deps/npm/node_modules/ci-info/index.js | 2 +- deps/npm/node_modules/ci-info/package.json | 29 +- deps/npm/node_modules/ci-info/vendors.json | 27 +- deps/npm/node_modules/cidr-regex/index.js | 6 +- deps/npm/node_modules/cidr-regex/package.json | 39 +- deps/npm/node_modules/cli-table3/CHANGELOG.md | 12 +- deps/npm/node_modules/cli-table3/index.d.ts | 95 + deps/npm/node_modules/cli-table3/package.json | 33 +- deps/npm/node_modules/colors/LICENSE | 4 +- deps/npm/node_modules/colors/README.md | 10 +- .../colors/examples/normal-usage.js | 55 +- .../colors/examples/safe-string.js | 50 +- deps/npm/node_modules/colors/index.d.ts | 136 + deps/npm/node_modules/colors/lib/colors.js | 130 +- .../node_modules/colors/lib/custom/trap.js | 71 +- .../node_modules/colors/lib/custom/zalgo.js | 81 +- .../colors/lib/extendStringPrototype.js | 91 +- deps/npm/node_modules/colors/lib/index.js | 7 +- .../node_modules/colors/lib/maps/america.js | 18 +- .../node_modules/colors/lib/maps/rainbow.js | 13 +- .../node_modules/colors/lib/maps/random.js | 14 +- .../npm/node_modules/colors/lib/maps/zebra.js | 10 +- deps/npm/node_modules/colors/lib/styles.js | 6 +- .../colors/lib/system/has-flag.js | 35 + .../colors/lib/system/supports-colors.js | 128 +- deps/npm/node_modules/colors/package.json | 49 +- deps/npm/node_modules/colors/safe.d.ts | 48 + deps/npm/node_modules/colors/safe.js | 7 +- .../colors/themes/generic-logging.js | 4 +- .../node_modules/readable-stream/.travis.yml | 55 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 58 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 81 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/string_decoder/.travis.yml | 50 + .../node_modules/string_decoder/LICENSE | 47 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 59 + .../node_modules/aproba/LICENSE | 13 + .../node_modules/aproba/README.md | 93 + .../node_modules/aproba/index.js | 105 + .../node_modules/aproba/package.json | 62 + .../node_modules/readable-stream/.travis.yml | 55 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 58 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 81 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/string_decoder/.travis.yml | 50 + .../node_modules/string_decoder/LICENSE | 47 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 59 + .../node_modules/get-stream/buffer-stream.js | 51 + .../execa/node_modules/get-stream/index.js | 51 + .../node_modules/get-stream/license} | 4 +- .../node_modules/get-stream/package.json | 80 + .../execa/node_modules/get-stream/readme.md | 117 + .../node_modules/figgy-pudding/package.json | 5 +- .../node_modules/readable-stream/.travis.yml | 55 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 58 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 81 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/string_decoder/.travis.yml | 50 + .../node_modules/string_decoder/LICENSE | 47 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 59 + .../node_modules/readable-stream/.travis.yml | 55 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 58 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 81 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/string_decoder/.travis.yml | 50 + .../from2/node_modules/string_decoder/LICENSE | 47 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 59 + .../node_modules/readable-stream/.travis.yml | 55 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 58 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 81 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/string_decoder/.travis.yml | 50 + .../node_modules/string_decoder/LICENSE | 47 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 59 + .../gauge/node_modules/aproba/LICENSE | 13 + .../gauge/node_modules/aproba/README.md | 93 + .../gauge/node_modules/aproba/index.js | 105 + .../gauge/node_modules/aproba/package.json | 62 + deps/npm/node_modules/genfun/CHANGELOG.md | 17 + deps/npm/node_modules/genfun/LICENSE | 20 + deps/npm/node_modules/genfun/lib/method.js | 10 +- deps/npm/node_modules/genfun/package.json | 24 +- .../gentle-fs/node_modules/aproba/LICENSE | 13 + .../gentle-fs/node_modules/aproba/README.md | 93 + .../gentle-fs/node_modules/aproba/index.js | 105 + .../node_modules/aproba/package.json | 62 + .../node_modules/get-stream/buffer-stream.js | 10 +- deps/npm/node_modules/get-stream/index.js | 61 +- deps/npm/node_modules/get-stream/license | 20 +- deps/npm/node_modules/get-stream/package.json | 46 +- deps/npm/node_modules/get-stream/readme.md | 26 +- .../node_modules/get-stream/buffer-stream.js | 51 + .../got/node_modules/get-stream/index.js | 51 + .../got/node_modules/get-stream/license | 21 + .../got/node_modules/get-stream/package.json | 80 + .../got/node_modules/get-stream/readme.md | 117 + .../is-ci/node_modules/ci-info/CHANGELOG.md | 62 + .../is-ci/node_modules/ci-info/LICENSE | 21 + .../is-ci/node_modules/ci-info/README.md | 107 + .../is-ci/node_modules/ci-info/index.js | 66 + .../is-ci/node_modules/ci-info/package.json | 65 + .../is-ci/node_modules/ci-info/vendors.json | 152 + deps/npm/node_modules/is-cidr/README.md | 20 +- deps/npm/node_modules/is-cidr/index.js | 13 +- deps/npm/node_modules/is-cidr/package.json | 37 +- deps/npm/node_modules/libcipm/CHANGELOG.md | 45 + deps/npm/node_modules/libcipm/index.js | 82 +- .../libcipm/lib/config/lifecycle-opts.js | 29 - .../libcipm/lib/config/npm-config.js | 72 +- .../libcipm/lib/config/pacote-opts.js | 135 - deps/npm/node_modules/libcipm/lib/extract.js | 51 +- deps/npm/node_modules/libcipm/lib/worker.js | 6 +- deps/npm/node_modules/libcipm/package.json | 27 +- deps/npm/node_modules/libnpm/CHANGELOG.md | 95 + .../npm-registry-fetch => libnpm}/LICENSE.md | 0 deps/npm/node_modules/libnpm/README.md | 57 + deps/npm/node_modules/libnpm/access.js | 3 + deps/npm/node_modules/libnpm/adduser.js | 3 + deps/npm/node_modules/libnpm/config.js | 3 + deps/npm/node_modules/libnpm/extract.js | 3 + deps/npm/node_modules/libnpm/fetch.js | 3 + deps/npm/node_modules/libnpm/get-prefix.js | 3 + deps/npm/node_modules/libnpm/hook.js | 3 + deps/npm/node_modules/libnpm/index.js | 29 + deps/npm/node_modules/libnpm/link-bin.js | 3 + deps/npm/node_modules/libnpm/log.js | 3 + deps/npm/node_modules/libnpm/logical-tree.js | 3 + deps/npm/node_modules/libnpm/login.js | 3 + deps/npm/node_modules/libnpm/manifest.js | 3 + deps/npm/node_modules/libnpm/org.js | 3 + deps/npm/node_modules/libnpm/package.json | 94 + deps/npm/node_modules/libnpm/packument.js | 3 + deps/npm/node_modules/libnpm/parse-arg.js | 3 + deps/npm/node_modules/libnpm/profile.js | 3 + deps/npm/node_modules/libnpm/publish.js | 3 + deps/npm/node_modules/libnpm/read-json.js | 3 + deps/npm/node_modules/libnpm/run-script.js | 3 + deps/npm/node_modules/libnpm/search.js | 3 + .../node_modules/libnpm/stringify-package.js | 3 + deps/npm/node_modules/libnpm/tarball.js | 3 + deps/npm/node_modules/libnpm/team.js | 3 + deps/npm/node_modules/libnpm/unpublish.js | 3 + deps/npm/node_modules/libnpm/verify-lock.js | 3 + .../npm/node_modules/libnpmaccess/.travis.yml | 7 + .../node_modules/libnpmaccess/CHANGELOG.md | 124 + .../libnpmaccess/CODE_OF_CONDUCT.md | 151 + .../node_modules/libnpmaccess/CONTRIBUTING.md | 256 + deps/npm/node_modules/libnpmaccess/LICENSE | 13 + .../libnpmaccess/PULL_REQUEST_TEMPLATE | 7 + deps/npm/node_modules/libnpmaccess/README.md | 258 + .../node_modules/libnpmaccess/appveyor.yml | 22 + deps/npm/node_modules/libnpmaccess/index.js | 201 + .../node_modules/aproba/CHANGELOG.md | 4 + .../libnpmaccess/node_modules/aproba/LICENSE | 13 + .../node_modules/aproba/README.md | 93 + .../libnpmaccess/node_modules/aproba/index.js | 105 + .../node_modules/aproba/package.json | 66 + .../node_modules/libnpmaccess/package.json | 66 + .../node_modules/libnpmaccess/test/index.js | 347 + .../libnpmaccess/test/util/tnock.js | 12 + .../node_modules/libnpmconfig/CHANGELOG.md | 51 + .../libnpmconfig/CODE_OF_CONDUCT.md | 151 + .../node_modules/libnpmconfig/CONTRIBUTING.md | 256 + deps/npm/node_modules/libnpmconfig/LICENSE | 13 + .../libnpmconfig/PULL_REQUEST_TEMPLATE | 7 + deps/npm/node_modules/libnpmconfig/README.md | 40 + deps/npm/node_modules/libnpmconfig/index.js | 107 + .../node_modules/find-up/index.js | 46 + .../libnpmconfig/node_modules/find-up/license | 9 + .../node_modules/find-up/package.json | 82 + .../node_modules/find-up/readme.md | 87 + .../node_modules/locate-path/index.js | 24 + .../node_modules/locate-path/license | 9 + .../node_modules/locate-path/package.json | 76 + .../node_modules/locate-path/readme.md | 99 + .../node_modules/p-limit/index.js | 49 + .../libnpmconfig/node_modules/p-limit/license | 9 + .../node_modules/p-limit/package.json | 81 + .../node_modules/p-limit/readme.md | 90 + .../node_modules/p-locate/index.js | 34 + .../node_modules/p-locate/license | 9 + .../node_modules/p-locate/package.json | 83 + .../node_modules/p-locate/readme.md | 88 + .../libnpmconfig/node_modules/p-try/index.js | 5 + .../libnpmconfig/node_modules/p-try/license | 9 + .../node_modules/p-try/package.json | 72 + .../libnpmconfig/node_modules/p-try/readme.md | 47 + .../node_modules/libnpmconfig/package.json | 66 + deps/npm/node_modules/libnpmhook/CHANGELOG.md | 30 + deps/npm/node_modules/libnpmhook/README.md | 254 +- deps/npm/node_modules/libnpmhook/config.js | 13 - deps/npm/node_modules/libnpmhook/index.js | 107 +- .../npm-registry-fetch/CHANGELOG.md | 104 - .../node_modules/npm-registry-fetch/README.md | 549 -- .../node_modules/npm-registry-fetch/auth.js | 48 - .../npm-registry-fetch/check-response.js | 99 - .../node_modules/npm-registry-fetch/config.js | 90 - .../node_modules/npm-registry-fetch/errors.js | 58 - .../node_modules/npm-registry-fetch/index.js | 160 - .../npm-registry-fetch/package.json | 90 - .../npm-registry-fetch/silentlog.js | 14 - deps/npm/node_modules/libnpmhook/package.json | 52 +- deps/npm/node_modules/libnpmorg/CHANGELOG.md | 11 + .../node_modules/libnpmorg/CODE_OF_CONDUCT.md | 151 + .../node_modules/libnpmorg/CONTRIBUTING.md | 256 + deps/npm/node_modules/libnpmorg/LICENSE | 13 + .../libnpmorg/PULL_REQUEST_TEMPLATE | 7 + deps/npm/node_modules/libnpmorg/README.md | 144 + deps/npm/node_modules/libnpmorg/index.js | 71 + .../node_modules/aproba/CHANGELOG.md | 4 + .../libnpmorg/node_modules/aproba/LICENSE | 13 + .../libnpmorg/node_modules/aproba/README.md | 93 + .../libnpmorg/node_modules/aproba/index.js | 105 + .../node_modules/aproba/package.json | 66 + deps/npm/node_modules/libnpmorg/package.json | 77 + deps/npm/node_modules/libnpmorg/test/index.js | 81 + .../node_modules/libnpmorg/test/util/tnock.js | 12 + .../node_modules/libnpmpublish/.travis.yml | 7 + .../node_modules/libnpmpublish/CHANGELOG.md | 50 + .../libnpmpublish/CODE_OF_CONDUCT.md | 151 + .../libnpmpublish/CONTRIBUTING.md | 256 + deps/npm/node_modules/libnpmpublish/LICENSE | 13 + .../libnpmpublish/PULL_REQUEST_TEMPLATE | 7 + deps/npm/node_modules/libnpmpublish/README.md | 111 + .../node_modules/libnpmpublish/appveyor.yml | 22 + deps/npm/node_modules/libnpmpublish/index.js | 4 + .../node_modules/libnpmpublish/package.json | 73 + .../npm/node_modules/libnpmpublish/publish.js | 218 + .../libnpmpublish/test/publish.js | 919 +++ .../libnpmpublish/test/unpublish.js | 249 + .../libnpmpublish/test/util/mock-tarball.js | 47 + .../libnpmpublish/test/util/tnock.js | 12 + .../node_modules/libnpmpublish/unpublish.js | 86 + .../node_modules/libnpmsearch/CHANGELOG.md | 26 + .../libnpmsearch/CODE_OF_CONDUCT.md | 151 + .../node_modules/libnpmsearch/CONTRIBUTING.md | 256 + deps/npm/node_modules/libnpmsearch/LICENSE | 13 + .../libnpmsearch/PULL_REQUEST_TEMPLATE | 7 + deps/npm/node_modules/libnpmsearch/README.md | 169 + deps/npm/node_modules/libnpmsearch/index.js | 79 + .../node_modules/libnpmsearch/package.json | 74 + .../node_modules/libnpmsearch/test/index.js | 268 + .../libnpmsearch/test/util/tnock.js | 12 + deps/npm/node_modules/libnpmteam/.travis.yml | 7 + deps/npm/node_modules/libnpmteam/CHANGELOG.md | 18 + .../libnpmteam/CODE_OF_CONDUCT.md | 151 + .../node_modules/libnpmteam/CONTRIBUTING.md | 256 + deps/npm/node_modules/libnpmteam/LICENSE | 13 + .../libnpmteam/PULL_REQUEST_TEMPLATE | 7 + deps/npm/node_modules/libnpmteam/README.md | 185 + deps/npm/node_modules/libnpmteam/appveyor.yml | 22 + deps/npm/node_modules/libnpmteam/index.js | 106 + .../node_modules/aproba/CHANGELOG.md | 4 + .../libnpmteam/node_modules/aproba/LICENSE | 13 + .../libnpmteam/node_modules/aproba/README.md | 93 + .../libnpmteam/node_modules/aproba/index.js | 105 + .../node_modules/aproba/package.json | 66 + deps/npm/node_modules/libnpmteam/package.json | 69 + .../npm/node_modules/libnpmteam/test/index.js | 138 + .../libnpmteam/test/util/tnock.js | 12 + deps/npm/node_modules/lru-cache/index.js | 5 +- deps/npm/node_modules/lru-cache/package.json | 48 +- .../node_modules/aproba/LICENSE | 13 + .../node_modules/aproba/README.md | 93 + .../node_modules/aproba/index.js | 105 + .../node_modules/aproba/package.json | 62 + .../npm-audit-report/CHANGELOG.md | 12 + .../npm-audit-report/package.json | 22 +- .../npm-audit-report/reporters/detail.js | 4 +- .../npm-audit-report/reporters/parseable.js | 25 +- deps/npm/node_modules/npm-packlist/index.js | 6 +- .../node_modules/npm-packlist/package.json | 22 +- .../npm-pick-manifest/CHANGELOG.md | 40 + .../node_modules/npm-pick-manifest/README.md | 8 + .../node_modules/npm-pick-manifest/index.js | 62 +- .../npm-pick-manifest/package.json | 40 +- .../npm/node_modules/npm-profile/CHANGELOG.md | 11 + deps/npm/node_modules/npm-profile/README.md | 216 +- deps/npm/node_modules/npm-profile/index.js | 389 +- .../npm/node_modules/npm-profile/package.json | 27 +- .../npm-registry-client/CHANGELOG.md | 21 - .../npm-registry-client/README.md | 357 - .../node_modules/npm-registry-client/index.js | 74 - .../npm-registry-client/lib/access.js | 168 - .../npm-registry-client/lib/adduser.js | 128 - .../npm-registry-client/lib/attempt.js | 20 - .../npm-registry-client/lib/authify.js | 26 - .../npm-registry-client/lib/deprecate.js | 42 - .../npm-registry-client/lib/dist-tags/add.js | 43 - .../lib/dist-tags/fetch.js | 37 - .../npm-registry-client/lib/dist-tags/rm.js | 38 - .../npm-registry-client/lib/dist-tags/set.js | 39 - .../lib/dist-tags/update.js | 39 - .../npm-registry-client/lib/fetch.js | 85 - .../npm-registry-client/lib/get.js | 22 - .../npm-registry-client/lib/initialize.js | 91 - .../npm-registry-client/lib/logout.js | 23 - .../npm-registry-client/lib/org.js | 62 - .../npm-registry-client/lib/ping.js | 21 - .../npm-registry-client/lib/publish.js | 194 - .../npm-registry-client/lib/request.js | 336 - .../lib/send-anonymous-CLI-metrics.js | 19 - .../npm-registry-client/lib/star.js | 51 - .../npm-registry-client/lib/stars.js | 18 - .../npm-registry-client/lib/tag.js | 23 - .../npm-registry-client/lib/team.js | 105 - .../npm-registry-client/lib/unpublish.js | 120 - .../npm-registry-client/lib/whoami.js | 21 - .../node_modules/retry/.npmignore | 2 - .../node_modules/retry/License | 21 - .../node_modules/retry/Makefile | 21 - .../node_modules/retry/README.md | 215 - .../node_modules/retry/equation.gif | Bin 1209 -> 0 bytes .../node_modules/retry/example/dns.js | 31 - .../node_modules/retry/example/stop.js | 40 - .../node_modules/retry/index.js | 1 - .../node_modules/retry/lib/retry.js | 99 - .../node_modules/retry/lib/retry_operation.js | 143 - .../node_modules/retry/package.json | 56 - .../node_modules/retry/test/common.js | 10 - .../retry/test/integration/test-forever.js | 24 - .../test/integration/test-retry-operation.js | 176 - .../retry/test/integration/test-retry-wrap.js | 77 - .../retry/test/integration/test-timeouts.js | 69 - .../node_modules/retry/test/runner.js | 5 - .../node_modules/ssri/CHANGELOG.md | 256 - .../node_modules/ssri/LICENSE.md | 16 - .../node_modules/ssri/README.md | 488 -- .../node_modules/ssri/index.js | 379 - .../node_modules/ssri/package.json | 89 - .../npm-registry-client/package.json | 85 - .../npm-registry-fetch/CHANGELOG.md | 156 + .../node_modules/npm-registry-fetch/README.md | 93 +- .../node_modules/npm-registry-fetch/auth.js | 12 +- .../npm-registry-fetch/check-response.js | 30 +- .../node_modules/npm-registry-fetch/config.js | 24 +- .../node_modules/npm-registry-fetch/errors.js | 21 + .../node_modules/npm-registry-fetch/index.js | 149 +- .../node_modules/cacache/CHANGELOG.md | 478 -- .../node_modules/cacache/LICENSE.md | 16 - .../node_modules/cacache/README.es.md | 628 -- .../node_modules/cacache/README.md | 624 -- .../node_modules/cacache/en.js | 3 - .../node_modules/cacache/es.js | 3 - .../node_modules/cacache/get.js | 190 - .../node_modules/cacache/index.js | 3 - .../node_modules/cacache/lib/content/path.js | 26 - .../node_modules/cacache/lib/content/read.js | 125 - .../node_modules/cacache/lib/content/rm.js | 21 - .../node_modules/cacache/lib/content/write.js | 162 - .../node_modules/cacache/lib/entry-index.js | 225 - .../node_modules/cacache/lib/memoization.js | 69 - .../cacache/lib/util/fix-owner.js | 44 - .../cacache/lib/util/hash-to-segments.js | 11 - .../cacache/lib/util/move-file.js | 51 - .../node_modules/cacache/lib/util/tmp.js | 32 - .../node_modules/cacache/lib/util/y.js | 25 - .../node_modules/cacache/lib/verify.js | 213 - .../node_modules/cacache/locales/en.js | 44 - .../node_modules/cacache/locales/en.json | 6 - .../node_modules/cacache/locales/es.js | 46 - .../node_modules/cacache/locales/es.json | 6 - .../node_modules/cacache/ls.js | 6 - .../node_modules/mississippi/changelog.md | 7 - .../cacache/node_modules/mississippi/index.js | 10 - .../cacache/node_modules/mississippi/license | 7 - .../node_modules/mississippi/package.json | 62 - .../node_modules/mississippi/readme.md | 411 -- .../node_modules/cacache/package.json | 137 - .../node_modules/cacache/put.js | 71 - .../node_modules/cacache/rm.js | 28 - .../node_modules/cacache/verify.js | 3 - .../node_modules/figgy-pudding/CHANGELOG.md | 29 - .../node_modules/figgy-pudding/LICENSE.md | 16 - .../node_modules/figgy-pudding/README.md | 121 - .../node_modules/figgy-pudding/index.js | 60 - .../node_modules/figgy-pudding/package.json | 70 - .../make-fetch-happen/CHANGELOG.md | 525 -- .../node_modules/make-fetch-happen/LICENSE | 16 - .../node_modules/make-fetch-happen/README.md | 404 -- .../node_modules/make-fetch-happen/agent.js | 171 - .../node_modules/make-fetch-happen/cache.js | 257 - .../node_modules/make-fetch-happen/index.js | 482 -- .../make-fetch-happen/package.json | 95 - .../node_modules/make-fetch-happen/warning.js | 24 - .../node_modules/pump/.travis.yml | 5 - .../node_modules/pump/README.md | 56 - .../node_modules/pump/index.js | 82 - .../node_modules/pump/package.json | 59 - .../node_modules/pump/test-browser.js | 62 - .../node_modules/pump/test-node.js | 53 - .../node_modules/smart-buffer/.npmignore | 5 - .../node_modules/smart-buffer/.travis.yml | 11 - .../node_modules/smart-buffer/LICENSE | 20 - .../node_modules/smart-buffer/README.md | 307 - .../smart-buffer/build/smartbuffer.js | 726 -- .../smart-buffer/build/smartbuffer.js.map | 1 - .../smart-buffer/lib/smart-buffer.js | 371 - .../node_modules/smart-buffer/package.json | 70 - .../smart-buffer/test/smart-buffer.test.js | 410 -- .../smart-buffer/typings/index.d.ts | 383 - .../node_modules/socks-proxy-agent/.npmignore | 1 - .../socks-proxy-agent/.travis.yml | 22 - .../node_modules/socks-proxy-agent/History.md | 96 - .../node_modules/socks-proxy-agent/README.md | 134 - .../node_modules/socks-proxy-agent/index.js | 141 - .../socks-proxy-agent/package.json | 66 - .../test/ssl-cert-snakeoil.key | 15 - .../test/ssl-cert-snakeoil.pem | 12 - .../socks-proxy-agent/test/test.js | 144 - .../node_modules/socks/.npmignore | 4 - .../node_modules/socks/LICENSE | 20 - .../node_modules/socks/README.md | 339 - .../node_modules/socks/examples/associate.js | 33 - .../node_modules/socks/examples/bind.js | 30 - .../node_modules/socks/examples/connect.js | 31 - .../node_modules/socks/index.js | 6 - .../node_modules/socks/lib/socks-agent.js | 108 - .../node_modules/socks/lib/socks-client.js | 306 - .../node_modules/socks/package.json | 68 - .../node_modules/ssri/CHANGELOG.md | 256 - .../node_modules/ssri/LICENSE.md | 16 - .../node_modules/ssri/README.md | 488 -- .../node_modules/ssri/index.js | 379 - .../node_modules/ssri/package.json | 90 - .../npm-registry-fetch/package.json | 92 +- deps/npm/node_modules/pacote/CHANGELOG.md | 106 + deps/npm/node_modules/pacote/README.md | 127 +- deps/npm/node_modules/pacote/index.js | 1 + .../node_modules/pacote/lib/extract-stream.js | 1 + deps/npm/node_modules/pacote/lib/fetch.js | 12 +- .../node_modules/pacote/lib/fetchers/alias.js | 24 + .../pacote/lib/fetchers/directory.js | 21 +- .../node_modules/pacote/lib/fetchers/file.js | 10 +- .../node_modules/pacote/lib/fetchers/git.js | 8 +- .../fetchers/registry/check-warning-header.js | 39 - .../pacote/lib/fetchers/registry/fetch.js | 109 - .../pacote/lib/fetchers/registry/index.js | 7 +- .../pacote/lib/fetchers/registry/manifest.js | 117 +- .../pacote/lib/fetchers/registry/packument.js | 92 + .../lib/fetchers/registry/pick-registry.js | 17 - .../lib/fetchers/registry/registry-key.js | 16 - .../pacote/lib/fetchers/registry/tarball.js | 11 +- .../pacote/lib/fetchers/remote.js | 4 + .../pacote/lib/finalize-manifest.js | 19 +- deps/npm/node_modules/pacote/lib/util/git.js | 29 +- .../node_modules/pacote/lib/util/opt-check.js | 105 +- .../node_modules/pacote/lib/util/pack-dir.js | 2 +- .../node_modules/pacote/lib/util/proclog.js | 23 + .../node_modules/pacote/lib/util/silentlog.js | 13 - .../pacote/lib/with-tarball-stream.js | 10 +- .../pacote/node_modules/lru-cache/LICENSE | 15 + .../pacote/node_modules/lru-cache/README.md | 166 + .../pacote/node_modules/lru-cache/index.js | 334 + .../node_modules/lru-cache/package.json | 67 + .../pacote/node_modules/minipass/LICENSE | 15 + .../pacote/node_modules/minipass/README.md | 124 + .../pacote/node_modules/minipass/index.js | 375 + .../pacote/node_modules/minipass/package.json | 67 + .../pacote/node_modules/yallist/LICENSE | 15 + .../pacote/node_modules/yallist/README.md | 204 + .../pacote/node_modules/yallist/iterator.js | 8 + .../pacote/node_modules/yallist/package.json | 62 + .../pacote/node_modules/yallist/yallist.js | 376 + deps/npm/node_modules/pacote/package.json | 79 +- deps/npm/node_modules/pacote/packument.js | 29 + deps/npm/node_modules/pacote/prefetch.js | 2 +- .../node_modules/readable-stream/.travis.yml | 55 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 58 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 81 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/string_decoder/.travis.yml | 50 + .../node_modules/string_decoder/LICENSE | 47 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 59 + deps/npm/node_modules/protoduck/CHANGELOG.md | 11 + deps/npm/node_modules/protoduck/index.js | 26 +- deps/npm/node_modules/protoduck/package.json | 33 +- deps/npm/node_modules/query-string/index.js | 27 +- .../node_modules/query-string/package.json | 36 +- deps/npm/node_modules/query-string/readme.md | 2 +- .../node_modules/readable-stream/README.md | 79 +- .../readable-stream/errors-browser.js | 127 + .../node_modules/readable-stream/errors.js | 116 + .../readable-stream/experimentalWarning.js | 17 + .../readable-stream/lib/_stream_duplex.js | 96 +- .../lib/_stream_passthrough.js | 10 +- .../readable-stream/lib/_stream_readable.js | 710 +- .../readable-stream/lib/_stream_transform.js | 71 +- .../readable-stream/lib/_stream_writable.js | 364 +- .../lib/internal/streams/async_iterator.js | 204 + .../lib/internal/streams/buffer_list.js | 189 + .../lib/internal/streams/destroy.js | 39 +- .../lib/internal/streams/end-of-stream.js | 91 + .../lib/internal/streams/pipeline.js | 97 + .../lib/internal/streams/state.js | 27 + .../node_modules/readable-stream/package.json | 92 +- .../node_modules/readable-stream/readable.js | 2 + .../node_modules/readable-stream/yarn.lock | 6423 +++++++++++++++++ deps/npm/node_modules/rimraf/package.json | 42 +- .../run-queue/node_modules/aproba/LICENSE | 13 + .../run-queue/node_modules/aproba/README.md | 93 + .../run-queue/node_modules/aproba/index.js | 105 + .../node_modules/aproba/package.json | 62 + deps/npm/node_modules/semver/README.md | 21 +- deps/npm/node_modules/semver/bin/semver | 18 +- deps/npm/node_modules/semver/package.json | 26 +- deps/npm/node_modules/semver/semver.js | 236 +- .../node_modules/readable-stream/.travis.yml | 55 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../sha/node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 58 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 81 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/string_decoder/.travis.yml | 50 + .../sha/node_modules/string_decoder/LICENSE | 47 + .../sha/node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 59 + .../node_modules/spdx-license-ids/README.md | 4 +- .../spdx-license-ids/deprecated.json | 11 +- .../node_modules/spdx-license-ids/index.json | 204 +- .../spdx-license-ids/package.json | 43 +- .../node_modules/readable-stream/.travis.yml | 55 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 58 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 81 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/string_decoder/.travis.yml | 50 + .../node_modules/string_decoder/LICENSE | 47 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 59 + .../node_modules/string_decoder/package.json | 25 +- .../node_modules/readable-stream/.travis.yml | 55 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 58 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 81 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/string_decoder/.travis.yml | 50 + .../node_modules/string_decoder/LICENSE | 47 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 59 + .../node_modules/unique-filename/.npmignore | 5 - deps/npm/node_modules/unique-filename/LICENSE | 5 + .../node_modules/unique-filename/package.json | 36 +- .../write-file-atomic/CHANGELOG.md | 20 + .../node_modules/write-file-atomic/README.md | 19 +- .../node_modules/write-file-atomic/index.js | 110 +- .../write-file-atomic/package.json | 36 +- deps/npm/package.json | 100 +- deps/npm/scripts/maketest | 22 +- deps/npm/test/fake-registry.md | 6 +- .../test/fixtures/config/userconfig-with-gc | 21 + .../07/8db5f6377f6321fceaaedf497de124dc9465 | Bin 0 -> 4025 bytes .../eb/847a949e71eb9041fd6567a36c9acfcf2bed | Bin 0 -> 55415 bytes .../77/307e108bfb57107c4c334abb5ef5395dc68a | Bin 0 -> 364 bytes .../6a/192b7913b04c54574d18c28d46e6395428ab | 1 + .../c8/0b2b6f5432c60cddb81932ab56563b444f52 | Bin 0 -> 6288 bytes .../c8/a39b626c1f83f8b8f53007c2f60eb98eee9d | Bin 0 -> 372 bytes .../42/4826f3405f79f142e6fc3d9ae58d4dbb9200 | Bin 0 -> 12142 bytes .../f3/ccba11914dc88bcb185ee3b1b33b564272bc | Bin 0 -> 220 bytes .../bb/e0b0674b9d719708ca38de8c237cb526c3d1 | Bin 0 -> 15772 bytes .../96/69bb42ecb409f83d583cad52ca17eaa1643f | Bin 0 -> 13772 bytes .../7a/36bf00f3a7a3d24a8fbc7853f06fce4e9c86 | Bin 0 -> 7954 bytes .../43/09dadee6b54cc0b8d247e8d7c7a0975bdc9b | Bin 0 -> 1519 bytes .../bd/e817d176ffade894ab71458e682a14b86dc9 | Bin 0 -> 22746 bytes .../aa/327bcecf518f9106ac6b8f003fa3bcea8566 | Bin 0 -> 5977 bytes .../50/08f3ff82b34f17b1e972454a0ab70a269c7d | Bin 0 -> 371 bytes .../56/8a2b1efaeb95bec4d9e59e5301fc63339866 | Bin 0 -> 4733 bytes ...ff9a8695bdd5cae7ce03bbf1e94e93613a00f25f21 | 1 + ...316762e5ba4641764b2680945ba3f620d3cf798a05 | 1 + ...22c6b860203eb4853ce85f15f26b96c84b8d9e7320 | 1 + ...64c14922e8f0d1ed1c212ef3f15d00e9527b17b9b9 | Bin 0 -> 15108 bytes ...667274ee5fa714abdc1b158e5cfea5ca5401663425 | Bin 0 -> 5787 bytes ...f66d3a01cb2789b2cf614aeb292dbeb4afe0b206cc | Bin 0 -> 4733 bytes ...f84660380604b5ff338258ad46973218d864799b5e | 1 + ...b7ac3d238d1f036ef2e9adb898c386f0cda9b6861e | 1 + ...569b6a41a201781f6a39900082feaac81923a12e57 | 1 + ...dfae3a2421c939cafb586b9f1b6c492fdfe09aca86 | Bin 0 -> 55415 bytes ...99b2c2e140779cde81f69475d8d4591808103b964b | 1 + ...9c5be725e8ae6041e62c9e9e81de5585e900328b09 | 1 + ...9d260fd9b8236e434a3a55580b7aaba369e6f8ba87 | Bin 0 -> 283 bytes ...9122096191893f662db33d0569837305388bad35bf | 1 + ...57e55140d84489cacc140627e012824fa073f97568 | 1 + ...abe86b49a6b1bf5c733bdece3877d82bc8bc1a9a7d | 1 + ...1ed7b159470b382180d1f0a5c4098ac6092cda1a8f | 1 + ...cf10cd954968f3bfec136f0d3aa87009db05cf4666 | 1 + ...7928b5495d12d2f944867db1105e424d5fa9b1e015 | 1 + ...a22b4aaee58075e0c77fd00ddf656536bc543290be | 1 + ...a1d71dd9d7f46b6217ec8ef30ec4d83f4b9a43098d | 1 + ...4aada16bea028eb40106762b142b30d448cdc08593 | Bin 0 -> 27629 bytes ...812738a2324b7aae42d4feeac49a2b895c57b48168 | 1 + ...6158dc05f13ef88bcef32de3bc415a48cdc5500355 | 1 + ...17724c918013e03954f9729192cbdfa1d0bed6fd39 | 1 + ...d740cdc01f8f880836a00c66743565acd2e8352e7a | Bin 0 -> 151 bytes ...30e8be1a394c4c7c444c8b541f8e180b7f12506fe8 | 1 + ...1712b0803f9866e92c0cbc4549b4807435dcf7a767 | Bin 0 -> 143 bytes ...3d14b8064b5b04177c402e347770ddfbbbc7c906cb | Bin 0 -> 184 bytes ...50ee73c18ac7a25e763f2b9869612cdbf427195d4b | 1 + ...f31998c436f171d98a9a1740e3ac8eebb5c1103c53 | 1 + ...fc10f57749cff60aa970a1e38c7a6c354a9403554e | 1 + ...02ac14ba7cd64f3acd56e21b984630f823ad9c9663 | 1 + ...5e461ab41d220fd6f268ff889e405809108a7b8676 | 1 + ...ba2aeb475d5958a2ca31f48c6a1442f164e90a3a22 | 1 + ...6fd30ac4dea48773a610ca6ee1e09e31f6147e921d | 1 + ...1bb92884db886826bf8cd26634667a2d103a999438 | 1 + ...61a14edff79dd7bd610b27c57fea8aff535dbc519f | 1 + ...8f303e97746763b0642faf89a9b00425297dc78d6a | 1 + ...c12bef1930d35234d6556319315d5656391257472d | 1 + ...fbfeead5822d45a4e7089a414fbe6f1be007f6cd48 | 3 + ...1182e328ec6d451a459b384cac489f57771ed7e74a | 2 + ...218bb50c1c639e7a3600893f62fde6191d2563e6df | 5 + ...1dbdd82db862373a457bbab3fee9c0e305b4f83b37 | 2 + ...e8a3c3b46e111bc08921520f7b2cce032bf8862107 | 3 + ...1d6f7d04cf0b3871bdde88a368eed466901917d636 | 3 + ...d6afadda07bc566c24b4b589c6bbc5c3e996c7a3db | 3 + ...2a3d208c8b91325f3f8fe347347649e2e7cb8c10b2 | 3 + ...cddcc72c47c6fbcde4ff2cdbb76da7c1defd09d6d6 | 7 + ...b2d5c35a85f51736f1403d8fd3790ab0e354238f68 | 5 + ...7e0486d0c90745de8da2029e042c59f6197901f5fb | 13 + ...b4ef03e8a114c823d405df62054797ae8e510155d2 | 5 + ...f13d167389f0bdff113e4a85c2d0a34e8420953fb0 | 2 + ...d6fc97011bebe11fc8e308eaff2d4224c21477d1d5 | 2 + ...5a54c44c2c4ef172a4c3a0e7c91e0b8da7b9c418f8 | 3 + ...ade5b17475bf87d30ec77a66a68a3481fbcb2299ca | 3 + ...c20ec3ebdaa0e12382c5c6badfa30fb7b376f6a580 | 2 + ...b8d0095b14f1940fbdde0e7515bc19ccfcfbccec49 | 3 + ...bafb5672197db1ee77ca9aa734a3e77692efcf7716 | 2 + ...0583f72c91d67d20fa9f5f5604755719bc421195dd | 3 + ...136a104fc757d4d7719d47a6b5d71c1b3075cc1b69 | 3 + ...d63607a55048be00c0a16bcf8dc96b9aadb8511570 | 5 + ...cadd4897498d69b3141e0d72f1ccc1f3bd703a4c75 | 3 + ...a6d5770af0d18432dbca32e8a2a9958dd413e3b776 | 5 + ...fc4055ac06876c63165a517fc12011046fc2cc4a9f | 3 + ...03828e46b026559f16671fbad7c36d5e0a1bd28a7f | 13 + ...b18d4ff02085c52be8b7b4b739d0da243122208329 | 3 + ...ef4e411f13d971ff84939f5a96a1d5826244927399 | 3 + ...86dc89dd492bc0e1c9c57727fbf97333ab23450cc6 | 5 + ...56a2610deec22135ab5102d53f8dc5bb1359585a5c | 5 + ...f294331ca4785e2ef41b621d746ef1047eaf34e122 | 3 + ...bb2e41b34b7a019b657b6db6c972a30870f3318344 | 4 + ...3eda6968cde18196e800153a6162d5f73df18895fa | 3 + ...343ee79cb0ab6d1b2f500885d3a7d93bbb4b24e711 | 5 + ...4c98856ae075582e2842b381809c76ffd12d24c450 | 3 + ...60aedbfe40200d189691fae9d90c694f654422738c | 5 + ...e28c064e5182f98631dbc1156be71fa734471d1b31 | 2 + ...2d15a7754abc281ff227d3d4436045fc19bded3abb | 9 + ...2d4a7dbf1f5e94e01b700897b6a69b1700a9575905 | 5 + ...9322cfa6781845b7bac7c9830246b89d040ab35bfa | 5 + ...9eb38d07610e8ad7007ffc3f0f3b25da20b9af281d | 2 + ...40de9f1b4244b118714d5d156afca81319c4ed13be | 3 + ...cccff3c9a0701f54d94e18ea19ff39aeb0a235d833 | 4 + ...b7181092bc6213963acf08be267556eed18c1ffcca | 4 + ...affd08317ec59071d08bdedd169a5f40c3b1fbb486 | 11 + ...e39edbd34fc9713c6c020ca44a5a0b426ff048428d | 2 + ...d7117d088c8431300750cd1c934e227cfecffa01f5 | 3 + ...3ac4d6834e73ca79c301c7108c94b0ba23ca97b71c | 3 + ...dcbcdf1d48b9436619bf5b6fd10474ef86e41a8c6f | 3 + ...927a0d7d21e557756b443699e6929fe420d5aa82a2 | 2 + ...6f7e1fce3892c4e717a9379d4ad43a7111b5dc8cc2 | 3 + ...b000c96edea31a1e6d923f7f3daf1ff06e04899cbb | 3 + ...ceaad1d0ca321b8e5cc8080001efa90bd6e7cf2d10 | 3 + ...aeeb996d0c850341d8e832b38df45ce8b79f2d7f6a | 5 + ...d9e42f3ca7ad942331f73dd73c3e6f5549e910679b | 3 + ...418640b55c06029c2d36a3dc34ee91b90483a9973d | 3 + ...0a7bca660b3b4f409bea196a8cea3f3e66c5a8e84b | 5 + ...1cc7f9caf4f3e654df7abd1fc8279dde9f935c76aa | 5 + ...d9c34ba6cd492e2a0053b4aeea258df6763e8cd8a2 | 9 + ...0f134ecf35495d997ad1c67532fe520ac6709d28c5 | 4 + ...213f4cb7e73c072a15544da364e543df7bef989d9c | 3 + ...ecf2e6be6e66dac4d4feb5407eb6ecb26af41a4de8 | 12 + ...60f72129b8494625e3e6fd08f7fd5886f65bf82e0d | 2 + ...c68f3821cf6d7f49caba301e383b31143bd9670f28 | 5 + ...ceeaa57b4d135c5def8209619ca09751fdae5bd803 | 3 + ...2fd92adee9edf0f507c4ea02b2703d926b06947341 | 3 + ...e381384f50b395b52e2addd35285efab8ec8f5b303 | 3 + ...cffd992a45de09faf0f0fe2ad2c446353a58288f6b | 2 + ...54cec21589dfd82db09bd3c7016d436760a3e94f60 | 3 + ...baf5abf24d446c017f7bfba330c19d63fc24000277 | 2 + ...f5a05ce4803a44826a0112390460da66c8c3c5de69 | 5 + ...fc91be78e935c68f4608824732a06091fcf7cb550a | 3 + ...8a85aaef872bf4eca492fac6cab144fb2e45ffbd74 | 3 + ...51111ddb9fa636ef144ff9fad15784c1e9620b0dac | 2 + ...2f5a63b3d871adc66f517669450807aec3b62e71b2 | 2 + ...bc730827a0a2c453ffea82d07c7b1481a46f7b1194 | 4 + ...6ed2b2019e46a63cff8cbb76981a37eac2100c8e55 | 3 + ...124554206657c17eb6b2809df9f5ec1c10007a6465 | 3 + ...bcb0a155df04211a49d1fdb1b67e59ccb47e20c353 | 5 + ...c04be95e67db8ea33ce033a3fadf0ba1061c174d3e | 3 + ...4407f0d9cae19a4d56f253f7746786597a52daa76d | 2 + ...99901f9c56c3654221987030a0f86aac7f7caecccc | 3 + ...693c919a915102645335a143056a5f12cafef915c0 | 9 + ...9e83a59e80c3482dd62f626939323f2b6bf511b53d | 3 + ...193e883193e034208d95b6028728ef3902b78b694d | 5 + ...0fe8762eac5e3d3c2cd27e8bb1fbcdc22399c3d89e | 2 + ...19b515a4d107ae1cd16ef94cdbbbd34a1c5687e07d | 2 + ...11155392ad66e8ee2a352798e5fe782b98c941c2c6 | 3 + ...8afad16c456d1d0fbce7e14fc1c7a9dba42620f68a | 3 + ...e11169fc083be6367490e46bce28208b4f7b5cb2f8 | 2 + ...8e975217eae2e4816c2a8e9cdee330a1e2acfbd7a6 | 3 + ...62d37f6471e6bd96641b1670b43d01fca9e23884e3 | 2 + ...f1dbaa948bd898062da50bed98d5b04f317278fa48 | 13 + ...61c190df783256e332cab7782a7484078354ddbb0f | 3 + ...5934e3a7938145b60af92641734e54a8f50a418c03 | 2 + ...0c54baee7ae9bec37f513387665b57ac2bcd167b70 | 2 + ...e13f61bb768d7cbf82072f798d17071572ab3943f2 | 2 + .../_logs/2019-01-18T17_41_24_580Z-debug.log | 54 + .../_logs/2019-01-18T17_41_26_268Z-debug.log | 56 + .../_logs/2019-01-18T17_41_28_020Z-debug.log | 53 + .../_logs/2019-01-18T17_41_39_719Z-debug.log | 27 + .../_logs/2019-01-18T17_41_40_242Z-debug.log | 34 + .../_logs/2019-01-18T17_41_47_912Z-debug.log | 21 + .../_logs/2019-01-18T17_41_48_220Z-debug.log | 21 + .../_logs/2019-01-18T17_41_57_730Z-debug.log | 26 + .../_logs/2019-01-18T17_42_14_004Z-debug.log | 111 + .../test/npm_cache/anonymous-cli-metrics.json | 1 + .../test/tap/404-private-registry-scoped.js | 2 +- deps/npm/test/tap/404-private-registry.js | 2 +- deps/npm/test/tap/access.js | 50 +- .../all-package-metadata-cache-stream-unit.js | 125 +- .../all-package-metadata-entry-stream-unit.js | 195 +- ...all-package-metadata-update-stream-unit.js | 145 +- .../all-package-metadata-write-stream-unit.js | 124 +- deps/npm/test/tap/all-package-metadata.js | 64 +- deps/npm/test/tap/cache-add-unpublished.js | 2 +- deps/npm/test/tap/config-meta.js | 19 +- deps/npm/test/tap/dist-tag.js | 45 + deps/npm/test/tap/get.js | 103 - .../test/tap/install-dep-classification.js | 167 + deps/npm/test/tap/map-to-registry.js | 166 - deps/npm/test/tap/org.js | 136 + deps/npm/test/tap/ping.js | 35 +- deps/npm/test/tap/publish-config.js | 12 +- .../npm/test/tap/search.all-package-search.js | 61 +- deps/npm/test/tap/search.esearch.js | 192 - deps/npm/test/tap/search.js | 104 +- deps/npm/test/tap/team.js | 39 +- deps/npm/test/tap/view.js | 2 +- 1221 files changed, 65415 insertions(+), 23830 deletions(-) create mode 100644 deps/npm/doc/cli/npm-org.md create mode 100644 deps/npm/html/doc/cli/npm-org.html create mode 100644 deps/npm/lib/config/figgy-config.js delete mode 100644 deps/npm/lib/config/pacote.js delete mode 100644 deps/npm/lib/config/reg-client.js create mode 100644 deps/npm/lib/org.js delete mode 100644 deps/npm/lib/search/esearch.js delete mode 100644 deps/npm/lib/utils/get-publish-config.js delete mode 100644 deps/npm/lib/utils/map-to-registry.js create mode 100644 deps/npm/lib/utils/otplease.js create mode 100644 deps/npm/man/man1/npm-org.1 create mode 100644 deps/npm/node_modules/JSONStream/test/run.js create mode 100644 deps/npm/node_modules/aproba/CHANGELOG.md rename deps/npm/node_modules/{ => are-we-there-yet/node_modules}/readable-stream/.travis.yml (100%) create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/GOVERNANCE.md create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/LICENSE create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/README.md rename deps/npm/node_modules/{ => are-we-there-yet/node_modules}/readable-stream/doc/wg-meetings/2015-01-30.md (99%) rename deps/npm/node_modules/{ => are-we-there-yet/node_modules}/readable-stream/duplex-browser.js (100%) rename deps/npm/node_modules/{ => are-we-there-yet/node_modules}/readable-stream/duplex.js (100%) create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js rename deps/npm/node_modules/{ => are-we-there-yet/node_modules}/readable-stream/lib/internal/streams/BufferList.js (100%) create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/package.json rename deps/npm/node_modules/{ => are-we-there-yet/node_modules}/readable-stream/passthrough.js (100%) create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/readable-browser.js create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/readable.js rename deps/npm/node_modules/{ => are-we-there-yet/node_modules}/readable-stream/transform.js (100%) rename deps/npm/node_modules/{ => are-we-there-yet/node_modules}/readable-stream/writable-browser.js (100%) rename deps/npm/node_modules/{ => are-we-there-yet/node_modules}/readable-stream/writable.js (100%) rename deps/npm/node_modules/{ => are-we-there-yet/node_modules}/string_decoder/.travis.yml (100%) create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/LICENSE create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/README.md create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js create mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/package.json create mode 100644 deps/npm/node_modules/byte-size/dist/index.js rename deps/npm/node_modules/byte-size/{index.js => index.mjs} (90%) rename deps/npm/node_modules/{npm-registry-client => cacache/node_modules/chownr}/LICENSE (100%) create mode 100644 deps/npm/node_modules/cacache/node_modules/chownr/README.md create mode 100644 deps/npm/node_modules/cacache/node_modules/chownr/chownr.js create mode 100644 deps/npm/node_modules/cacache/node_modules/chownr/package.json create mode 100644 deps/npm/node_modules/cacache/node_modules/lru-cache/LICENSE create mode 100644 deps/npm/node_modules/cacache/node_modules/lru-cache/README.md create mode 100644 deps/npm/node_modules/cacache/node_modules/lru-cache/index.js create mode 100644 deps/npm/node_modules/cacache/node_modules/lru-cache/package.json create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/LICENSE create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/README.md create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/__root__/index.html create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/__root__/index.js.html create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/base.css create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/index.html create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/prettify.css create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/prettify.js create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/sort-arrow-sprite.png create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/sorter.js create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/index.js create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/package.json create mode 100644 deps/npm/node_modules/cacache/node_modules/unique-filename/test/index.js create mode 100644 deps/npm/node_modules/cacache/node_modules/yallist/LICENSE create mode 100644 deps/npm/node_modules/cacache/node_modules/yallist/README.md create mode 100644 deps/npm/node_modules/cacache/node_modules/yallist/iterator.js create mode 100644 deps/npm/node_modules/cacache/node_modules/yallist/package.json create mode 100644 deps/npm/node_modules/cacache/node_modules/yallist/yallist.js create mode 100644 deps/npm/node_modules/cli-table3/index.d.ts create mode 100644 deps/npm/node_modules/colors/index.d.ts create mode 100644 deps/npm/node_modules/colors/lib/system/has-flag.js create mode 100644 deps/npm/node_modules/colors/safe.d.ts create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/.travis.yml create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/GOVERNANCE.md create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/LICENSE create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/README.md create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/duplex-browser.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/duplex.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/package.json create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/passthrough.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/readable-browser.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/readable.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/transform.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/writable-browser.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/writable.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/string_decoder/.travis.yml create mode 100644 deps/npm/node_modules/concat-stream/node_modules/string_decoder/LICENSE create mode 100644 deps/npm/node_modules/concat-stream/node_modules/string_decoder/README.md create mode 100644 deps/npm/node_modules/concat-stream/node_modules/string_decoder/lib/string_decoder.js create mode 100644 deps/npm/node_modules/concat-stream/node_modules/string_decoder/package.json create mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/aproba/LICENSE create mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/aproba/README.md create mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/aproba/index.js create mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/aproba/package.json create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/.travis.yml create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/GOVERNANCE.md create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/LICENSE create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/README.md create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/duplex-browser.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/duplex.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/package.json create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/passthrough.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/readable-browser.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/readable.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/transform.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/writable-browser.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/writable.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/string_decoder/.travis.yml create mode 100644 deps/npm/node_modules/duplexify/node_modules/string_decoder/LICENSE create mode 100644 deps/npm/node_modules/duplexify/node_modules/string_decoder/README.md create mode 100644 deps/npm/node_modules/duplexify/node_modules/string_decoder/lib/string_decoder.js create mode 100644 deps/npm/node_modules/duplexify/node_modules/string_decoder/package.json create mode 100644 deps/npm/node_modules/execa/node_modules/get-stream/buffer-stream.js create mode 100644 deps/npm/node_modules/execa/node_modules/get-stream/index.js rename deps/npm/node_modules/{npm-registry-fetch/node_modules/pump/LICENSE => execa/node_modules/get-stream/license} (92%) create mode 100644 deps/npm/node_modules/execa/node_modules/get-stream/package.json create mode 100644 deps/npm/node_modules/execa/node_modules/get-stream/readme.md create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/.travis.yml create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/GOVERNANCE.md create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/LICENSE create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/README.md create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex-browser.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/package.json create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/passthrough.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable-browser.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/transform.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable-browser.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/.travis.yml create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/LICENSE create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/README.md create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/lib/string_decoder.js create mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/package.json create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/.travis.yml create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/GOVERNANCE.md create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/LICENSE create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/README.md create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/duplex-browser.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/duplex.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/package.json create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/passthrough.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/readable-browser.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/readable.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/transform.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/writable-browser.js create mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/writable.js create mode 100644 deps/npm/node_modules/from2/node_modules/string_decoder/.travis.yml create mode 100644 deps/npm/node_modules/from2/node_modules/string_decoder/LICENSE create mode 100644 deps/npm/node_modules/from2/node_modules/string_decoder/README.md create mode 100644 deps/npm/node_modules/from2/node_modules/string_decoder/lib/string_decoder.js create mode 100644 deps/npm/node_modules/from2/node_modules/string_decoder/package.json create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/.travis.yml create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/GOVERNANCE.md create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/LICENSE create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/README.md create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex-browser.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/package.json create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/passthrough.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable-browser.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/transform.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable-browser.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/.travis.yml create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/LICENSE create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/README.md create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/lib/string_decoder.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/package.json create mode 100644 deps/npm/node_modules/gauge/node_modules/aproba/LICENSE create mode 100644 deps/npm/node_modules/gauge/node_modules/aproba/README.md create mode 100644 deps/npm/node_modules/gauge/node_modules/aproba/index.js create mode 100644 deps/npm/node_modules/gauge/node_modules/aproba/package.json create mode 100644 deps/npm/node_modules/genfun/LICENSE create mode 100644 deps/npm/node_modules/gentle-fs/node_modules/aproba/LICENSE create mode 100644 deps/npm/node_modules/gentle-fs/node_modules/aproba/README.md create mode 100644 deps/npm/node_modules/gentle-fs/node_modules/aproba/index.js create mode 100644 deps/npm/node_modules/gentle-fs/node_modules/aproba/package.json create mode 100644 deps/npm/node_modules/got/node_modules/get-stream/buffer-stream.js create mode 100644 deps/npm/node_modules/got/node_modules/get-stream/index.js create mode 100644 deps/npm/node_modules/got/node_modules/get-stream/license create mode 100644 deps/npm/node_modules/got/node_modules/get-stream/package.json create mode 100644 deps/npm/node_modules/got/node_modules/get-stream/readme.md create mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/CHANGELOG.md create mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/LICENSE create mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/README.md create mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/index.js create mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/package.json create mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/vendors.json delete mode 100644 deps/npm/node_modules/libcipm/lib/config/lifecycle-opts.js delete mode 100644 deps/npm/node_modules/libcipm/lib/config/pacote-opts.js create mode 100644 deps/npm/node_modules/libnpm/CHANGELOG.md rename deps/npm/node_modules/{libnpmhook/node_modules/npm-registry-fetch => libnpm}/LICENSE.md (100%) create mode 100644 deps/npm/node_modules/libnpm/README.md create mode 100644 deps/npm/node_modules/libnpm/access.js create mode 100644 deps/npm/node_modules/libnpm/adduser.js create mode 100644 deps/npm/node_modules/libnpm/config.js create mode 100644 deps/npm/node_modules/libnpm/extract.js create mode 100644 deps/npm/node_modules/libnpm/fetch.js create mode 100644 deps/npm/node_modules/libnpm/get-prefix.js create mode 100644 deps/npm/node_modules/libnpm/hook.js create mode 100644 deps/npm/node_modules/libnpm/index.js create mode 100644 deps/npm/node_modules/libnpm/link-bin.js create mode 100644 deps/npm/node_modules/libnpm/log.js create mode 100644 deps/npm/node_modules/libnpm/logical-tree.js create mode 100644 deps/npm/node_modules/libnpm/login.js create mode 100644 deps/npm/node_modules/libnpm/manifest.js create mode 100644 deps/npm/node_modules/libnpm/org.js create mode 100644 deps/npm/node_modules/libnpm/package.json create mode 100644 deps/npm/node_modules/libnpm/packument.js create mode 100644 deps/npm/node_modules/libnpm/parse-arg.js create mode 100644 deps/npm/node_modules/libnpm/profile.js create mode 100644 deps/npm/node_modules/libnpm/publish.js create mode 100644 deps/npm/node_modules/libnpm/read-json.js create mode 100644 deps/npm/node_modules/libnpm/run-script.js create mode 100644 deps/npm/node_modules/libnpm/search.js create mode 100644 deps/npm/node_modules/libnpm/stringify-package.js create mode 100644 deps/npm/node_modules/libnpm/tarball.js create mode 100644 deps/npm/node_modules/libnpm/team.js create mode 100644 deps/npm/node_modules/libnpm/unpublish.js create mode 100644 deps/npm/node_modules/libnpm/verify-lock.js create mode 100644 deps/npm/node_modules/libnpmaccess/.travis.yml create mode 100644 deps/npm/node_modules/libnpmaccess/CHANGELOG.md create mode 100644 deps/npm/node_modules/libnpmaccess/CODE_OF_CONDUCT.md create mode 100644 deps/npm/node_modules/libnpmaccess/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/libnpmaccess/LICENSE create mode 100644 deps/npm/node_modules/libnpmaccess/PULL_REQUEST_TEMPLATE create mode 100644 deps/npm/node_modules/libnpmaccess/README.md create mode 100644 deps/npm/node_modules/libnpmaccess/appveyor.yml create mode 100644 deps/npm/node_modules/libnpmaccess/index.js create mode 100644 deps/npm/node_modules/libnpmaccess/node_modules/aproba/CHANGELOG.md create mode 100644 deps/npm/node_modules/libnpmaccess/node_modules/aproba/LICENSE create mode 100644 deps/npm/node_modules/libnpmaccess/node_modules/aproba/README.md create mode 100644 deps/npm/node_modules/libnpmaccess/node_modules/aproba/index.js create mode 100644 deps/npm/node_modules/libnpmaccess/node_modules/aproba/package.json create mode 100644 deps/npm/node_modules/libnpmaccess/package.json create mode 100644 deps/npm/node_modules/libnpmaccess/test/index.js create mode 100644 deps/npm/node_modules/libnpmaccess/test/util/tnock.js create mode 100644 deps/npm/node_modules/libnpmconfig/CHANGELOG.md create mode 100644 deps/npm/node_modules/libnpmconfig/CODE_OF_CONDUCT.md create mode 100644 deps/npm/node_modules/libnpmconfig/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/libnpmconfig/LICENSE create mode 100644 deps/npm/node_modules/libnpmconfig/PULL_REQUEST_TEMPLATE create mode 100644 deps/npm/node_modules/libnpmconfig/README.md create mode 100644 deps/npm/node_modules/libnpmconfig/index.js create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/find-up/index.js create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/find-up/license create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/find-up/package.json create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/find-up/readme.md create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.js create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-limit/license create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-limit/package.json create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-limit/readme.md create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-locate/index.js create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-locate/license create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-locate/package.json create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-locate/readme.md create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.js create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-try/license create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-try/package.json create mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-try/readme.md create mode 100644 deps/npm/node_modules/libnpmconfig/package.json delete mode 100644 deps/npm/node_modules/libnpmhook/config.js delete mode 100644 deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/CHANGELOG.md delete mode 100644 deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/README.md delete mode 100644 deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/auth.js delete mode 100644 deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/check-response.js delete mode 100644 deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/config.js delete mode 100644 deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/errors.js delete mode 100644 deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/index.js delete mode 100644 deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/package.json delete mode 100644 deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/silentlog.js create mode 100644 deps/npm/node_modules/libnpmorg/CHANGELOG.md create mode 100644 deps/npm/node_modules/libnpmorg/CODE_OF_CONDUCT.md create mode 100644 deps/npm/node_modules/libnpmorg/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/libnpmorg/LICENSE create mode 100644 deps/npm/node_modules/libnpmorg/PULL_REQUEST_TEMPLATE create mode 100644 deps/npm/node_modules/libnpmorg/README.md create mode 100644 deps/npm/node_modules/libnpmorg/index.js create mode 100644 deps/npm/node_modules/libnpmorg/node_modules/aproba/CHANGELOG.md create mode 100644 deps/npm/node_modules/libnpmorg/node_modules/aproba/LICENSE create mode 100644 deps/npm/node_modules/libnpmorg/node_modules/aproba/README.md create mode 100644 deps/npm/node_modules/libnpmorg/node_modules/aproba/index.js create mode 100644 deps/npm/node_modules/libnpmorg/node_modules/aproba/package.json create mode 100644 deps/npm/node_modules/libnpmorg/package.json create mode 100644 deps/npm/node_modules/libnpmorg/test/index.js create mode 100644 deps/npm/node_modules/libnpmorg/test/util/tnock.js create mode 100644 deps/npm/node_modules/libnpmpublish/.travis.yml create mode 100644 deps/npm/node_modules/libnpmpublish/CHANGELOG.md create mode 100644 deps/npm/node_modules/libnpmpublish/CODE_OF_CONDUCT.md create mode 100644 deps/npm/node_modules/libnpmpublish/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/libnpmpublish/LICENSE create mode 100644 deps/npm/node_modules/libnpmpublish/PULL_REQUEST_TEMPLATE create mode 100644 deps/npm/node_modules/libnpmpublish/README.md create mode 100644 deps/npm/node_modules/libnpmpublish/appveyor.yml create mode 100644 deps/npm/node_modules/libnpmpublish/index.js create mode 100644 deps/npm/node_modules/libnpmpublish/package.json create mode 100644 deps/npm/node_modules/libnpmpublish/publish.js create mode 100644 deps/npm/node_modules/libnpmpublish/test/publish.js create mode 100644 deps/npm/node_modules/libnpmpublish/test/unpublish.js create mode 100644 deps/npm/node_modules/libnpmpublish/test/util/mock-tarball.js create mode 100644 deps/npm/node_modules/libnpmpublish/test/util/tnock.js create mode 100644 deps/npm/node_modules/libnpmpublish/unpublish.js create mode 100644 deps/npm/node_modules/libnpmsearch/CHANGELOG.md create mode 100644 deps/npm/node_modules/libnpmsearch/CODE_OF_CONDUCT.md create mode 100644 deps/npm/node_modules/libnpmsearch/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/libnpmsearch/LICENSE create mode 100644 deps/npm/node_modules/libnpmsearch/PULL_REQUEST_TEMPLATE create mode 100644 deps/npm/node_modules/libnpmsearch/README.md create mode 100644 deps/npm/node_modules/libnpmsearch/index.js create mode 100644 deps/npm/node_modules/libnpmsearch/package.json create mode 100644 deps/npm/node_modules/libnpmsearch/test/index.js create mode 100644 deps/npm/node_modules/libnpmsearch/test/util/tnock.js create mode 100644 deps/npm/node_modules/libnpmteam/.travis.yml create mode 100644 deps/npm/node_modules/libnpmteam/CHANGELOG.md create mode 100644 deps/npm/node_modules/libnpmteam/CODE_OF_CONDUCT.md create mode 100644 deps/npm/node_modules/libnpmteam/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/libnpmteam/LICENSE create mode 100644 deps/npm/node_modules/libnpmteam/PULL_REQUEST_TEMPLATE create mode 100644 deps/npm/node_modules/libnpmteam/README.md create mode 100644 deps/npm/node_modules/libnpmteam/appveyor.yml create mode 100644 deps/npm/node_modules/libnpmteam/index.js create mode 100644 deps/npm/node_modules/libnpmteam/node_modules/aproba/CHANGELOG.md create mode 100644 deps/npm/node_modules/libnpmteam/node_modules/aproba/LICENSE create mode 100644 deps/npm/node_modules/libnpmteam/node_modules/aproba/README.md create mode 100644 deps/npm/node_modules/libnpmteam/node_modules/aproba/index.js create mode 100644 deps/npm/node_modules/libnpmteam/node_modules/aproba/package.json create mode 100644 deps/npm/node_modules/libnpmteam/package.json create mode 100644 deps/npm/node_modules/libnpmteam/test/index.js create mode 100644 deps/npm/node_modules/libnpmteam/test/util/tnock.js create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/aproba/LICENSE create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/aproba/README.md create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/aproba/index.js create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/aproba/package.json delete mode 100644 deps/npm/node_modules/npm-registry-client/CHANGELOG.md delete mode 100644 deps/npm/node_modules/npm-registry-client/README.md delete mode 100644 deps/npm/node_modules/npm-registry-client/index.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/access.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/adduser.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/attempt.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/authify.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/deprecate.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/dist-tags/add.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/dist-tags/fetch.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/dist-tags/rm.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/dist-tags/set.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/dist-tags/update.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/fetch.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/get.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/initialize.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/logout.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/org.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/ping.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/publish.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/request.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/send-anonymous-CLI-metrics.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/star.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/stars.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/tag.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/team.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/unpublish.js delete mode 100644 deps/npm/node_modules/npm-registry-client/lib/whoami.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/License delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/ssri/CHANGELOG.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/ssri/LICENSE.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/ssri/README.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/ssri/index.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/ssri/package.json delete mode 100644 deps/npm/node_modules/npm-registry-client/package.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/CHANGELOG.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/LICENSE.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/README.es.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/README.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/en.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/es.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/get.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/content/path.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/content/read.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/content/rm.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/content/write.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/entry-index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/memoization.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/util/fix-owner.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/util/hash-to-segments.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/util/move-file.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/util/tmp.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/util/y.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/lib/verify.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/locales/en.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/locales/en.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/locales/es.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/locales/es.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/ls.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/node_modules/mississippi/changelog.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/node_modules/mississippi/index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/node_modules/mississippi/license delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/node_modules/mississippi/package.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/node_modules/mississippi/readme.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/package.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/put.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/rm.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/cacache/verify.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/figgy-pudding/CHANGELOG.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/figgy-pudding/LICENSE.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/figgy-pudding/README.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/figgy-pudding/index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/figgy-pudding/package.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/CHANGELOG.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/LICENSE delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/README.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/agent.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/cache.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/package.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/warning.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/pump/.travis.yml delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/pump/README.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/pump/index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/pump/package.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/pump/test-browser.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/pump/test-node.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/.npmignore delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/.travis.yml delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/LICENSE delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/README.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/build/smartbuffer.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/build/smartbuffer.js.map delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/lib/smart-buffer.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/package.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/test/smart-buffer.test.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/typings/index.d.ts delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks-proxy-agent/.npmignore delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks-proxy-agent/.travis.yml delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks-proxy-agent/History.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks-proxy-agent/README.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks-proxy-agent/index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks-proxy-agent/package.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.key delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.pem delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks-proxy-agent/test/test.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks/.npmignore delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks/LICENSE delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks/README.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks/examples/associate.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks/examples/bind.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks/examples/connect.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks/index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks/lib/socks-agent.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks/lib/socks-client.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/socks/package.json delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/ssri/CHANGELOG.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/ssri/LICENSE.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/ssri/README.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/ssri/index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/ssri/package.json create mode 100644 deps/npm/node_modules/pacote/lib/fetchers/alias.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/registry/check-warning-header.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/registry/fetch.js create mode 100644 deps/npm/node_modules/pacote/lib/fetchers/registry/packument.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/registry/pick-registry.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/registry/registry-key.js create mode 100644 deps/npm/node_modules/pacote/lib/util/proclog.js delete mode 100644 deps/npm/node_modules/pacote/lib/util/silentlog.js create mode 100644 deps/npm/node_modules/pacote/node_modules/lru-cache/LICENSE create mode 100644 deps/npm/node_modules/pacote/node_modules/lru-cache/README.md create mode 100644 deps/npm/node_modules/pacote/node_modules/lru-cache/index.js create mode 100644 deps/npm/node_modules/pacote/node_modules/lru-cache/package.json create mode 100644 deps/npm/node_modules/pacote/node_modules/minipass/LICENSE create mode 100644 deps/npm/node_modules/pacote/node_modules/minipass/README.md create mode 100644 deps/npm/node_modules/pacote/node_modules/minipass/index.js create mode 100644 deps/npm/node_modules/pacote/node_modules/minipass/package.json create mode 100644 deps/npm/node_modules/pacote/node_modules/yallist/LICENSE create mode 100644 deps/npm/node_modules/pacote/node_modules/yallist/README.md create mode 100644 deps/npm/node_modules/pacote/node_modules/yallist/iterator.js create mode 100644 deps/npm/node_modules/pacote/node_modules/yallist/package.json create mode 100644 deps/npm/node_modules/pacote/node_modules/yallist/yallist.js create mode 100644 deps/npm/node_modules/pacote/packument.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/.travis.yml create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/GOVERNANCE.md create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/LICENSE create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/README.md create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/duplex-browser.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/duplex.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/package.json create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/passthrough.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/readable-browser.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/readable.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/transform.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/writable-browser.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/writable.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/string_decoder/.travis.yml create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/string_decoder/LICENSE create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/string_decoder/README.md create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/string_decoder/lib/string_decoder.js create mode 100644 deps/npm/node_modules/parallel-transform/node_modules/string_decoder/package.json create mode 100644 deps/npm/node_modules/readable-stream/errors-browser.js create mode 100644 deps/npm/node_modules/readable-stream/errors.js create mode 100644 deps/npm/node_modules/readable-stream/experimentalWarning.js create mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/async_iterator.js create mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/buffer_list.js create mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/end-of-stream.js create mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/pipeline.js create mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/state.js create mode 100644 deps/npm/node_modules/readable-stream/yarn.lock create mode 100644 deps/npm/node_modules/run-queue/node_modules/aproba/LICENSE create mode 100644 deps/npm/node_modules/run-queue/node_modules/aproba/README.md create mode 100644 deps/npm/node_modules/run-queue/node_modules/aproba/index.js create mode 100644 deps/npm/node_modules/run-queue/node_modules/aproba/package.json create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/.travis.yml create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/GOVERNANCE.md create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/LICENSE create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/README.md create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/duplex-browser.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/duplex.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/package.json create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/passthrough.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/readable-browser.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/readable.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/transform.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/writable-browser.js create mode 100644 deps/npm/node_modules/sha/node_modules/readable-stream/writable.js create mode 100644 deps/npm/node_modules/sha/node_modules/string_decoder/.travis.yml create mode 100644 deps/npm/node_modules/sha/node_modules/string_decoder/LICENSE create mode 100644 deps/npm/node_modules/sha/node_modules/string_decoder/README.md create mode 100644 deps/npm/node_modules/sha/node_modules/string_decoder/lib/string_decoder.js create mode 100644 deps/npm/node_modules/sha/node_modules/string_decoder/package.json create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/.travis.yml create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/GOVERNANCE.md create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/LICENSE create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/README.md create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/duplex-browser.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/duplex.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/package.json create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/passthrough.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/readable-browser.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/readable.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/transform.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/writable-browser.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/writable.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/string_decoder/.travis.yml create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/string_decoder/LICENSE create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/string_decoder/README.md create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/string_decoder/lib/string_decoder.js create mode 100644 deps/npm/node_modules/stream-iterate/node_modules/string_decoder/package.json create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/.travis.yml create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/GOVERNANCE.md create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/LICENSE create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/README.md create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/duplex-browser.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/duplex.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/package.json create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/passthrough.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/readable-browser.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/readable.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/transform.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/writable-browser.js create mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/writable.js create mode 100644 deps/npm/node_modules/through2/node_modules/string_decoder/.travis.yml create mode 100644 deps/npm/node_modules/through2/node_modules/string_decoder/LICENSE create mode 100644 deps/npm/node_modules/through2/node_modules/string_decoder/README.md create mode 100644 deps/npm/node_modules/through2/node_modules/string_decoder/lib/string_decoder.js create mode 100644 deps/npm/node_modules/through2/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/unique-filename/.npmignore create mode 100644 deps/npm/node_modules/unique-filename/LICENSE create mode 100644 deps/npm/node_modules/write-file-atomic/CHANGELOG.md create mode 100644 deps/npm/test/fixtures/config/userconfig-with-gc create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/07/07/8db5f6377f6321fceaaedf497de124dc9465 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/28/eb/847a949e71eb9041fd6567a36c9acfcf2bed create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/2a/77/307e108bfb57107c4c334abb5ef5395dc68a create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/35/6a/192b7913b04c54574d18c28d46e6395428ab create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/41/c8/0b2b6f5432c60cddb81932ab56563b444f52 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/45/c8/a39b626c1f83f8b8f53007c2f60eb98eee9d create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/69/42/4826f3405f79f142e6fc3d9ae58d4dbb9200 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/82/f3/ccba11914dc88bcb185ee3b1b33b564272bc create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/b6/bb/e0b0674b9d719708ca38de8c237cb526c3d1 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/b7/96/69bb42ecb409f83d583cad52ca17eaa1643f create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/c2/7a/36bf00f3a7a3d24a8fbc7853f06fce4e9c86 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/ca/43/09dadee6b54cc0b8d247e8d7c7a0975bdc9b create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/d2/bd/e817d176ffade894ab71458e682a14b86dc9 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/d7/aa/327bcecf518f9106ac6b8f003fa3bcea8566 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/e0/50/08f3ff82b34f17b1e972454a0ab70a269c7d create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha1/ee/56/8a2b1efaeb95bec4d9e59e5301fc63339866 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/0b/61/241d7c17bcbb1baee7094d14b7c451efecc7ffcbd92598a0f13d313cc9ebc2a07e61f007baf58fbf94ff9a8695bdd5cae7ce03bbf1e94e93613a00f25f21 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/15/ad/34853f1149526d97f08b50c3aaa9ec84031a7ebfb7bb59e3f2317d5c306286528cb91bf53dc596802d316762e5ba4641764b2680945ba3f620d3cf798a05 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/21/82/eac4f83e50f3b6aa8bea561c5dfebdc1d66941e2da785af406e045de56a0fc422034ca7fa2ab5fa99022c6b860203eb4853ce85f15f26b96c84b8d9e7320 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/22/fe/eed42d3bab5ff699721346f9c5fa7a70ac2748ee0ced75bc0b8f6e8aba924f53a93404b30fa8d28e0d64c14922e8f0d1ed1c212ef3f15d00e9527b17b9b9 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/2c/ec/8afad096618ae60ad9cd1cf2d2d9d5597b68010cc087c9a78765ef0dacd25c13a0e36948949317f09f667274ee5fa714abdc1b158e5cfea5ca5401663425 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/2e/36/48f976830aeaba0724b382a09a6a6736dfd4c755963a4f462f963f9ecb211c2258f00766dc3aa68664f66d3a01cb2789b2cf614aeb292dbeb4afe0b206cc create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/32/c8/6992ba4671408a292bb3f2fae4cd10416dcedb6a214c169054af6bcc792b6ea56f7245333357cc59e4f84660380604b5ff338258ad46973218d864799b5e create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/35/39/721f705f621cffe30dbc828be387e253c50ed05fb0a8e3f418769996bdde1dd1cb8af2e47dfe9417aab7ac3d238d1f036ef2e9adb898c386f0cda9b6861e create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/35/aa/ea2b3a5902264c14606117b00e20425af14560c323e92859dd86f4cc552146fc06548a31ea59ba6edd569b6a41a201781f6a39900082feaac81923a12e57 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/37/27/2f58378ed591197373f46d3be148bfc82649dbb213be14a2b1ac47f50d7d4804cb105590935a7bcd02dfae3a2421c939cafb586b9f1b6c492fdfe09aca86 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/3a/f5/ac6e34332259d456779c882d9d0db472befe84fd8043ac328bf51e1bdcd47437b17eff4d92df4ad8e999b2c2e140779cde81f69475d8d4591808103b964b create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/52/3a/902538a5ebd3ce129087f262bf0a1663c2fdb6a636acd7660e386fbf2f8d097946cda07518bbd9b9fc9c5be725e8ae6041e62c9e9e81de5585e900328b09 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/54/95/fe840edbf5d18dfc27c5f4d9b359e8ab81a4741f62b0deb20979359843828ae50112bac4e25a3fc1089d260fd9b8236e434a3a55580b7aaba369e6f8ba87 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/5a/64/0274b5cfdc4e0635bdd262c5830de7faf9c02d3c5ef66a60ac58ed20fcb324f85d7ef7b6e85210d8209122096191893f662db33d0569837305388bad35bf create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/5d/29/d6e1add2536379abc1eba52f83824a6091a5af9ffba1479cf404f478f36f06504f6643db8631e0b6f057e55140d84489cacc140627e012824fa073f97568 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/6f/c7/3dd4508c2d9f17eeb1cfd288276948a1689ebdf6a8d3f4f7516d4c68be639063e7e5437ef7ff72547aabe86b49a6b1bf5c733bdece3877d82bc8bc1a9a7d create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/76/39/4b378512c68bf209b433e06b71df27a45f7e7be35f174a0f83bce7799628b74dbe993c18b1c12e899a1ed7b159470b382180d1f0a5c4098ac6092cda1a8f create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/79/ec/4625bec1a13aaefdcd4e7cf18f1c5575879d80e8bdba063cc962c959c48526a0c1c9e3766c95ec9ea1cf10cd954968f3bfec136f0d3aa87009db05cf4666 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/83/a4/d747b806caae7385778145bcf999fae69eeb6f14343f6801b79b6b7853538961694ac8b4791c7675c27928b5495d12d2f944867db1105e424d5fa9b1e015 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/87/44/66cb46d039cc912bd3ee29bfae97ac7f4dd4051cd240c1b25548747f9f1c6fdc3a2a9e65b058ab28f0a22b4aaee58075e0c77fd00ddf656536bc543290be create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/88/49/914fc692dc5441fec8231a33caec98409b6d522fa46bed4a673127876224b9cb8bc35e51e251c8a897a1d71dd9d7f46b6217ec8ef30ec4d83f4b9a43098d create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/9d/5b/15d0ad75fc513f4a327b5e441803dd220edeb4f9660e454fe9d263b543ba356c71330a5964f864d1c24aada16bea028eb40106762b142b30d448cdc08593 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/9d/b3/095447c9b53fe88bbf190fb6a324c7a42a84bf51d3c345fc88cdeea00f026167ad7329b42369d79a67812738a2324b7aae42d4feeac49a2b895c57b48168 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/a0/f8/5ae8b484bc71fb13ef636b9aee45f548ab6357488369ffb02f239f9473c6b94c5c2a5ef3b1b96e16ce6158dc05f13ef88bcef32de3bc415a48cdc5500355 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/a1/a1/072cae616c1f6479110e3e3ee54fa16978c081d8032999d62d207e5cd6c7643e463d73d3ff4b218ad717724c918013e03954f9729192cbdfa1d0bed6fd39 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/aa/86/730ec932cdb0f05db2f35e1e456fc986db19f83fb3f8140a5851411fbcf44966328479ab280cc80ae2d740cdc01f8f880836a00c66743565acd2e8352e7a create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/ad/a1/cd9122e6beb95de36bb8dc10c255a6a7d7b8bfbe21b72843ab6db402ee8cb8bde5fb2d050a7eb96ea330e8be1a394c4c7c444c8b541f8e180b7f12506fe8 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/b4/8a/454c55f95fa0351cca479761f5ff792f8f7ab4448f2b1399a3ac3778a60a293f71feeda29678ce15b71712b0803f9866e92c0cbc4549b4807435dcf7a767 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/c9/a2/065bb9746e574a541af061b7880948d30e47db1dc356c314bd934b0169894d696e833bd63b6c53cb973d14b8064b5b04177c402e347770ddfbbbc7c906cb create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/cd/eb/0f5065be03e89547a33e064d911969953c45eb05df664ca4d537b970dc9f768123463a6f75ce6b836d50ee73c18ac7a25e763f2b9869612cdbf427195d4b create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/d4/45/ed72e65ed0b9fec5a6a41794caadda951ba79a0541648e259c8021b3fc96487d2caedf869ac142b4b0f31998c436f171d98a9a1740e3ac8eebb5c1103c53 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/dc/2a/a4df42cd435623f4c2c3e274fa081cc942ff45dcfa98cdf4a9324b6a21c3721c34bb97e6809ee28051fc10f57749cff60aa970a1e38c7a6c354a9403554e create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/dc/68/8298544a3867cf399b04cc60c38c6519dae6096c5ba1917bb78a489baa9d6bad39649e16e00367e7cd02ac14ba7cd64f3acd56e21b984630f823ad9c9663 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/e7/06/de9d8e6ce16152be537cbccdf26321b3d678394ce42fb56aa4e69a37aba9d54df284700d066f7e6d005e461ab41d220fd6f268ff889e405809108a7b8676 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/e8/36/89a9c21ac93c2a0efc7e536925004e528bd3bfeba708cf5216db999c5efce0d7138a7e6ecedb125e43ba2aeb475d5958a2ca31f48c6a1442f164e90a3a22 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/ed/fc/2d79d0d55bf4ea02b74ecc3657ea833bc6d0578adb2e1f5ae0d733b09a484f8e7287901578c7bdaa5d6fd30ac4dea48773a610ca6ee1e09e31f6147e921d create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/f3/e8/2d6a0b75ad5cebd09177d93f572dbd8b877ee9f1505b2e84e03810fa0412e4904060be7d2a4df4221b1bb92884db886826bf8cd26634667a2d103a999438 create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/f5/91/da7ce6e308dcaa672b8625ca0491cafed6726ceda16ffbcdd3f7661e5eb5b1aae2bd99960acb3a2fcc61a14edff79dd7bd610b27c57fea8aff535dbc519f create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/f5/bd/a6b78fcf204b1ec0e6069045b44f6669e9aab878bfc891b946e4cecb843f4e87e428b6771ae7b4a2ce8f303e97746763b0642faf89a9b00425297dc78d6a create mode 100644 deps/npm/test/npm_cache/_cacache/content-v2/sha512/fd/37/65c30143da9bd36758e4f19cce0984aac9f6a6a90a2a1ea79ab8acec84841b7b2af4b20e52051d585ac12bef1930d35234d6556319315d5656391257472d create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/06/90/5e61e746e7d543d4bffbfeead5822d45a4e7089a414fbe6f1be007f6cd48 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/0b/5a/62ce62a24edca98b341182e328ec6d451a459b384cac489f57771ed7e74a create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/0e/d4/8aa7d55331a48f04b5218bb50c1c639e7a3600893f62fde6191d2563e6df create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/13/b5/0178cbb8a4a3e25b821dbdd82db862373a457bbab3fee9c0e305b4f83b37 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/14/7e/33640d7ecca75f94fce8a3c3b46e111bc08921520f7b2cce032bf8862107 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/15/bf/92c5cbc5f2b5bb51971d6f7d04cf0b3871bdde88a368eed466901917d636 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/18/1f/b15fb9d4fbd32e771ad6afadda07bc566c24b4b589c6bbc5c3e996c7a3db create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/19/db/491ce5fd3b8f5521f62a3d208c8b91325f3f8fe347347649e2e7cb8c10b2 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/1c/05/419d1e706cbe2c4b49cddcc72c47c6fbcde4ff2cdbb76da7c1defd09d6d6 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/1d/95/be47aca6f275eae3f3b2d5c35a85f51736f1403d8fd3790ab0e354238f68 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/1e/c1/c1f0fea37e015610f77e0486d0c90745de8da2029e042c59f6197901f5fb create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/1f/4c/7c6c652ccd8d9b32c0b4ef03e8a114c823d405df62054797ae8e510155d2 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/21/69/cf895689c136d0f667f13d167389f0bdff113e4a85c2d0a34e8420953fb0 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/21/90/97d7c2a8081808dcd3d6fc97011bebe11fc8e308eaff2d4224c21477d1d5 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/24/d3/c242b6ced69f0f27995a54c44c2c4ef172a4c3a0e7c91e0b8da7b9c418f8 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/29/89/d8ec4f471f8b2f7110ade5b17475bf87d30ec77a66a68a3481fbcb2299ca create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/2d/22/47328dfeb3a9f00c15c20ec3ebdaa0e12382c5c6badfa30fb7b376f6a580 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/2f/ee/99c47a7b4b5d997bbdb8d0095b14f1940fbdde0e7515bc19ccfcfbccec49 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/32/2d/90e41f3ad9eeece7d8bafb5672197db1ee77ca9aa734a3e77692efcf7716 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/34/f7/495a783848aed5199e0583f72c91d67d20fa9f5f5604755719bc421195dd create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/35/d4/4f8776a16f1d67cec7136a104fc757d4d7719d47a6b5d71c1b3075cc1b69 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/4b/fa/51a839f22632c42d66d63607a55048be00c0a16bcf8dc96b9aadb8511570 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/4c/94/5f2a94150990b1ee4ecadd4897498d69b3141e0d72f1ccc1f3bd703a4c75 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/4c/9f/92b75e7965b407ec25a6d5770af0d18432dbca32e8a2a9958dd413e3b776 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/4d/ed/ee7db809a7dfddfb87fc4055ac06876c63165a517fc12011046fc2cc4a9f create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/4e/ce/f2fe3deddf79eb0c8c03828e46b026559f16671fbad7c36d5e0a1bd28a7f create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/52/26/16d800e2651582fd96b18d4ff02085c52be8b7b4b739d0da243122208329 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/53/b9/a3f54151106c138d93ef4e411f13d971ff84939f5a96a1d5826244927399 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/54/c7/bd7b2edde99a50402386dc89dd492bc0e1c9c57727fbf97333ab23450cc6 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/55/94/6aae1bf2eae7384bbf56a2610deec22135ab5102d53f8dc5bb1359585a5c create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/56/a3/d63cf88aff86698120f294331ca4785e2ef41b621d746ef1047eaf34e122 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/58/cd/24c1bfea16737029dabb2e41b34b7a019b657b6db6c972a30870f3318344 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/58/fc/50f89b2f236774e4b33eda6968cde18196e800153a6162d5f73df18895fa create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/59/28/f3ffadce8db4fdb922343ee79cb0ab6d1b2f500885d3a7d93bbb4b24e711 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/59/5d/20f410f92d365ec2b34c98856ae075582e2842b381809c76ffd12d24c450 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/59/8d/bede4978235a53fade60aedbfe40200d189691fae9d90c694f654422738c create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/5e/04/1f94a3a706d4fc86a4e28c064e5182f98631dbc1156be71fa734471d1b31 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/5e/25/544dc931f40d3c9ec02d15a7754abc281ff227d3d4436045fc19bded3abb create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/5f/dc/61605b7783855ffa612d4a7dbf1f5e94e01b700897b6a69b1700a9575905 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/60/3b/12bd2d0346c46847789322cfa6781845b7bac7c9830246b89d040ab35bfa create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/61/41/453946604fdfa210a19eb38d07610e8ad7007ffc3f0f3b25da20b9af281d create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/61/5a/c55f3eb9bc8031cdde40de9f1b4244b118714d5d156afca81319c4ed13be create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/64/32/09fccfaff76a1d99becccff3c9a0701f54d94e18ea19ff39aeb0a235d833 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/69/d2/6f1c982c4935f9c4a3b7181092bc6213963acf08be267556eed18c1ffcca create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/6b/27/515478d59b0ba28fcdaffd08317ec59071d08bdedd169a5f40c3b1fbb486 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/6f/d4/db68ad12df42b50094e39edbd34fc9713c6c020ca44a5a0b426ff048428d create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/6f/ed/7f64617d06ba2145efd7117d088c8431300750cd1c934e227cfecffa01f5 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/77/52/b7394cb3a27a44448e3ac4d6834e73ca79c301c7108c94b0ba23ca97b71c create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/80/e4/0b59aa33a0f8b0f183dcbcdf1d48b9436619bf5b6fd10474ef86e41a8c6f create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/87/c9/f8b19f8ad4e5648c18927a0d7d21e557756b443699e6929fe420d5aa82a2 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/89/eb/a7a81ab3eeec3076546f7e1fce3892c4e717a9379d4ad43a7111b5dc8cc2 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/8b/2e/99af1be8f0aa3d6223b000c96edea31a1e6d923f7f3daf1ff06e04899cbb create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/8c/cf/08c44da29714d229eaceaad1d0ca321b8e5cc8080001efa90bd6e7cf2d10 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/8e/53/8602d3aab48229cac8aeeb996d0c850341d8e832b38df45ce8b79f2d7f6a create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/93/4e/425c049345ed549becd9e42f3ca7ad942331f73dd73c3e6f5549e910679b create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/96/66/5a9f2d90e8428d5b30418640b55c06029c2d36a3dc34ee91b90483a9973d create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/9b/00/38d905a4cf8b1a291d0a7bca660b3b4f409bea196a8cea3f3e66c5a8e84b create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/9b/03/54636aae9cb55a079d1cc7f9caf4f3e654df7abd1fc8279dde9f935c76aa create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/9c/df/2bf910aa7cba3cae28d9c34ba6cd492e2a0053b4aeea258df6763e8cd8a2 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/9f/3f/3bc8b783702f297c0e0f134ecf35495d997ad1c67532fe520ac6709d28c5 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/9f/5f/7b93b3b7f757730e79213f4cb7e73c072a15544da364e543df7bef989d9c create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/a2/4a/41538002c219a054a1ecf2e6be6e66dac4d4feb5407eb6ecb26af41a4de8 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/a2/ff/2fbedd19724625ef6060f72129b8494625e3e6fd08f7fd5886f65bf82e0d create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/a6/c9/dbe7acc04b7cea7b99c68f3821cf6d7f49caba301e383b31143bd9670f28 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/a8/15/13afeacd20fdb82b59ceeaa57b4d135c5def8209619ca09751fdae5bd803 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/a8/88/3a6a0c55cde913db472fd92adee9edf0f507c4ea02b2703d926b06947341 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/ad/29/4a034c1908dcd263dce381384f50b395b52e2addd35285efab8ec8f5b303 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/ad/e9/1d8533ddd67b495ca9cffd992a45de09faf0f0fe2ad2c446353a58288f6b create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/b1/78/4ff2f1383234ce5feb54cec21589dfd82db09bd3c7016d436760a3e94f60 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/b2/47/c8196ddf74a5111fedbaf5abf24d446c017f7bfba330c19d63fc24000277 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/b3/36/c25c35e75c8973f821f5a05ce4803a44826a0112390460da66c8c3c5de69 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/b4/2c/2aec38b0351146be02fc91be78e935c68f4608824732a06091fcf7cb550a create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/b4/a9/95ce79090bb3e6ab5e8a85aaef872bf4eca492fac6cab144fb2e45ffbd74 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/b7/1c/f06201305985169fc251111ddb9fa636ef144ff9fad15784c1e9620b0dac create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/b8/16/bf6e49afbd1323783f2f5a63b3d871adc66f517669450807aec3b62e71b2 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/ba/41/d137c2778ea0d7167fbc730827a0a2c453ffea82d07c7b1481a46f7b1194 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/be/6a/458105f31e845d57376ed2b2019e46a63cff8cbb76981a37eac2100c8e55 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/c4/08/207afc5ca1803fa593124554206657c17eb6b2809df9f5ec1c10007a6465 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/c7/6a/1f6606232f53d41a78bcb0a155df04211a49d1fdb1b67e59ccb47e20c353 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/ca/2f/42a626cb16aeb63c2dc04be95e67db8ea33ce033a3fadf0ba1061c174d3e create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/d0/a2/9b5933a9df317b031c4407f0d9cae19a4d56f253f7746786597a52daa76d create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/d2/0a/0834f8c04d97b43d0f99901f9c56c3654221987030a0f86aac7f7caecccc create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/d8/8f/1bf51f3ab635ab46a8693c919a915102645335a143056a5f12cafef915c0 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/de/9f/35f1c704459881fb3c9e83a59e80c3482dd62f626939323f2b6bf511b53d create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/df/88/3ff6bf48df44c29ce1193e883193e034208d95b6028728ef3902b78b694d create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/e8/1b/a9b0963bde9d8cb31e0fe8762eac5e3d3c2cd27e8bb1fbcdc22399c3d89e create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/ec/6e/39493289897b28d06119b515a4d107ae1cd16ef94cdbbbd34a1c5687e07d create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/ed/27/eea30d253f59f5df5e11155392ad66e8ee2a352798e5fe782b98c941c2c6 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/ed/4a/09a226827d40ba61648afad16c456d1d0fbce7e14fc1c7a9dba42620f68a create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/ee/20/77825ded7fe59483cde11169fc083be6367490e46bce28208b4f7b5cb2f8 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/f2/8a/d9e34baa5c3e47b2bf8e975217eae2e4816c2a8e9cdee330a1e2acfbd7a6 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/f2/dd/746a6d5b6232e793f562d37f6471e6bd96641b1670b43d01fca9e23884e3 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/f6/6a/1afded1007145f766ff1dbaa948bd898062da50bed98d5b04f317278fa48 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/fc/88/41f0501b29bfe9117061c190df783256e332cab7782a7484078354ddbb0f create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/fd/a9/67911fbad568af62425934e3a7938145b60af92641734e54a8f50a418c03 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/fe/7e/e4d136986019ebc5360c54baee7ae9bec37f513387665b57ac2bcd167b70 create mode 100644 deps/npm/test/npm_cache/_cacache/index-v5/ff/d3/eca629ba696cac5a91e13f61bb768d7cbf82072f798d17071572ab3943f2 create mode 100644 deps/npm/test/npm_cache/_logs/2019-01-18T17_41_24_580Z-debug.log create mode 100644 deps/npm/test/npm_cache/_logs/2019-01-18T17_41_26_268Z-debug.log create mode 100644 deps/npm/test/npm_cache/_logs/2019-01-18T17_41_28_020Z-debug.log create mode 100644 deps/npm/test/npm_cache/_logs/2019-01-18T17_41_39_719Z-debug.log create mode 100644 deps/npm/test/npm_cache/_logs/2019-01-18T17_41_40_242Z-debug.log create mode 100644 deps/npm/test/npm_cache/_logs/2019-01-18T17_41_47_912Z-debug.log create mode 100644 deps/npm/test/npm_cache/_logs/2019-01-18T17_41_48_220Z-debug.log create mode 100644 deps/npm/test/npm_cache/_logs/2019-01-18T17_41_57_730Z-debug.log create mode 100644 deps/npm/test/npm_cache/_logs/2019-01-18T17_42_14_004Z-debug.log create mode 100644 deps/npm/test/npm_cache/anonymous-cli-metrics.json delete mode 100644 deps/npm/test/tap/get.js create mode 100644 deps/npm/test/tap/install-dep-classification.js delete mode 100644 deps/npm/test/tap/map-to-registry.js create mode 100644 deps/npm/test/tap/org.js delete mode 100644 deps/npm/test/tap/search.esearch.js diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index f66afe80f01a1b..a011b51d6a036e 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -612,3 +612,10 @@ Joe Bottigliero Nikolai Vavilov Kelvin Jin 乱序 +Audrey Eschright +Xu Meng +George +Beni von Cheni +Frédéric Harper +Johannes Würbach +ƇʘƁ̆ąƇ́ diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index f886ea4adbae2b..794ae1060441e1 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,308 @@ +## v6.7.0 (2019-01-23): + +Hey y'all! This is a quick hotfix release that includes some important fixes to +`npm@6.6.0` related to the large rewrite/refactor. We're tagging it as a feature +release because the changes involve some minor new features, and semver is +semver, but there's nothing major here. + +### NEW FEATURES + +* [`50463f58b`](https://github.com/npm/cli/commit/50463f58b4b70180a85d6d8c10fcf50d8970ef5e) + Improve usage errors to `npm org` commands and add optional filtering to `npm + org ls` subcommand. + ([@zkat](https://github.com/zkat)) + +### BUGFIXES + +* [`4027070b0`](https://github.com/npm/cli/commit/4027070b03be3bdae2515f2291de89b91f901df9) + Fix default usage printout for `npm org` so you actually see how it's supposed + to be used. + ([@zkat](https://github.com/zkat)) +* [`cfea6ea5b`](https://github.com/npm/cli/commit/cfea6ea5b67ec5e4ec57e3a9cb8c82d018cb5476) + fix default usage message for npm hook + ([@zkat](https://github.com/zkat)) + +### DOCS + +* [`e959e1421`](https://github.com/npm/cli/commit/e959e14217d751ddb295565fd75cc81de1ee0d5b) + Add manpage for `npm org` command. + ([@zkat](https://github.com/zkat)) + +### DEPENDENCY BUMPS + +* [`8543fc357`](https://github.com/npm/cli/commit/8543fc3576f64e91f7946d4c56a5ffb045b55156) + `pacote@9.4.0`: Fall back to "fullfat" packuments on ETARGET errors. This will + make it so that, when a package is published but the corgi follower hasn't + caught up, users can still install a freshly-published package. + ([@zkat](https://github.com/zkat)) +* [`75475043b`](https://github.com/npm/cli/commit/75475043b03a254b2e7db2c04c3f0baea31d8dc5) + [npm.community#4752](https://npm.community/t/npm-6-6-0-broke-authentication-with-npm-registry-couchapp/4752) + `libnpmpublish@1.1.1`: Fixes auth error for username/password legacy authentication. + ([@sreeramjayan](https://github.com/sreeramjayan)) +* [`0af8c00ac`](https://github.com/npm/cli/commit/0af8c00acb01849362ffca25b567cc62447c7175) + [npm.community#4746](https://npm.community/t/npm-6-6-0-release-breaking-docker-npm-ci-commands/4746) + `libcipm@3.0.3`: Fixes issue with "cannot run in wd" errors for run-scripts. + ([@zkat](https://github.com/zkat)) +* [`5a7962e46`](https://github.com/npm/cli/commit/5a7962e46f582c6bd91784b0ddc941ed45e9f802) + `write-file-atomic@2.4.2`: + Fixes issues with leaking `signal-exit` instances and file descriptors. + ([@iarna](https://github.com/iarna)) + +## v6.6.0 (2019-01-17): + +### REFACTORING OUT npm-REGISTRY-CLIENT + +Today is an auspicious day! This release marks the end of a massive internal +refactor to npm that means we finally got rid of the legacy +[`npm-registry-client`](https://npm.im/npm-registry-client) in favor of the +shiny, new, `window.fetch`-like +[`npm-registry-fetch`](https://npm.im/npm-registry-fetch). + +Now, the installer had already done most of this work with the release of +`npm@5`, but it turns out _every other command_ still used the legacy client. +This release updates all of those commands to use the new client, and while +we're at it, adds a few extra goodies: + +* All OTP-requiring commands will now **prompt**. `--otp` is no longer required for `dist-tag`, `access`, et al. +* We're starting to integrate a new config system which will eventually get extracted into a standalone package. +* We now use [`libnpm`](https://npm.im/libnpm) for the API functionality of a lot of our commands! That means you can install a library if you want to write your own tooling around them. +* There's now an `npm org` command for managing users in your org. +* [`pacote`](https://npm.im/pacote) now consumes npm-style configurations, instead of its own naming for various config vars. This will make it easier to load npm configs using `libnpm.config` and hand them directly to `pacote`. + +There's too many commits to list all of them here, so check out the PR if you're +curious about details: + +* [`c5af34c05`](https://github.com/npm/cli/commit/c5af34c05fd569aecd11f18d6d0ddeac3970b253) + [npm-registry-client@REMOVED](https://www.youtube.com/watch\?v\=kPIdRJlzERo) + ([@zkat](https://github.com/zkat)) +* [`4cca9cb90`](https://github.com/npm/cli/commit/4cca9cb9042c0eeb743377e8f1ae1c07733df43f) + [`ad67461dc`](https://github.com/npm/cli/commit/ad67461dc3a73d5ae6569fdbee44c67e1daf86e7) + [`77625f9e2`](https://github.com/npm/cli/commit/77625f9e20d4285b7726b3bf3ebc10cb21c638f0) + [`6e922aefb`](https://github.com/npm/cli/commit/6e922aefbb4634bbd77ed3b143e0765d63afc7f9) + [`584613ea8`](https://github.com/npm/cli/commit/584613ea8ff94b927db4957e5647504b30ca2b1f) + [`64de4ebf0`](https://github.com/npm/cli/commit/64de4ebf019b217179039124c6621e74651e4d27) + [`6cd87d1a9`](https://github.com/npm/cli/commit/6cd87d1a9bb90e795f9891ea4db384435f4a8930) + [`2786834c0`](https://github.com/npm/cli/commit/2786834c0257b8bb1bbb115f1ce7060abaab2e17) + [`514558e09`](https://github.com/npm/cli/commit/514558e094460fd0284a759c13965b685133b3fe) + [`dec07ebe3`](https://github.com/npm/cli/commit/dec07ebe3312245f6421c6e523660be4973ae8c2) + [`084741913`](https://github.com/npm/cli/commit/084741913c4fdb396e589abf3440b4be3aa0b67e) + [`45aff0e02`](https://github.com/npm/cli/commit/45aff0e02251785a85e56eafacf9efaeac6f92ae) + [`846ddcc44`](https://github.com/npm/cli/commit/846ddcc44538f2d9a51ac79405010dfe97fdcdeb) + [`8971ba1b9`](https://github.com/npm/cli/commit/8971ba1b953d4f05ff5094f1822b91526282edd8) + [`99156e081`](https://github.com/npm/cli/commit/99156e081a07516d6c970685bc3d858f89dc4f9c) + [`ab2155306`](https://github.com/npm/cli/commit/ab215530674d7f6123c9572d0ad4ca9e9b5fb184) + [`b37a66542`](https://github.com/npm/cli/commit/b37a66542ca2879069b2acd338b1904de71b7f40) + [`d2af0777a`](https://github.com/npm/cli/commit/d2af0777ac179ff5009dbbf0354a4a84f151b60f) + [`e0b4c6880`](https://github.com/npm/cli/commit/e0b4c6880504fa2e8491c2fbd098efcb2e496849) + [`ff72350b4`](https://github.com/npm/cli/commit/ff72350b4c56d65e4a92671d86a33080bf3c2ea5) + [`6ed943303`](https://github.com/npm/cli/commit/6ed943303ce7a267ddb26aa25caa035f832895dd) + [`90a069e7d`](https://github.com/npm/cli/commit/90a069e7d4646682211f4cabe289c306ee1d5397) + [`b24ed5fdc`](https://github.com/npm/cli/commit/b24ed5fdc3a4395628465ae5273bad54eea274c8) + [`ec9fcc14f`](https://github.com/npm/cli/commit/ec9fcc14f4e0e2f3967e2fd6ad8b8433076393cb) + [`8a56fa39e`](https://github.com/npm/cli/commit/8a56fa39e61136da45565447fe201a57f04ad4cd) + [`41d19e18f`](https://github.com/npm/cli/commit/41d19e18f769c6f0acfdffbdb01d12bf332908ce) + [`125ff9551`](https://github.com/npm/cli/commit/125ff9551595dda9dab2edaef10f4c73ae8e1433) + [`1c3b226ff`](https://github.com/npm/cli/commit/1c3b226ff37159c426e855e83c8f6c361603901d) + [`3c0a7b06b`](https://github.com/npm/cli/commit/3c0a7b06b6473fe068fc8ae8466c07a177975b87) + [`08fcb3f0f`](https://github.com/npm/cli/commit/08fcb3f0f26e025702b35253ed70a527ab69977f) + [`c8135d97a`](https://github.com/npm/cli/commit/c8135d97a424b38363dc4530c45e4583471e9849) + [`ae936f22c`](https://github.com/npm/cli/commit/ae936f22ce80614287f2769e9aaa9a155f03cc15) + [#2](https://github.com/npm/cli/pull/2) + Move rest of commands to `npm-registry-fetch` and use [`figgy-pudding`](https://npm.im/figgy-pudding) for configs. + ([@zkat](https://github.com/zkat)) + +### NEW FEATURES + +* [`02c837e01`](https://github.com/npm/cli/commit/02c837e01a71a26f37cbd5a09be89df8a9ce01da) + [#106](https://github.com/npm/cli/pull/106) + Make `npm dist-tags` the same as `npm dist-tag ls`. + ([@isaacs](https://github.com/isaacs)) +* [`1065a7809`](https://github.com/npm/cli/commit/1065a7809161fd4dc23e96b642019fc842fdacf2) + [#65](https://github.com/npm/cli/pull/65) + Add support for `IBM i`. + ([@dmabupt](https://github.com/dmabupt)) +* [`a22e6f5fc`](https://github.com/npm/cli/commit/a22e6f5fc3e91350d3c64dcc88eabbe0efbca759) + [#131](https://github.com/npm/cli/pull/131) + Update profile to support new npm-profile API. + ([@zkat](https://github.com/zkat)) + +### BUGFIXES + +* [`890a74458`](https://github.com/npm/cli/commit/890a74458dd4a55e2d85f3eba9dbf125affa4206) + [npm.community#3278](https://npm.community/t/3278) + Fix support for passing git binary path config with `--git`. + ([@larsgw](https://github.com/larsgw)) +* [`90e55a143`](https://github.com/npm/cli/commit/90e55a143ed1de8678d65c17bc3c2b103a15ddac) + [npm.community#2713](https://npm.community/t/npx-envinfo-preset-jest-fails-on-windows-with-a-stack-trace/2713) + Check for `npm.config`'s existence in `error-handler.js` to prevent weird + errors when failures happen before config object is loaded. + ([@BeniCheni](https://github.com/BeniCheni)) +* [`134207174`](https://github.com/npm/cli/commit/134207174652e1eb6d7b0f44fd9858a0b6a0cd6c) + [npm.community#2569](https://npm.community/t/2569) + Fix checking for optional dependencies. + ([@larsgw](https://github.com/larsgw)) +* [`7a2f6b05d`](https://github.com/npm/cli/commit/7a2f6b05d27f3bcf47a48230db62e86afa41c9d3) + [npm.community#4172](https://npm.community/t/4172) + Remove tink experiments. + ([@larsgw](https://github.com/larsgw)) +* [`c5b6056b6`](https://github.com/npm/cli/commit/c5b6056b6b35eefb81ae5fb00a5c7681c5318c22) + [#123](https://github.com/npm/cli/pull/123) + Handle git branch references correctly. + ([@johanneswuerbach](https://github.com/johanneswuerbach)) +* [`f58b43ef2`](https://github.com/npm/cli/commit/f58b43ef2c5e3dea2094340a0cf264b2d11a5da4) + [npm.community#3983](https://npm.community/t/npm-audit-error-messaging-update-for-401s/3983) + Report any errors above 400 as potentially not supporting audit. + ([@zkat](https://github.com/zkat)) +* [`a5c9e6f35`](https://github.com/npm/cli/commit/a5c9e6f35a591a6e2d4b6ace5c01bc03f2b75fdc) + [#124](https://github.com/npm/cli/pull/124) + Set default homepage to an empty string. + ([@anchnk](https://github.com/anchnk)) +* [`5d076351d`](https://github.com/npm/cli/commit/5d076351d7ec1d3585942a9289548166a7fbbd4c) + [npm.community#4054](https://npm.community/t/4054) + Fix npm-prefix description. + ([@larsgw](https://github.com/larsgw)) + +### DOCS + +* [`31a7274b7`](https://github.com/npm/cli/commit/31a7274b70de18b24e7bee51daa22cc7cbb6141c) + [#71](https://github.com/npm/cli/pull/71) + Fix typo in npm-token documentation. + ([@GeorgeTaveras1231](https://github.com/GeorgeTaveras1231)) +* [`2401b7592`](https://github.com/npm/cli/commit/2401b7592c6ee114e6db7077ebf8c072b7bfe427) + Correct docs for fake-registry interface. + ([@iarna](https://github.com/iarna)) + +### DEPENDENCIES + +* [`9cefcdc1d`](https://github.com/npm/cli/commit/9cefcdc1d2289b56f9164d14d7e499e115cfeaee) + `npm-registry-fetch@3.8.0` + ([@zkat](https://github.com/zkat)) +* [`1c769c9b3`](https://github.com/npm/cli/commit/1c769c9b3e431d324c1a5b6dd10e1fddb5cb88c7) + `pacote@9.1.0` + ([@zkat](https://github.com/zkat)) +* [`f3bc5539b`](https://github.com/npm/cli/commit/f3bc5539b30446500abcc3873781b2c717f8e22c) + `figgy-pudding@3.5.1` + ([@zkat](https://github.com/zkat)) +* [`bf7199d3c`](https://github.com/npm/cli/commit/bf7199d3cbf50545da1ebd30d28f0a6ed5444a00) + `npm-profile@4.0.1` + ([@zkat](https://github.com/zkat)) +* [`118c50496`](https://github.com/npm/cli/commit/118c50496c01231cab3821ae623be6df89cb0a32) + `semver@5.5.1` + ([@isaacs](https://github.com/isaacs)) +* [`eab4df925`](https://github.com/npm/cli/commit/eab4df9250e9169c694b3f6c287d2932bf5e08fb) + `libcipm@3.0.2` + ([@zkat](https://github.com/zkat)) +* [`b86e51573`](https://github.com/npm/cli/commit/b86e515734faf433dc6c457c36c1de52795aa870) + `libnpm@1.4.0` + ([@zkat](https://github.com/zkat)) +* [`56fffbff2`](https://github.com/npm/cli/commit/56fffbff27fe2fae8bef27d946755789ef0d89bd) + `get-stream@4.1.0` + ([@zkat](https://github.com/zkat)) +* [`df972e948`](https://github.com/npm/cli/commit/df972e94868050b5aa42ac18b527fd929e1de9e4) + npm-profile@REMOVED + ([@zkat](https://github.com/zkat)) +* [`32c73bf0e`](https://github.com/npm/cli/commit/32c73bf0e3f0441d0c7c940292235d4b93aa87e2) + `libnpm@2.0.1` + ([@zkat](https://github.com/zkat)) +* [`569491b80`](https://github.com/npm/cli/commit/569491b8042f939dc13986b6adb2a0a260f95b63) + `licensee@5.0.0` + ([@zkat](https://github.com/zkat)) +* [`a3ba0ccf1`](https://github.com/npm/cli/commit/a3ba0ccf1fa86aec56b1ad49883abf28c1f56b3c) + move rimraf to prod deps + ([@zkat](https://github.com/zkat)) +* [`f63a0d6cf`](https://github.com/npm/cli/commit/f63a0d6cf0b7db3dcc80e72e1383c3df723c8119) + `spdx-license-ids@3.0.3`: + Ref: https://github.com/npm/cli/pull/121 + ([@zkat](https://github.com/zkat)) +* [`f350e714f`](https://github.com/npm/cli/commit/f350e714f66a77f71a7ebe17daeea2ea98179a1a) + `aproba@2.0.0` + ([@aeschright](https://github.com/aeschright)) +* [`a67e4d8b2`](https://github.com/npm/cli/commit/a67e4d8b214e58ede037c3854961acb33fd889da) + `byte-size@5.0.1` + ([@aeschright](https://github.com/aeschright)) +* [`8bea4efa3`](https://github.com/npm/cli/commit/8bea4efa34857c4e547904b3630dd442def241de) + `cacache@11.3.2` + ([@aeschright](https://github.com/aeschright)) +* [`9d4776836`](https://github.com/npm/cli/commit/9d4776836a4eaa4b19701b4e4f00cd64578bf078) + `chownr@1.1.1` + ([@aeschright](https://github.com/aeschright)) +* [`70da139e9`](https://github.com/npm/cli/commit/70da139e97ed1660c216e2d9b3f9cfb986bfd4a4) + `ci-info@2.0.0` + ([@aeschright](https://github.com/aeschright)) +* [`bcdeddcc3`](https://github.com/npm/cli/commit/bcdeddcc3d4dc242f42404223dafe4afdc753b32) + `cli-table3@0.5.1` + ([@aeschright](https://github.com/aeschright)) +* [`63aab82c7`](https://github.com/npm/cli/commit/63aab82c7bfca4f16987cf4156ddebf8d150747c) + `is-cidr@3.0.0` + ([@aeschright](https://github.com/aeschright)) +* [`d522bd90c`](https://github.com/npm/cli/commit/d522bd90c3b0cb08518f249ae5b90bd609fff165) + `JSONStream@1.3.5` + ([@aeschright](https://github.com/aeschright)) +* [`2a59bfc79`](https://github.com/npm/cli/commit/2a59bfc7989bd5575d8cbba912977c6d1ba92567) + `libnpmhook@5.0.2` + ([@aeschright](https://github.com/aeschright)) +* [`66d60e394`](https://github.com/npm/cli/commit/66d60e394e5a96330f90e230505758f19a3643ac) + `marked@0.6.0` + ([@aeschright](https://github.com/aeschright)) +* [`8213def9a`](https://github.com/npm/cli/commit/8213def9aa9b6e702887e4f2ed7654943e1e4154) + `npm-packlist@1.2.0` + ([@aeschright](https://github.com/aeschright)) +* [`e4ffc6a2b`](https://github.com/npm/cli/commit/e4ffc6a2bfb8d0b7047cb6692030484760fc8c91) + `unique-filename@1.1.1` + ([@aeschright](https://github.com/aeschright)) +* [`09a5c2fab`](https://github.com/npm/cli/commit/09a5c2fabe0d1c00ec8c99f328f6d28a3495eb0b) + `semver@5.6.0` + ([@aeschright](https://github.com/aeschright)) +* [`740e79e17`](https://github.com/npm/cli/commit/740e79e17a78247f73349525043c9388ce94459a) + `rimraf@2.6.3` + ([@aeschright](https://github.com/aeschright)) +* [`455476c8d`](https://github.com/npm/cli/commit/455476c8d148ca83a4e030e96e93dcf1c7f0ff5f) + `require-inject@1.4.4` + ([@aeschright](https://github.com/aeschright)) +* [`3f40251c5`](https://github.com/npm/cli/commit/3f40251c5868feaacbcdbcb1360877ce76998f5e) + `npm-pick-manifest@2.2.3` + ([@aeschright](https://github.com/aeschright)) +* [`4ffa8a8e9`](https://github.com/npm/cli/commit/4ffa8a8e9e80e5562898dd76fe5a49f5694f38c8) + `query-string@6.2.0` + ([@aeschright](https://github.com/aeschright)) +* [`a0a0ca9ec`](https://github.com/npm/cli/commit/a0a0ca9ec2a962183d420fa751f4139969760f18) + `pacote@9.3.0` + ([@aeschright](https://github.com/aeschright)) +* [`5777ea8ad`](https://github.com/npm/cli/commit/5777ea8ad2058be3166a6dad2d31d2d393c9f778) + `readable-stream@3.1.1` + ([@aeschright](https://github.com/aeschright)) +* [`887e94386`](https://github.com/npm/cli/commit/887e94386f42cb59a5628e7762b3662d084b23c8) + `lru-cache@4.1.5` + ([@aeschright](https://github.com/aeschright)) +* [`41f15524c`](https://github.com/npm/cli/commit/41f15524c58c59d206c4b1d25ae9e0f22745213b) + Updating semver docs. + ([@aeschright](https://github.com/aeschright)) +* [`fb3bbb72d`](https://github.com/npm/cli/commit/fb3bbb72d448ac37a465b31233b21381917422f3) + `npm-audit-report@1.3.2`: + ([@melkikh](https://github.com/melkikh)) + +### TESTING + +* [`f1edffba9`](https://github.com/npm/cli/commit/f1edffba90ebd96cf88675d2e18ebc48954ba50e) + Modernize maketest script. + ([@iarna](https://github.com/iarna)) +* [`ae263473d`](https://github.com/npm/cli/commit/ae263473d92a896b482830d4019a04b5dbd1e9d7) + maketest: Use promise based example common.npm call. + ([@iarna](https://github.com/iarna)) +* [`d9970da5e`](https://github.com/npm/cli/commit/d9970da5ee97a354eab01cbf16f9101693a15d2d) + maketest: Use newEnv for env production. + ([@iarna](https://github.com/iarna)) + +### MISCELLANEOUS + +* [`c665f35aa`](https://github.com/npm/cli/commit/c665f35aacdb8afdbe35f3dd7ccb62f55ff6b896) + [#119](https://github.com/npm/cli/pull/119) + Replace var with const/let in lib/repo.js. + ([@watilde](https://github.com/watilde)) +* [`46639ba9f`](https://github.com/npm/cli/commit/46639ba9f04ea729502f1af28b02eb67fb6dcb66) + Update package-lock.json for https tarball URLs + ([@aeschright](https://github.com/aeschright)) + ## v6.5.0 (2018-11-28): ### NEW FEATURES @@ -13,7 +318,7 @@ ### BUGFIXES * [`89652cb9b`](https://github.com/npm/cli/commit/89652cb9b810f929f5586fc90cc6794d076603fb) - [npm.community#1661](https://npm.community/t/https://npm.community/t/1661) + [npm.community#1661](https://npm.community/t/1661) Fix sign-git-commit options. They were previously totally wrong. ([@zkat](https://github.com/zkat)) * [`414f2d1a1`](https://github.com/npm/cli/commit/414f2d1a1bdffc02ed31ebb48a43216f284c21d4) @@ -167,7 +472,7 @@ circular dependency fix, as well as adding a proper LICENSE file. ([@isaacs](https://github.com/isaacs)) * [`e8d5f4418`](https://github.com/npm/cli/commit/e8d5f441821553a31fc8cd751670663699d2c8ce) - [npm.community#632](https://npm.community/t/https://npm.community/t/using-npm-ci-does-not-run-prepare-script-for-git-modules/632) + [npm.community#632](https://npm.community/t/using-npm-ci-does-not-run-prepare-script-for-git-modules/632) `libcipm@2.0.2`: Fixes issue where `npm ci` wasn't running the `prepare` lifecycle script when installing git dependencies diff --git a/deps/npm/doc/cli/npm-access.md b/deps/npm/doc/cli/npm-access.md index bbccfc70937c7f..aeea0178ec66d7 100644 --- a/deps/npm/doc/cli/npm-access.md +++ b/deps/npm/doc/cli/npm-access.md @@ -9,6 +9,9 @@ npm-access(1) -- Set access level on published packages npm access grant [] npm access revoke [] + npm access 2fa-required [] + npm access 2fa-not-required [] + npm access ls-packages [||] npm access ls-collaborators [ []] npm access edit [] @@ -28,6 +31,10 @@ subcommand. Add or remove the ability of users and teams to have read-only or read-write access to a package. +* 2fa-required / 2fa-not-required: + Configure whether a package requires that anyone publishing it have two-factor + authentication enabled on their account. + * ls-packages: Show all of the packages a user or a team is able to access, along with the access level, except for read-only public packages (it won't print the whole @@ -70,6 +77,7 @@ Management of teams and team memberships is done with the `npm team` command. ## SEE ALSO +* [`libnpmaccess`](https://npm.im/libnpmaccess) * npm-team(1) * npm-publish(1) * npm-config(7) diff --git a/deps/npm/doc/cli/npm-dist-tag.md b/deps/npm/doc/cli/npm-dist-tag.md index 1a69d1b6ce42b2..7de3c828fb215b 100644 --- a/deps/npm/doc/cli/npm-dist-tag.md +++ b/deps/npm/doc/cli/npm-dist-tag.md @@ -26,6 +26,8 @@ Add, remove, and enumerate distribution tags on a package: Show all of the dist-tags for a package, defaulting to the package in the current prefix. + This is the default action if none is specified. + A tag can be used when installing packages as a reference to a version instead of using a specific version number: diff --git a/deps/npm/doc/cli/npm-org.md b/deps/npm/doc/cli/npm-org.md new file mode 100644 index 00000000000000..802df4df57da74 --- /dev/null +++ b/deps/npm/doc/cli/npm-org.md @@ -0,0 +1,50 @@ +npm-org(1) -- Manage orgs +=================================== + +## SYNOPSIS + + npm org set [developer | admin | owner] + npm org rm + npm org ls [] + +## EXAMPLE + +Add a new developer to an org: +``` +$ npm org set my-org @mx-smith +``` + +Add a new admin to an org (or change a developer to an admin): +``` +$ npm org set my-org @mx-santos admin +``` + +Remove a user from an org: +``` +$ npm org rm my-org mx-santos +``` + +List all users in an org: +``` +$ npm org ls my-org +``` + +List all users in JSON format: +``` +$ npm org ls my-org --json +``` + +See what role a user has in an org: +``` +$ npm org ls my-org @mx-santos +``` + +## DESCRIPTION + +You can use the `npm org` commands to manage and view users of an organization. +It supports adding and removing users, changing their roles, listing them, and +finding specific ones and their roles. + +## SEE ALSO + +* [Documentation on npm Orgs](https://docs.npmjs.com/orgs/) diff --git a/deps/npm/doc/cli/npm-prefix.md b/deps/npm/doc/cli/npm-prefix.md index f262a36a752b52..d36e538132fb26 100644 --- a/deps/npm/doc/cli/npm-prefix.md +++ b/deps/npm/doc/cli/npm-prefix.md @@ -8,7 +8,8 @@ npm-prefix(1) -- Display prefix ## DESCRIPTION Print the local prefix to standard out. This is the closest parent directory -to contain a package.json file unless `-g` is also specified. +to contain a `package.json` file or `node_modules` directory, unless `-g` is +also specified. If `-g` is specified, this will be the value of the global prefix. See `npm-config(7)` for more detail. diff --git a/deps/npm/doc/cli/npm-token.md b/deps/npm/doc/cli/npm-token.md index 82ab158af67eb4..29dac392db4762 100644 --- a/deps/npm/doc/cli/npm-token.md +++ b/deps/npm/doc/cli/npm-token.md @@ -9,7 +9,7 @@ npm-token(1) -- Manage your authentication tokens ## DESCRIPTION -This list you list, create and revoke authentication tokens. +This lets you list, create and revoke authentication tokens. * `npm token list`: Shows a table of all active authentication tokens. You can request this as diff --git a/deps/npm/doc/misc/npm-index.md b/deps/npm/doc/misc/npm-index.md index efbf2784ff0934..e6f9d1e49ce6f8 100644 --- a/deps/npm/doc/misc/npm-index.md +++ b/deps/npm/doc/misc/npm-index.md @@ -125,6 +125,10 @@ Log out of the registry List installed packages +### npm-org(1) + +Manage orgs + ### npm-outdated(1) Check for outdated packages diff --git a/deps/npm/doc/misc/semver.md b/deps/npm/doc/misc/semver.md index 1c2dbf55b8d2f8..2c856d80094273 100644 --- a/deps/npm/doc/misc/semver.md +++ b/deps/npm/doc/misc/semver.md @@ -29,8 +29,6 @@ As a command-line utility: ``` $ semver -h -SemVer 5.3.0 - A JavaScript implementation of the http://semver.org/ specification Copyright Isaac Z. Schlueter @@ -54,6 +52,9 @@ Options: -l --loose Interpret versions and ranges loosely +-p --include-prerelease + Always include prerelease versions in range matching + -c --coerce Coerce a string into SemVer if possible (does not imply --loose) @@ -289,9 +290,19 @@ part ::= nr | [-0-9A-Za-z]+ ## Functions -All methods and classes take a final `loose` boolean argument that, if -true, will be more forgiving about not-quite-valid semver strings. -The resulting output will always be 100% strict, of course. +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. Strict-mode Comparators and Ranges will be strict about the SemVer strings that they parse. diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index ef0371af41e2d2..a69fa3d7e455ee 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -34,7 +34,7 @@

Other Sorts of Unices

Run make install. npm will be installed with node.

If you want a more fancy pants install (a different version, customized paths, etc.) then read on.

-

Fancy Install (Unix)

+

Fancy Install (Unix)

There's a pretty robust install script at https://www.npmjs.com/install.sh. You can download that and run it.

Here's an example using curl:

@@ -118,5 +118,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html index c010b55a792ead..0904466dd0aa42 100644 --- a/deps/npm/html/doc/cli/npm-access.html +++ b/deps/npm/html/doc/cli/npm-access.html @@ -17,6 +17,9 @@

SYNOPSIS

npm access grant <read-only|read-write> <scope:team> [<package>] npm access revoke <scope:team> [<package>] +npm access 2fa-required [<package>] +npm access 2fa-not-required [<package>] + npm access ls-packages [<user>|<scope>|<scope:team>] npm access ls-collaborators [<package> [<user>]] npm access edit [<package>]

DESCRIPTION

@@ -32,6 +35,10 @@

SYNOPSIS

Add or remove the ability of users and teams to have read-only or read-write access to a package.

+
  • 2fa-required / 2fa-not-required: +Configure whether a package requires that anyone publishing it have two-factor +authentication enabled on their account.

    +
  • ls-packages: Show all of the packages a user or a team is able to access, along with the access level, except for read-only public packages (it won't print the whole @@ -68,6 +75,7 @@

    DETAILS

    Management of teams and team memberships is done with the npm team command.

    SEE ALSO

      +
    • libnpmaccess
    • npm-team(1)
    • npm-publish(1)
    • npm-config(7)
    • @@ -85,5 +93,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index 83551e1d3fbb5e..abea1da85b3432 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -78,5 +78,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-audit.html b/deps/npm/html/doc/cli/npm-audit.html index d26741639ff89b..311c2a68999a12 100644 --- a/deps/npm/html/doc/cli/npm-audit.html +++ b/deps/npm/html/doc/cli/npm-audit.html @@ -81,4 +81,4 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index 8c2abb22bd1ba7..ff2ffde7657879 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -34,5 +34,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index 888791270b5f18..afcdffcfbd5fa2 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -54,5 +54,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index 811f88fc3b8900..158edbc4e6bd2a 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -38,5 +38,5 @@

      DESCRIPTION

             - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index 4bc6fd05877000..53420b0d342f9c 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 b7b35a1733d13f..0193feabd776ac 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -52,7 +52,7 @@

      DETAILS

      directly.

      npm will not remove data by itself: the cache will grow as new packages are installed.

      -

      A NOTE ABOUT THE CACHE'S DESIGN

      +

      A NOTE ABOUT THE CACHE'S DESIGN

      The npm cache is strictly a cache: it should not be relied upon as a persistent and reliable data store for package data. npm makes no guarantee that a previously-cached piece of data will be available later, and will automatically @@ -88,5 +88,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-ci.html b/deps/npm/html/doc/cli/npm-ci.html index 6cff554cc7b8da..54601d1dc3ec97 100644 --- a/deps/npm/html/doc/cli/npm-ci.html +++ b/deps/npm/html/doc/cli/npm-ci.html @@ -58,4 +58,4 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index 786d31453fd77b..48adf8cd804e84 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -42,5 +42,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index 908a545e8d27ca..834ef101880249 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -62,5 +62,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index aa6e4745156e33..dc1c97d396f2e3 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -58,5 +58,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index 7fa5f9dcf85e45..590e70f845b4df 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -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 6806e2280f7f49..3bce07aede0728 100644 --- a/deps/npm/html/doc/cli/npm-dist-tag.html +++ b/deps/npm/html/doc/cli/npm-dist-tag.html @@ -30,6 +30,7 @@

      SYNOPSIS

    • ls: Show all of the dist-tags for a package, defaulting to the package in the current prefix.

      +

      This is the default action if none is specified.

    A tag can be used when installing packages as a reference to a version instead @@ -85,5 +86,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index a18f1e260eb726..993850bba96226 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -55,5 +55,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-doctor.html b/deps/npm/html/doc/cli/npm-doctor.html index 7a2912200957ce..567b320b186ea6 100644 --- a/deps/npm/html/doc/cli/npm-doctor.html +++ b/deps/npm/html/doc/cli/npm-doctor.html @@ -41,7 +41,7 @@

    npm ping

    what that is by running npm config get registry), and if you're using a private registry that doesn't support the /whoami endpoint supported by the primary registry, this check may fail.

    -

    npm -v

    +

    npm -v

    While Node.js may come bundled with a particular version of npm, it's the policy of the CLI team that we recommend all users run npm@latest if they can. As the CLI is maintained by a small team of contributors, there are only @@ -49,7 +49,7 @@

    npm -v

    releases typically only receive critical security and regression fixes. The team believes that the latest tested version of npm is almost always likely to be the most functional and defect-free version of npm.

    -

    node -v

    +

    node -v

    For most users, in most circumstances, the best version of Node will be the latest long-term support (LTS) release. Those of you who want access to new ECMAscript features or bleeding-edge changes to Node's standard library may be @@ -102,4 +102,4 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index 713b7aa7afd235..081f607ec59fb8 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -50,5 +50,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index ea269f2a90e0e6..79f53334ef2044 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -47,5 +47,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 712c6230c6f2b0..800e233ff46ab1 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -44,5 +44,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index 90f317de59630d..7d5a9734e8ef69 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -49,5 +49,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-hook.html b/deps/npm/html/doc/cli/npm-hook.html index 239cf1ddeddbf1..62a333cb7aede4 100644 --- a/deps/npm/html/doc/cli/npm-hook.html +++ b/deps/npm/html/doc/cli/npm-hook.html @@ -52,4 +52,4 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index 507b9b9708cc30..073263cbe216b4 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -61,5 +61,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-install-ci-test.html b/deps/npm/html/doc/cli/npm-install-ci-test.html index 9bcbfc42b1ea83..831bc4e21e11cd 100644 --- a/deps/npm/html/doc/cli/npm-install-ci-test.html +++ b/deps/npm/html/doc/cli/npm-install-ci-test.html @@ -32,4 +32,4 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-install-test.html b/deps/npm/html/doc/cli/npm-install-test.html index 8bd0f55a07f8af..7ed9fee6dc59b3 100644 --- a/deps/npm/html/doc/cli/npm-install-test.html +++ b/deps/npm/html/doc/cli/npm-install-test.html @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index ca2f485a57352c..973e0de79d96c5 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -322,7 +322,7 @@

    ALGORITHM

    order.

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

    -

    Limitations of npm's Install Algorithm

    +

    Limitations of npm's Install Algorithm

    npm will refuse to install any package with an identical name to the current package. This can be overridden with the --force flag, but in most cases can simply be addressed by changing the local package name.

    @@ -370,5 +370,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index ccf3cb175e7faf..da9a12bd7f0365 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -71,5 +71,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html index 82d6e7d89c0db5..011f638aff592a 100644 --- a/deps/npm/html/doc/cli/npm-logout.html +++ b/deps/npm/html/doc/cli/npm-logout.html @@ -49,5 +49,5 @@

    scope

           - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index a66f15bb5175f6..bbdd3aea8d8468 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -20,7 +20,7 @@

    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@6.5.0 /path/to/npm
    +
    npm@6.7.0 /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 @@ -60,13 +60,13 @@

    depth

  • Type: Int
  • Max display depth of the dependency tree.

    -

    prod / production

    +

    prod / production

    • Type: Boolean
    • Default: false

    Display only the dependency tree for packages in dependencies.

    -

    dev / development

    +

    dev / development

    • Type: Boolean
    • Default: false
    • @@ -108,5 +108,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-org.html b/deps/npm/html/doc/cli/npm-org.html new file mode 100644 index 00000000000000..2132e290adefc3 --- /dev/null +++ b/deps/npm/html/doc/cli/npm-org.html @@ -0,0 +1,43 @@ + + + npm-org + + + + + + +
      + +

      npm-org

      Manage orgs

      +

      SYNOPSIS

      +
      npm org set <orgname> <username> [developer | admin | owner]
      +npm org rm <orgname> <username>
      +npm org ls <orgname> [<username>]

      EXAMPLE

      +

      Add a new developer to an org:

      +
      $ npm org set my-org @mx-smith

      Add a new admin to an org (or change a developer to an admin):

      +
      $ npm org set my-org @mx-santos admin

      Remove a user from an org:

      +
      $ npm org rm my-org mx-santos

      List all users in an org:

      +
      $ npm org ls my-org

      List all users in JSON format:

      +
      $ npm org ls my-org --json

      See what role a user has in an org:

      +
      $ npm org ls my-org @mx-santos

      DESCRIPTION

      +

      You can use the npm org commands to manage and view users of an organization. +It supports adding and removing users, changing their roles, listing them, and +finding specific ones and their roles.

      +

      SEE ALSO

      + + +
      + + + + + + + + + + + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index 560afe03379ce0..b39aaeac54de2f 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -116,5 +116,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index 07500f648bf8de..42a1f852edfff8 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -53,5 +53,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index 312d856657f5ed..c6494d46c0c7a8 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -42,5 +42,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html index 70d992572facdd..e320419a0ef4f1 100644 --- a/deps/npm/html/doc/cli/npm-ping.html +++ b/deps/npm/html/doc/cli/npm-ping.html @@ -33,5 +33,5 @@

      SYNOPSIS

             - + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index 1dcd48214280d7..af9969c0746d17 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -13,7 +13,8 @@

      npm-prefix

      Display prefix

      SYNOPSIS

      npm prefix [-g]

      DESCRIPTION

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

      +to contain a package.json file or node_modules directory, unless -g is +also specified.

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

      SEE ALSO

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

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-profile.html b/deps/npm/html/doc/cli/npm-profile.html index 2d2c030ae7702b..e9e81d60f1b373 100644 --- a/deps/npm/html/doc/cli/npm-profile.html +++ b/deps/npm/html/doc/cli/npm-profile.html @@ -88,4 +88,4 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index f9a791e28e6d8a..aa4a4a9233fae0 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -47,5 +47,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index 7de9cf6cbacaa5..622389b2e1763e 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -87,5 +87,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index c201f50e16a2fb..793bbad2487420 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -34,5 +34,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index fa2f1e04a06bbb..a62eccf9c0a192 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -40,5 +40,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index f095d31c4298ba..14c430e012f049 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -52,5 +52,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index 583d7394b42465..13ec0912a8d125 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -34,5 +34,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 5ecad32712a66b..862a9fb324fd45 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -79,5 +79,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index 8a346ced27133c..6818a07dd9df03 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -32,7 +32,7 @@

      SYNOPSIS

      quoted in most shells.)

      A Note on caching

      CONFIGURATION

      -

      description

      +

      description

      • Default: true
      • Type: Boolean
      • @@ -108,5 +108,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index f4706141d5caab..2b07d44400901e 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -40,5 +40,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index a8786726c8dd31..282fe6058e9aa8 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -35,5 +35,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index 61e9564eea5c3d..48bbc461a81d6b 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -35,5 +35,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index 23ee465c885454..063eed365633ae 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -38,5 +38,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index ad5dc240459114..989210046d0d38 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -33,5 +33,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html index 26706b7fcc9d37..5368ed6ed41df0 100644 --- a/deps/npm/html/doc/cli/npm-team.html +++ b/deps/npm/html/doc/cli/npm-team.html @@ -69,5 +69,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index 37a699f381f14c..0c5839262983e9 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -35,5 +35,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-token.html b/deps/npm/html/doc/cli/npm-token.html index eba3d9e90b1b11..33d11852c8a4a9 100644 --- a/deps/npm/html/doc/cli/npm-token.html +++ b/deps/npm/html/doc/cli/npm-token.html @@ -14,28 +14,39 @@

        SYNOPSIS

        npm token list [--json|--parseable]
         npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16]
         npm token revoke <id|token>

        DESCRIPTION

        -

        This list you list, create and revoke authentication tokens.

        +

        This lets you list, create and revoke authentication tokens.

        • npm token list: Shows a table of all active authentication tokens. You can request this as -JSON with --json or tab-separated values with --parseable.

          -
          +--------+---------+------------+----------+----------------+
          -| id     | token   | created    | read-only | CIDR whitelist |
          -+--------+---------+------------+----------+----------------+
          -| 7f3134 | 1fa9ba… | 2017-10-02 | yes      |                |
          -+--------+---------+------------+----------+----------------+
          -| c03241 | af7aef… | 2017-10-02 | no       | 192.168.0.1/24 |
          -+--------+---------+------------+----------+----------------+
          -| e0cf92 | 3a436a… | 2017-10-02 | no       |                |
          -+--------+---------+------------+----------+----------------+
          -| 63eb9d | 74ef35… | 2017-09-28 | no       |                |
          -+--------+---------+------------+----------+----------------+
          -| 2daaa8 | cbad5f… | 2017-09-26 | no       |                |
          -+--------+---------+------------+----------+----------------+
          -| 68c2fe | 127e51… | 2017-09-23 | no       |                |
          -+--------+---------+------------+----------+----------------+
          -| 6334e1 | 1dadd1… | 2017-09-23 | no       |                |
          -+--------+---------+------------+----------+----------------+
        • +JSON with --json or tab-separated values with --parseable. +```

          + +
        • --------+---------+------------+----------+----------------+ +| id | token | created | read-only | CIDR whitelist |

          +
        • +
        • --------+---------+------------+----------+----------------+ +| 7f3134 | 1fa9ba… | 2017-10-02 | yes | |

          +
        • +
        • --------+---------+------------+----------+----------------+ +| c03241 | af7aef… | 2017-10-02 | no | 192.168.0.1/24 |

          +
        • +
        • --------+---------+------------+----------+----------------+ +| e0cf92 | 3a436a… | 2017-10-02 | no | |

          +
        • +
        • --------+---------+------------+----------+----------------+ +| 63eb9d | 74ef35… | 2017-09-28 | no | |

          +
        • +
        • --------+---------+------------+----------+----------------+ +| 2daaa8 | cbad5f… | 2017-09-26 | no | |

          +
        • +
        • --------+---------+------------+----------+----------------+ +| 68c2fe | 127e51… | 2017-09-23 | no | |

          +
        • +
        • --------+---------+------------+----------+----------------+ +| 6334e1 | 1dadd1… | 2017-09-23 | no | |

          +
        • +
        • --------+---------+------------+----------+----------------+

          +
        • npm token create [--read-only] [--cidr=<cidr-ranges>]: Create a new authentication token. It can be --read-only or accept a list of CIDR ranges to @@ -70,4 +81,4 @@

          SYNOPSIS

                 - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index 5a9c1e201f51ee..f477d9f287e740 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -60,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 724f0fdbd597a6..61b565bb2fe659 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -52,5 +52,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html index 544de28ed825c0..f03acc1b436186 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -62,7 +62,7 @@

          Tilde Dependencies

          tag points to 1.2.2, this version does not satisfy ~1.1.1, which is equivalent to >=1.1.1 <1.2.0. So the highest-sorting version that satisfies ~1.1.1 is used, which is 1.1.2.

          -

          Caret Dependencies below 1.0.0

          +

          Caret Dependencies below 1.0.0

          Suppose app has a caret dependency on a version below 1.0.0, for example:

          "dependencies": {
             "dep1": "^0.2.0"
          @@ -100,5 +100,5 @@ 

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index 90d3d14c6e39b3..31bf550d7baee8 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -116,5 +116,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index 34edabba5ac40a..9ec17116957985 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -75,5 +75,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index b6838b1b7a627d..df62dacb1a4c51 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -32,5 +32,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html index 6f4eacb9b3b623..6864d44a472a76 100644 --- a/deps/npm/html/doc/cli/npm.html +++ b/deps/npm/html/doc/cli/npm.html @@ -12,7 +12,7 @@

          npm

          javascript package manager

          SYNOPSIS

          npm <command> [args]

          VERSION

          -

          6.5.0

          +

          6.7.0

          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 @@ -130,7 +130,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 70e06061e914c2..5ad8e306134f0e 100644 --- a/deps/npm/html/doc/files/npm-folders.html +++ b/deps/npm/html/doc/files/npm-folders.html @@ -13,7 +13,7 @@

            npm-folders

            Folder Structure

            DESCRIPTION

            npm puts various things on your computer. That's its job.

            This document will tell you what it puts where.

            -

            tl;dr

            +

            tl;dr

            • Local install (default): puts stuff in ./node_modules of the current package root.
            • @@ -179,5 +179,5 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html index 70e06061e914c2..5ad8e306134f0e 100644 --- a/deps/npm/html/doc/files/npm-global.html +++ b/deps/npm/html/doc/files/npm-global.html @@ -13,7 +13,7 @@

              npm-folders

              Folder Structure

              DESCRIPTION

              npm puts various things on your computer. That's its job.

              This document will tell you what it puts where.

              -

              tl;dr

              +

              tl;dr

              • Local install (default): puts stuff in ./node_modules of the current package root.
              • @@ -179,5 +179,5 @@

                SEE ALSO

                       - + diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html index bff086cf76420d..751bbebde906d6 100644 --- a/deps/npm/html/doc/files/npm-json.html +++ b/deps/npm/html/doc/files/npm-json.html @@ -54,7 +54,7 @@

                version

                node-semver, which is bundled with npm as a dependency. (npm install semver to use it yourself.)

                More on version numbers and ranges at semver(7).

                -

                description

                +

                description

                Put a description in it. It's a string. This helps people discover your package, as it's listed in npm search.

                keywords

                @@ -230,25 +230,25 @@

                directories

                object. If you look at npm's package.json, you'll see that it has directories for doc, lib, and man.

                In the future, this information may be used in other creative ways.

                -

                directories.lib

                +

                directories.lib

                Tell people where the bulk of your library is. Nothing special is done with the lib folder in any way, but it's useful meta info.

                -

                directories.bin

                +

                directories.bin

                If you specify a bin directory in directories.bin, all the files in that folder will be added.

                Because of the way the bin directive works, specifying both a bin path and setting directories.bin is an error. If you want to specify individual files, use bin, and for all the files in an existing bin directory, use directories.bin.

                -

                directories.man

                +

                directories.man

                A folder that is full of man pages. Sugar to generate a "man" array by walking the folder.

                -

                directories.doc

                +

                directories.doc

                Put markdown files in here. Eventually, these will be displayed nicely, maybe, someday.

                -

                directories.example

                +

                directories.example

                Put example scripts in here. Someday, it might be exposed in some clever way.

                -

                directories.test

                +

                directories.test

                Put your tests in here. It is currently not exposed, but it might be in the future.

                repository

                @@ -574,5 +574,5 @@

                SEE ALSO

                       - + diff --git a/deps/npm/html/doc/files/npm-package-locks.html b/deps/npm/html/doc/files/npm-package-locks.html index 7e0f6e31d19bdb..6e273ed342d717 100644 --- a/deps/npm/html/doc/files/npm-package-locks.html +++ b/deps/npm/html/doc/files/npm-package-locks.html @@ -154,4 +154,4 @@

                SEE ALSO

                       - + diff --git a/deps/npm/html/doc/files/npm-shrinkwrap.json.html b/deps/npm/html/doc/files/npm-shrinkwrap.json.html index 0399e5a1252721..70316f153aa794 100644 --- a/deps/npm/html/doc/files/npm-shrinkwrap.json.html +++ b/deps/npm/html/doc/files/npm-shrinkwrap.json.html @@ -42,4 +42,4 @@

                SEE ALSO

                       - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index a02b8ace99e16c..9b34b7a13270c5 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -82,5 +82,5 @@

                SEE ALSO

                       - + diff --git a/deps/npm/html/doc/files/package-lock.json.html b/deps/npm/html/doc/files/package-lock.json.html index 0426de30cfb5ef..1d6399445e7c39 100644 --- a/deps/npm/html/doc/files/package-lock.json.html +++ b/deps/npm/html/doc/files/package-lock.json.html @@ -57,7 +57,7 @@

                dependencies

                A mapping of package name to dependency object. Dependency objects have the following properties:

                -

                version

                +

                version

                This is a specifier that uniquely identifies this package and should be usable in fetching a new copy of it.

          The commit-ish can be any tag, sha, or branch which can be supplied as an argument to git checkout. The default is master.

          -

          The package.json File

          +

          The package.json File

          You need to have a package.json file in the root of your project to do much of anything with npm. That is basically the whole interface.

          See package.json(5) for details about what goes in that file. At the very @@ -198,5 +198,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index 617838f0cbbd8f..1bc5deee22fed7 100644 --- a/deps/npm/html/doc/misc/npm-disputes.html +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -17,10 +17,10 @@

          npm-disputes

          Handling Module npm Code of Conduct, and nothing in this document should be interpreted to contradict any aspect of the npm Code of Conduct.

          -

          TL;DR

          +

          TL;DR

          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.

          @@ -58,13 +58,13 @@

          DESCRIPTION

        • Alice emails Yusuf, explaining the situation as respectfully as possible, and what she would like to do with the module name. She adds the npm support -staff support@npmjs.com to the CC list of the email. Mention in the email +staff support@npmjs.com to the CC list of the email. Mention in the email that Yusuf can run npm owner add alice foo to add Alice as an owner of the foo package.

        • After a reasonable amount of time, if Yusuf has not responded, or if Yusuf and Alice can't come to any sort of resolution, email support -support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least +support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least 4 weeks.)

        • @@ -101,12 +101,12 @@

          EXCEPTIONS

          Code of Conduct such as hateful language, pornographic content, or harassment. -

          If you see bad behavior like this, please report it to abuse@npmjs.com right +

          If you see bad behavior like this, please report it to abuse@npmjs.com right away. You are never expected to resolve abusive behavior on your own. We are here to help.

          TRADEMARKS

          If you think another npm publisher is infringing your trademark, such as by -using a confusingly similar package name, email abuse@npmjs.com with a link to +using a confusingly similar package name, email abuse@npmjs.com with a link to the package or user account on https://www.npmjs.com/. Attach a copy of your trademark registration certificate.

          If we see that the package's publisher is intentionally misleading others by @@ -139,5 +139,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html index 967162c3f263b4..5044c3044931a7 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -10,163 +10,165 @@

          npm-index

          Index of all npm documentation

          -

          README

          +

          README

          a JavaScript package manager

          Command Line Documentation

          Using npm on the command line

          -

          npm(1)

          +

          npm(1)

          javascript package manager

          -

          npm-access(1)

          +

          npm-access(1)

          Set access level on published packages

          -

          npm-adduser(1)

          +

          npm-adduser(1)

          Add a registry user account

          -

          npm-audit(1)

          +

          npm-audit(1)

          Run a security audit

          -

          npm-bin(1)

          +

          npm-bin(1)

          Display npm bin folder

          -

          npm-bugs(1)

          +

          npm-bugs(1)

          Bugs for a package in a web browser maybe

          -

          npm-build(1)

          +

          npm-build(1)

          Build a package

          -

          npm-bundle(1)

          +

          npm-bundle(1)

          REMOVED

          -

          npm-cache(1)

          +

          npm-cache(1)

          Manipulates packages cache

          -

          npm-ci(1)

          +

          npm-ci(1)

          Install a project with a clean slate

          -

          npm-completion(1)

          +

          npm-completion(1)

          Tab Completion for npm

          -

          npm-config(1)

          +

          npm-config(1)

          Manage the npm configuration files

          -

          npm-dedupe(1)

          +

          npm-dedupe(1)

          Reduce duplication

          -

          npm-deprecate(1)

          +

          npm-deprecate(1)

          Deprecate a version of a package

          -

          npm-dist-tag(1)

          +

          npm-dist-tag(1)

          Modify package distribution tags

          -

          npm-docs(1)

          +

          npm-docs(1)

          Docs for a package in a web browser maybe

          -

          npm-doctor(1)

          +

          npm-doctor(1)

          Check your environments

          -

          npm-edit(1)

          +

          npm-edit(1)

          Edit an installed package

          -

          npm-explore(1)

          +

          npm-explore(1)

          Browse an installed package

          -

          npm-help-search(1)

          +

          npm-help-search(1)

          Search npm help documentation

          -

          npm-help(1)

          +

          npm-help(1)

          Get help on npm

          -

          npm-hook(1)

          +

          npm-hook(1)

          Manage registry hooks

          -

          npm-init(1)

          +

          npm-init(1)

          create a package.json file

          -

          npm-install-ci-test(1)

          +

          npm-install-ci-test(1)

          Install a project with a clean slate and run tests

          -

          npm-install-test(1)

          +

          npm-install-test(1)

          Install package(s) and run tests

          -

          npm-install(1)

          +

          npm-install(1)

          Install a package

          - +

          npm-link(1)

          Symlink a package folder

          -

          npm-logout(1)

          +

          npm-logout(1)

          Log out of the registry

          -

          npm-ls(1)

          +

          npm-ls(1)

          List installed packages

          -

          npm-outdated(1)

          +

          npm-org(1)

          +

          Manage orgs

          +

          npm-outdated(1)

          Check for outdated packages

          -

          npm-owner(1)

          +

          npm-owner(1)

          Manage package owners

          -

          npm-pack(1)

          +

          npm-pack(1)

          Create a tarball from a package

          -

          npm-ping(1)

          +

          npm-ping(1)

          Ping npm registry

          -

          npm-prefix(1)

          +

          npm-prefix(1)

          Display prefix

          -

          npm-profile(1)

          +

          npm-profile(1)

          Change settings on your registry profile

          -

          npm-prune(1)

          +

          npm-prune(1)

          Remove extraneous packages

          -

          npm-publish(1)

          +

          npm-publish(1)

          Publish a package

          -

          npm-rebuild(1)

          +

          npm-rebuild(1)

          Rebuild a package

          -

          npm-repo(1)

          +

          npm-repo(1)

          Open package repository page in the browser

          -

          npm-restart(1)

          +

          npm-restart(1)

          Restart a package

          -

          npm-root(1)

          +

          npm-root(1)

          Display npm root

          -

          npm-run-script(1)

          +

          npm-run-script(1)

          Run arbitrary package scripts

          -

          npm-search(1)

          +

          npm-search(1)

          Search for packages

          -

          npm-shrinkwrap(1)

          +

          npm-shrinkwrap(1)

          Lock down dependency versions for publication

          -

          npm-star(1)

          +

          npm-star(1)

          Mark your favorite packages

          -

          npm-stars(1)

          +

          npm-stars(1)

          View packages marked as favorites

          -

          npm-start(1)

          +

          npm-start(1)

          Start a package

          -

          npm-stop(1)

          +

          npm-stop(1)

          Stop a package

          -

          npm-team(1)

          +

          npm-team(1)

          Manage organization teams and team memberships

          -

          npm-test(1)

          +

          npm-test(1)

          Test a package

          -

          npm-token(1)

          +

          npm-token(1)

          Manage your authentication tokens

          -

          npm-uninstall(1)

          +

          npm-uninstall(1)

          Remove a package

          -

          npm-unpublish(1)

          +

          npm-unpublish(1)

          Remove a package from the registry

          -

          npm-update(1)

          +

          npm-update(1)

          Update a package

          -

          npm-version(1)

          +

          npm-version(1)

          Bump a package version

          -

          npm-view(1)

          +

          npm-view(1)

          View registry info

          -

          npm-whoami(1)

          +

          npm-whoami(1)

          Display npm username

          API Documentation

          Using npm in your Node programs

          Files

          File system structures npm uses

          -

          npm-folders(5)

          +

          npm-folders(5)

          Folder Structures Used by npm

          -

          npm-package-locks(5)

          +

          npm-package-locks(5)

          An explanation of npm lockfiles

          -

          npm-shrinkwrap.json(5)

          +

          npm-shrinkwrap.json(5)

          A publishable lockfile

          -

          npmrc(5)

          +

          npmrc(5)

          The npm config files

          -

          package-lock.json(5)

          +

          package-lock.json(5)

          A manifestation of the manifest

          -

          package.json(5)

          +

          package.json(5)

          Specifics of npm's package.json handling

          Misc

          Various other bits and bobs

          -

          npm-coding-style(7)

          +

          npm-coding-style(7)

          npm's "funny" coding style

          -

          npm-config(7)

          +

          npm-config(7)

          More than you probably want to know about npm configuration

          -

          npm-developers(7)

          +

          npm-developers(7)

          Developer Guide

          -

          npm-disputes(7)

          +

          npm-disputes(7)

          Handling Module Name Disputes

          -

          npm-index(7)

          +

          npm-index(7)

          Index of all npm documentation

          -

          npm-orgs(7)

          +

          npm-orgs(7)

          Working with Teams & Orgs

          -

          npm-registry(7)

          +

          npm-registry(7)

          The JavaScript Package Registry

          -

          npm-scope(7)

          +

          npm-scope(7)

          Scoped packages

          -

          npm-scripts(7)

          +

          npm-scripts(7)

          How npm handles the "scripts" field

          -

          removing-npm(7)

          +

          removing-npm(7)

          Cleaning the Slate

          -

          semver(7)

          +

          semver(7)

          The semantic versioner for npm

          @@ -180,5 +182,5 @@

          semver(7)

                 - + diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html index d8194a94a34e4e..75d23d6beadc8b 100644 --- a/deps/npm/html/doc/misc/npm-orgs.html +++ b/deps/npm/html/doc/misc/npm-orgs.html @@ -77,5 +77,5 @@

          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 16f8b7864c837d..ca2352a7efd8e2 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -31,7 +31,7 @@

          DESCRIPTION

          npm-scope(7)). If no scope is specified, the default registry is used, which is supplied by the registry config parameter. See npm-config(1), npmrc(5), and npm-config(7) for more on managing npm's configuration.

          -

          Does npm send any information about me back to the registry?

          +

          Does npm send any information about me back to the registry?

          Yes.

          When making requests of the registry npm adds two headers with information about your environment:

          @@ -51,7 +51,7 @@

          Does npm s

        The npm registry does not try to correlate the information in these headers with any authenticated accounts that may be used in the same requests.

        -

        Can I run my own private registry?

        +

        Can I run my own private registry?

        Yes!

        The easiest way is to replicate the couch database, and use the same (or similar) design doc to implement the APIs.

        @@ -61,20 +61,20 @@

        Can I run my own private registry?

        If you then want to publish a package for the whole world to see, you can simply override the --registry option for that publish command.

        -

        I don't want my package published in the official registry. It's private.

        +

        I don't want my package published in the official registry. It's private.

        Set "private": true in your package.json to prevent it from being published at all, or "publishConfig":{"registry":"http://my-internal-registry.local"} to force it to be published only to your internal registry.

        See package.json(5) for more info on what goes in the package.json file.

        -

        Will you replicate from my registry into the public one?

        +

        Will you replicate from my registry into the public one?

        No. If you want things to be public, then publish them into the public registry using npm. What little security there is would be for nought otherwise.

        -

        Do I have to use couchdb to build a registry that npm can talk to?

        +

        Do I have to use couchdb to build a registry that npm can talk to?

        No, but it's way easier. Basically, yes, you do, or you have to effectively implement the entire CouchDB API anyway.

        -

        Is there a website or something to see package docs and such?

        +

        Is there a website or something to see package docs and such?

        Yes, head over to https://www.npmjs.com/

        SEE ALSO

          @@ -96,5 +96,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html index b6caab6caf2ad2..329812894eaca2 100644 --- a/deps/npm/html/doc/misc/npm-scope.html +++ b/deps/npm/html/doc/misc/npm-scope.html @@ -93,5 +93,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index bdce4134ae960f..1533d13b63e56b 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -127,7 +127,7 @@

          path

          , "dependencies" : { "bar" : "0.1.x" } , "scripts": { "start" : "bar ./test" } }

    then you could run npm start to execute the bar script, which is exported into the node_modules/.bin directory on npm install.

    -

    package.json vars

    +

    package.json vars

    The package.json fields are tacked onto the npm_package_ prefix. So, for instance, if you had {"name":"foo", "version":"1.2.5"} in your package.json file, then your package scripts would have the @@ -139,7 +139,7 @@

    configuration

    Configuration parameters are put in the environment with the npm_config_ prefix. For instance, you can view the effective root config by checking the npm_config_root environment variable.

    -

    Special: package.json "config" object

    +

    Special: package.json "config" object

    The package.json "config" keys are overwritten in the environment if there is a config param of <name>[@<version>]:<key>. For example, if the package.json has this:

    @@ -234,5 +234,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index 830a5c5b79f265..d31c293c9ddd3c 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -52,5 +52,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index a202644c534a73..28db44aa664ce8 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -11,8 +11,7 @@

    semver

    The semantic versioner for npm

    Install

    -
    npm install --save semver
    -`
    +
    npm install --save semver

    Usage

    As a node module:

    const semver = require('semver')
    @@ -28,8 +27,6 @@ 

    Usage

    As a command-line utility:

    $ semver -h
     
    -SemVer 5.3.0
    -
     A JavaScript implementation of the http://semver.org/ specification
     Copyright Isaac Z. Schlueter
     
    @@ -53,6 +50,9 @@ 

    Usage

    -l --loose Interpret versions and ranges loosely +-p --include-prerelease + Always include prerelease versions in range matching + -c --coerce Coerce a string into SemVer if possible (does not imply --loose) @@ -133,7 +133,7 @@

    Advanced Range Syntax

    deterministic ways.

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

    -

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

    +

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

    Specifies an inclusive set.

    • 1.2.3 - 2.3.4 := >=1.2.3 <=2.3.4
    • @@ -151,7 +151,7 @@

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

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

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

    +

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

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

      @@ -166,7 +166,7 @@

      X-Ranges 1.2.x 1.X 1 := 1.x.x := >=1.0.0 <2.0.0
    • 1.2 := 1.2.x := >=1.2.0 <1.3.0
    -

    Tilde Ranges ~1.2.3 ~1.2 ~1

    +

    Tilde Ranges ~1.2.3 ~1.2 ~1

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

      @@ -182,7 +182,7 @@

      Tilde Ranges ~1.2.3 ~1.21.2.4-beta.2 would not, because it is a prerelease of a different [major, minor, patch] tuple.

    -

    Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4

    +

    Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4

    Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple. In other words, this allows patch and minor updates for versions 1.0.0 and above, patch updates for @@ -242,9 +242,20 @@

    Range Grammar

    parts ::= part ( '.' part ) * part ::= nr | [-0-9A-Za-z]+

    Functions

    -

    All methods and classes take a final loose boolean argument that, if -true, will be more forgiving about not-quite-valid semver strings. -The resulting output will always be 100% strict, of course.

    +

    All methods and classes take a final options object argument. All +options in this object are false by default. The options supported +are:

    +
      +
    • loose Be more forgiving about not-quite-valid semver strings. +(Any resulting output will always be 100% strict compliant, of +course.) For backwards compatibility reasons, if the options +argument is a boolean value instead of an object, it is interpreted +to be the loose param.
    • +
    • includePrerelease Set to suppress the default +behavior of +excluding prerelease tagged versions from ranges unless they are +explicitly opted into.
    • +

    Strict-mode Comparators and Ranges will be strict about the SemVer strings that they parse.

      @@ -295,7 +306,7 @@

      Comparators

      • intersects(comparator): Return true if the comparators intersect
      -

      Ranges

      +

      Ranges

      • validRange(range): Return the valid range or null if it's not valid
      • satisfies(version, range): Return true if the version satisfies the @@ -350,5 +361,5 @@

        Coercion

               - + diff --git a/deps/npm/lib/access.js b/deps/npm/lib/access.js index 164ea3b7d741a1..4bb93fda1d0ee2 100644 --- a/deps/npm/lib/access.js +++ b/deps/npm/lib/access.js @@ -1,28 +1,50 @@ 'use strict' /* eslint-disable standard/no-callback-literal */ -var resolve = require('path').resolve +const BB = require('bluebird') -var readPackageJson = require('read-package-json') -var mapToRegistry = require('./utils/map-to-registry.js') -var npm = require('./npm.js') -var output = require('./utils/output.js') - -var whoami = require('./whoami') +const figgyPudding = require('figgy-pudding') +const libaccess = require('libnpm/access') +const npmConfig = require('./config/figgy-config.js') +const output = require('./utils/output.js') +const otplease = require('./utils/otplease.js') +const path = require('path') +const prefix = require('./npm.js').prefix +const readPackageJson = BB.promisify(require('read-package-json')) +const usage = require('./utils/usage.js') +const whoami = require('./whoami.js') module.exports = access -access.usage = +access.usage = usage( + 'npm access', 'npm access public []\n' + 'npm access restricted []\n' + 'npm access grant []\n' + 'npm access revoke []\n' + + 'npm access 2fa-required []\n' + + 'npm access 2fa-not-required []\n' + 'npm access ls-packages [||]\n' + 'npm access ls-collaborators [ []]\n' + 'npm access edit []' +) + +access.subcommands = [ + 'public', 'restricted', 'grant', 'revoke', + 'ls-packages', 'ls-collaborators', 'edit', + '2fa-required', '2fa-not-required' +] + +const AccessConfig = figgyPudding({ + json: {} +}) -access.subcommands = ['public', 'restricted', 'grant', 'revoke', - 'ls-packages', 'ls-collaborators', 'edit'] +function UsageError (msg = '') { + throw Object.assign(new Error( + (msg ? `\nUsage: ${msg}\n\n` : '') + + access.usage + ), {code: 'EUSAGE'}) +} access.completion = function (opts, cb) { var argv = opts.conf.argv.remain @@ -42,6 +64,8 @@ access.completion = function (opts, cb) { case 'ls-packages': case 'ls-collaborators': case 'edit': + case '2fa-required': + case '2fa-not-required': return cb(null, []) case 'revoke': return cb(null, []) @@ -50,81 +74,125 @@ access.completion = function (opts, cb) { } } -function access (args, cb) { - var cmd = args.shift() - var params - return parseParams(cmd, args, function (err, p) { - if (err) { return cb(err) } - params = p - return mapToRegistry(params.package, npm.config, invokeCmd) - }) +function access ([cmd, ...args], cb) { + return BB.try(() => { + const fn = access.subcommands.includes(cmd) && access[cmd] + if (!cmd) { UsageError('Subcommand is required.') } + if (!fn) { UsageError(`${cmd} is not a recognized subcommand.`) } - function invokeCmd (err, uri, auth, base) { - if (err) { return cb(err) } - params.auth = auth - try { - return npm.registry.access(cmd, uri, params, function (err, data) { - if (!err && data) { - output(JSON.stringify(data, undefined, 2)) - } - cb(err, data) - }) - } catch (e) { - cb(e.message + '\n\nUsage:\n' + access.usage) - } - } + return fn(args, AccessConfig(npmConfig())) + }).then( + x => cb(null, x), + err => err.code === 'EUSAGE' ? cb(err.message) : cb(err) + ) } -function parseParams (cmd, args, cb) { - // mapToRegistry will complain if package is undefined, - // but it's not needed for ls-packages - var params = { 'package': '' } - if (cmd === 'grant') { - params.permissions = args.shift() - } - if (['grant', 'revoke', 'ls-packages'].indexOf(cmd) !== -1) { - var entity = (args.shift() || '').split(':') - params.scope = entity[0] - params.team = entity[1] - } +access.public = ([pkg], opts) => { + return modifyPackage(pkg, opts, libaccess.public) +} - if (cmd === 'ls-packages') { - if (!params.scope) { - whoami([], true, function (err, scope) { - params.scope = scope - cb(err, params) - }) - } else { - cb(null, params) +access.restricted = ([pkg], opts) => { + return modifyPackage(pkg, opts, libaccess.restricted) +} + +access.grant = ([perms, scopeteam, pkg], opts) => { + return BB.try(() => { + if (!perms || (perms !== 'read-only' && perms !== 'read-write')) { + UsageError('First argument must be either `read-only` or `read-write.`') } - } else { - getPackage(args.shift(), function (err, pkg) { - if (err) return cb(err) - params.package = pkg + if (!scopeteam) { + UsageError('`` argument is required.') + } + const [, scope, team] = scopeteam.match(/^@?([^:]+):(.*)$/) || [] + if (!scope && !team) { + UsageError( + 'Second argument used incorrect format.\n' + + 'Example: @example:developers' + ) + } + return modifyPackage(pkg, opts, (pkgName, opts) => { + return libaccess.grant(pkgName, scopeteam, perms, opts) + }) + }) +} - if (cmd === 'ls-collaborators') params.user = args.shift() - cb(null, params) +access.revoke = ([scopeteam, pkg], opts) => { + return BB.try(() => { + if (!scopeteam) { + UsageError('`` argument is required.') + } + const [, scope, team] = scopeteam.match(/^@?([^:]+):(.*)$/) || [] + if (!scope || !team) { + UsageError( + 'First argument used incorrect format.\n' + + 'Example: @example:developers' + ) + } + return modifyPackage(pkg, opts, (pkgName, opts) => { + return libaccess.revoke(pkgName, scopeteam, opts) }) - } + }) +} + +access['2fa-required'] = access.tfaRequired = ([pkg], opts) => { + return modifyPackage(pkg, opts, libaccess.tfaRequired, false) +} + +access['2fa-not-required'] = access.tfaNotRequired = ([pkg], opts) => { + return modifyPackage(pkg, opts, libaccess.tfaNotRequired, false) +} + +access['ls-packages'] = access.lsPackages = ([owner], opts) => { + return ( + owner ? BB.resolve(owner) : BB.fromNode(cb => whoami([], true, cb)) + ).then(owner => { + return libaccess.lsPackages(owner, opts) + }).then(pkgs => { + // TODO - print these out nicely (breaking change) + output(JSON.stringify(pkgs, null, 2)) + }) +} + +access['ls-collaborators'] = access.lsCollaborators = ([pkg, usr], opts) => { + return getPackage(pkg).then(pkgName => + libaccess.lsCollaborators(pkgName, usr, opts) + ).then(collabs => { + // TODO - print these out nicely (breaking change) + output(JSON.stringify(collabs, null, 2)) + }) } -function getPackage (name, cb) { - if (name && name.trim()) { - cb(null, name.trim()) - } else { - readPackageJson( - resolve(npm.prefix, 'package.json'), - function (err, data) { - if (err) { +access['edit'] = () => BB.reject(new Error('edit subcommand is not implemented yet')) + +function modifyPackage (pkg, opts, fn, requireScope = true) { + return getPackage(pkg, requireScope).then(pkgName => + otplease(opts, opts => fn(pkgName, opts)) + ) +} + +function getPackage (name, requireScope = true) { + return BB.try(() => { + if (name && name.trim()) { + return name.trim() + } else { + return readPackageJson( + path.resolve(prefix, 'package.json') + ).then( + data => data.name, + err => { if (err.code === 'ENOENT') { - cb(new Error('no package name passed to command and no package.json found')) + throw new Error('no package name passed to command and no package.json found') } else { - cb(err) + throw err } - } else { - cb(null, data.name) } - } - ) - } + ) + } + }).then(name => { + if (requireScope && !name.match(/^@[^/]+\/.*$/)) { + UsageError('This command is only available for scoped packages.') + } else { + return name + } + }) } diff --git a/deps/npm/lib/audit.js b/deps/npm/lib/audit.js index 06852610e64663..2cabef9d27d0d3 100644 --- a/deps/npm/lib/audit.js +++ b/deps/npm/lib/audit.js @@ -3,17 +3,37 @@ const Bluebird = require('bluebird') const audit = require('./install/audit.js') +const figgyPudding = require('figgy-pudding') const fs = require('graceful-fs') const Installer = require('./install.js').Installer const lockVerify = require('lock-verify') const log = require('npmlog') -const npa = require('npm-package-arg') +const npa = require('libnpm/parse-arg') const npm = require('./npm.js') +const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output.js') const parseJson = require('json-parse-better-errors') const readFile = Bluebird.promisify(fs.readFile) +const AuditConfig = figgyPudding({ + also: {}, + 'audit-level': {}, + deepArgs: 'deep-args', + 'deep-args': {}, + dev: {}, + force: {}, + 'dry-run': {}, + global: {}, + json: {}, + only: {}, + parseable: {}, + prod: {}, + production: {}, + registry: {}, + runId: {} +}) + module.exports = auditCmd const usage = require('./utils/usage') @@ -110,12 +130,12 @@ function maybeReadFile (name) { }) } -function filterEnv (action) { - const includeDev = npm.config.get('dev') || - (!/^prod(uction)?$/.test(npm.config.get('only')) && !npm.config.get('production')) || - /^dev(elopment)?$/.test(npm.config.get('only')) || - /^dev(elopment)?$/.test(npm.config.get('also')) - const includeProd = !/^dev(elopment)?$/.test(npm.config.get('only')) +function filterEnv (action, opts) { + const includeDev = opts.dev || + (!/^prod(uction)?$/.test(opts.only) && !opts.production) || + /^dev(elopment)?$/.test(opts.only) || + /^dev(elopment)?$/.test(opts.also) + const includeProd = !/^dev(elopment)?$/.test(opts.only) const resolves = action.resolves.filter(({dev}) => { return (dev && includeDev) || (!dev && includeProd) }) @@ -125,7 +145,8 @@ function filterEnv (action) { } function auditCmd (args, cb) { - if (npm.config.get('global')) { + const opts = AuditConfig(npmConfig()) + if (opts.global) { const err = new Error('`npm audit` does not support testing globals') err.code = 'EAUDITGLOBAL' throw err @@ -168,8 +189,16 @@ function auditCmd (args, cb) { }).then((auditReport) => { return audit.submitForFullReport(auditReport) }).catch((err) => { - if (err.statusCode === 404 || err.statusCode >= 500) { - const ne = new Error(`Your configured registry (${npm.config.get('registry')}) does not support audit requests.`) + if (err.statusCode >= 400) { + let msg + if (err.statusCode === 401) { + msg = `Either your login credentials are invalid or your registry (${opts.registry}) does not support audit.` + } else if (err.statusCode === 404) { + msg = `Your configured registry (${opts.registry}) does not support audit requests.` + } else { + msg = `Your configured registry (${opts.registry}) does not support audit requests, or the audit endpoint is temporarily unavailable.` + } + const ne = new Error(msg) ne.code = 'ENOAUDIT' ne.wrapped = err throw ne @@ -178,7 +207,7 @@ function auditCmd (args, cb) { }).then((auditResult) => { if (args[0] === 'fix') { const actions = (auditResult.actions || []).reduce((acc, action) => { - action = filterEnv(action) + action = filterEnv(action, opts) if (!action) { return acc } if (action.isMajor) { acc.major.add(`${action.module}@${action.target}`) @@ -215,7 +244,7 @@ function auditCmd (args, cb) { review: new Set() }) return Bluebird.try(() => { - const installMajor = npm.config.get('force') + const installMajor = opts.force const installCount = actions.install.size + (installMajor ? actions.major.size : 0) + actions.update.size const vulnFixCount = new Set([...actions.installFixes, ...actions.updateFixes, ...(installMajor ? actions.majorFixes : [])]).size const metavuln = auditResult.metadata.vulnerabilities @@ -230,16 +259,16 @@ function auditCmd (args, cb) { return Bluebird.fromNode(cb => { new Auditor( npm.prefix, - !!npm.config.get('dry-run'), + !!opts['dry-run'], [...actions.install, ...(installMajor ? actions.major : [])], - { + opts.concat({ runId: auditResult.runId, deepArgs: [...actions.update].map(u => u.split('>')) - } + }).toJSON() ).run(cb) }).then(() => { const numScanned = auditResult.metadata.totalDependencies - if (!npm.config.get('json') && !npm.config.get('parseable')) { + if (!opts.json && !opts.parseable) { output(`fixed ${vulnFixCount} of ${total} vulnerabilit${total === 1 ? 'y' : 'ies'} in ${numScanned} scanned package${numScanned === 1 ? '' : 's'}`) if (actions.review.size) { output(` ${actions.review.size} vulnerabilit${actions.review.size === 1 ? 'y' : 'ies'} required manual review and could not be updated`) @@ -258,12 +287,12 @@ function auditCmd (args, cb) { }) } else { const levels = ['low', 'moderate', 'high', 'critical'] - const minLevel = levels.indexOf(npm.config.get('audit-level')) + const minLevel = levels.indexOf(opts['audit-level']) const vulns = levels.reduce((count, level, i) => { return i < minLevel ? count : count + (auditResult.metadata.vulnerabilities[level] || 0) }, 0) if (vulns > 0) process.exitCode = 1 - if (npm.config.get('parseable')) { + if (opts.parseable) { return audit.printParseableReport(auditResult) } else { return audit.printFullReport(auditResult) diff --git a/deps/npm/lib/auth/legacy.js b/deps/npm/lib/auth/legacy.js index 8c25df0288e677..7ad678be5e5c18 100644 --- a/deps/npm/lib/auth/legacy.js +++ b/deps/npm/lib/auth/legacy.js @@ -1,11 +1,11 @@ 'use strict' + const read = require('../utils/read-user-info.js') -const profile = require('npm-profile') +const profile = require('libnpm/profile') const log = require('npmlog') -const npm = require('../npm.js') +const figgyPudding = require('figgy-pudding') +const npmConfig = require('../config/figgy-config.js') const output = require('../utils/output.js') -const pacoteOpts = require('../config/pacote') -const fetchOpts = require('../config/fetch-opts') const openUrl = require('../utils/open-url') const openerPromise = (url) => new Promise((resolve, reject) => { @@ -26,54 +26,54 @@ const loginPrompter = (creds) => { }) } -module.exports.login = (creds, registry, scope, cb) => { - const conf = { - log: log, - creds: creds, - registry: registry, - auth: { - otp: npm.config.get('otp') - }, - scope: scope, - opts: fetchOpts.fromPacote(pacoteOpts()) - } - login(conf).then((newCreds) => cb(null, newCreds)).catch(cb) +const LoginOpts = figgyPudding({ + 'always-auth': {}, + creds: {}, + log: {default: () => log}, + registry: {}, + scope: {} +}) + +module.exports.login = (creds = {}, registry, scope, cb) => { + const opts = LoginOpts(npmConfig()).concat({scope, registry, creds}) + login(opts).then((newCreds) => cb(null, newCreds)).catch(cb) } -function login (conf) { - return profile.login(openerPromise, loginPrompter, conf) +function login (opts) { + return profile.login(openerPromise, loginPrompter, opts) .catch((err) => { if (err.code === 'EOTP') throw err - const u = conf.creds.username - const p = conf.creds.password - const e = conf.creds.email + const u = opts.creds.username + const p = opts.creds.password + const e = opts.creds.email if (!(u && p && e)) throw err - return profile.adduserCouch(u, e, p, conf) + return profile.adduserCouch(u, e, p, opts) }) .catch((err) => { if (err.code !== 'EOTP') throw err - return read.otp('Enter one-time password from your authenticator app: ').then((otp) => { - conf.auth.otp = otp - const u = conf.creds.username - const p = conf.creds.password - return profile.loginCouch(u, p, conf) + return read.otp( + 'Enter one-time password from your authenticator app: ' + ).then(otp => { + const u = opts.creds.username + const p = opts.creds.password + return profile.loginCouch(u, p, opts.concat({otp})) }) }).then((result) => { const newCreds = {} if (result && result.token) { newCreds.token = result.token } else { - newCreds.username = conf.creds.username - newCreds.password = conf.creds.password - newCreds.email = conf.creds.email - newCreds.alwaysAuth = npm.config.get('always-auth') + newCreds.username = opts.creds.username + newCreds.password = opts.creds.password + newCreds.email = opts.creds.email + newCreds.alwaysAuth = opts['always-auth'] } - const usermsg = conf.creds.username ? ' user ' + conf.creds.username : '' - conf.log.info('login', 'Authorized' + usermsg) - const scopeMessage = conf.scope ? ' to scope ' + conf.scope : '' - const userout = conf.creds.username ? ' as ' + conf.creds.username : '' - output('Logged in%s%s on %s.', userout, scopeMessage, conf.registry) + const usermsg = opts.creds.username ? ' user ' + opts.creds.username : '' + opts.log.info('login', 'Authorized' + usermsg) + const scopeMessage = opts.scope ? ' to scope ' + opts.scope : '' + const userout = opts.creds.username ? ' as ' + opts.creds.username : '' + output('Logged in%s%s on %s.', userout, scopeMessage, opts.registry) return newCreds }) } diff --git a/deps/npm/lib/auth/sso.js b/deps/npm/lib/auth/sso.js index 519ca8496c74c2..099e764e3ab40b 100644 --- a/deps/npm/lib/auth/sso.js +++ b/deps/npm/lib/auth/sso.js @@ -1,56 +1,73 @@ -var log = require('npmlog') -var npm = require('../npm.js') -var output = require('../utils/output') -var openUrl = require('../utils/open-url') +'use strict' + +const BB = require('bluebird') + +const figgyPudding = require('figgy-pudding') +const log = require('npmlog') +const npmConfig = require('../config/figgy-config.js') +const npmFetch = require('npm-registry-fetch') +const output = require('../utils/output.js') +const openUrl = BB.promisify(require('../utils/open-url.js')) +const otplease = require('../utils/otplease.js') +const profile = require('libnpm/profile') + +const SsoOpts = figgyPudding({ + ssoType: 'sso-type', + 'sso-type': {}, + ssoPollFrequency: 'sso-poll-frequency', + 'sso-poll-frequency': {} +}) module.exports.login = function login (creds, registry, scope, cb) { - var ssoType = npm.config.get('sso-type') + const opts = SsoOpts(npmConfig()).concat({creds, registry, scope}) + const ssoType = opts.ssoType if (!ssoType) { return cb(new Error('Missing option: sso-type')) } - var params = { - // We're reusing the legacy login endpoint, so we need some dummy - // stuff here to pass validation. They're never used. - auth: { - username: 'npm_' + ssoType + '_auth_dummy_user', - password: 'placeholder', - email: 'support@npmjs.com', - authType: ssoType - } + // We're reusing the legacy login endpoint, so we need some dummy + // stuff here to pass validation. They're never used. + const auth = { + username: 'npm_' + ssoType + '_auth_dummy_user', + password: 'placeholder', + email: 'support@npmjs.com', + authType: ssoType } - npm.registry.adduser(registry, params, function (er, doc) { - if (er) return cb(er) - if (!doc || !doc.token) return cb(new Error('no SSO token returned')) - if (!doc.sso) return cb(new Error('no SSO URL returned by services')) - - openUrl(doc.sso, 'to complete your login please visit', function () { - pollForSession(registry, doc.token, function (err, username) { - if (err) return cb(err) - log.info('adduser', 'Authorized user %s', username) - var scopeMessage = scope ? ' to scope ' + scope : '' - output('Logged in as %s%s on %s.', username, scopeMessage, registry) - - cb(null, { token: doc.token }) - }) + otplease(opts, + opts => profile.loginCouch(auth.username, auth.password, opts) + ).then(({token, sso}) => { + if (!token) { throw new Error('no SSO token returned') } + if (!sso) { throw new Error('no SSO URL returned by services') } + return openUrl(sso, 'to complete your login please visit').then(() => { + return pollForSession(registry, token, opts) + }).then(username => { + log.info('adduser', 'Authorized user %s', username) + var scopeMessage = scope ? ' to scope ' + scope : '' + output('Logged in as %s%s on %s.', username, scopeMessage, registry) + return {token} }) - }) + }).nodeify(cb) } -function pollForSession (registry, token, cb) { +function pollForSession (registry, token, opts) { log.info('adduser', 'Polling for validated SSO session') - npm.registry.whoami(registry, { - auth: { - token: token - } - }, function (er, username) { - if (er && er.statusCode !== 401) { - cb(er) - } else if (!username) { - setTimeout(function () { - pollForSession(registry, token, cb) - }, npm.config.get('sso-poll-frequency')) - } else { - cb(null, username) + return npmFetch.json( + '/-/whoami', opts.concat({registry, forceAuth: {token}}) + ).then( + ({username}) => username, + err => { + if (err.code === 'E401') { + return sleep(opts['sso-poll-frequency']).then(() => { + return pollForSession(registry, token, opts) + }) + } else { + throw err + } } + ) +} + +function sleep (time) { + return new BB((resolve) => { + setTimeout(resolve, time) }) } diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 169f192cad5f2c..00abd8c746ab73 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -9,9 +9,9 @@ const finished = BB.promisify(require('mississippi').finished) const log = require('npmlog') const npa = require('npm-package-arg') const npm = require('./npm.js') +const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output.js') const pacote = require('pacote') -const pacoteOpts = require('./config/pacote') const path = require('path') const rm = BB.promisify(require('./utils/gently-rm.js')) const unbuild = BB.promisify(npm.commands.unbuild) @@ -107,7 +107,7 @@ function add (args, where) { log.verbose('cache add', 'spec', spec) if (!spec) return BB.reject(new Error(usage)) log.silly('cache add', 'parsed spec', spec) - return finished(pacote.tarball.stream(spec, pacoteOpts({where})).resume()) + return finished(pacote.tarball.stream(spec, npmConfig({where})).resume()) } cache.verify = verify @@ -131,7 +131,7 @@ function verify () { cache.unpack = unpack function unpack (pkg, ver, unpackTarget, dmode, fmode, uid, gid) { return unbuild([unpackTarget], true).then(() => { - const opts = pacoteOpts({dmode, fmode, uid, gid, offline: true}) + const opts = npmConfig({dmode, fmode, uid, gid, offline: true}) return pacote.extract(npa.resolve(pkg, ver), unpackTarget, opts) }) } diff --git a/deps/npm/lib/ci.js b/deps/npm/lib/ci.js index 03822b9528d1d4..1fbb28b570f6fa 100644 --- a/deps/npm/lib/ci.js +++ b/deps/npm/lib/ci.js @@ -1,40 +1,19 @@ 'use strict' const Installer = require('libcipm') -const lifecycleOpts = require('./config/lifecycle.js') -const npm = require('./npm.js') +const npmConfig = require('./config/figgy-config.js') const npmlog = require('npmlog') -const pacoteOpts = require('./config/pacote.js') ci.usage = 'npm ci' ci.completion = (cb) => cb(null, []) -Installer.CipmConfig.impl(npm.config, { - get: npm.config.get, - set: npm.config.set, - toLifecycle (moreOpts) { - return lifecycleOpts(moreOpts) - }, - toPacote (moreOpts) { - return pacoteOpts(moreOpts) - } -}) - module.exports = ci function ci (args, cb) { - return new Installer({ - config: npm.config, - log: npmlog - }) - .run() - .then( - (details) => { - npmlog.disableProgress() - console.log(`added ${details.pkgCount} packages in ${ - details.runTime / 1000 - }s`) - } - ) - .then(() => cb(), cb) + return new Installer(npmConfig({ log: npmlog })).run().then(details => { + npmlog.disableProgress() + console.log(`added ${details.pkgCount} packages in ${ + details.runTime / 1000 + }s`) + }).then(() => cb(), cb) } diff --git a/deps/npm/lib/config/cmd-list.js b/deps/npm/lib/config/cmd-list.js index a453082adc1bc8..fa4390fcdcba77 100644 --- a/deps/npm/lib/config/cmd-list.js +++ b/deps/npm/lib/config/cmd-list.js @@ -50,7 +50,9 @@ var affordances = { 'rm': 'uninstall', 'r': 'uninstall', 'rum': 'run-script', - 'sit': 'cit' + 'sit': 'cit', + 'urn': 'run-script', + 'ogr': 'org' } // these are filenames in . @@ -89,6 +91,7 @@ var cmdList = [ 'token', 'profile', 'audit', + 'org', 'help', 'help-search', diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js index 991a2129f68944..25926595391207 100644 --- a/deps/npm/lib/config/defaults.js +++ b/deps/npm/lib/config/defaults.js @@ -239,7 +239,7 @@ Object.defineProperty(exports, 'defaults', {get: function () { process.getuid() !== 0, 'update-notifier': true, usage: false, - user: process.platform === 'win32' ? 0 : 'nobody', + user: (process.platform === 'win32' || os.type() === 'OS400') ? 0 : 'nobody', userconfig: path.resolve(home, '.npmrc'), umask: process.umask ? process.umask() : umask.fromString('022'), version: false, diff --git a/deps/npm/lib/config/figgy-config.js b/deps/npm/lib/config/figgy-config.js new file mode 100644 index 00000000000000..9e9ca0ba561efb --- /dev/null +++ b/deps/npm/lib/config/figgy-config.js @@ -0,0 +1,87 @@ +'use strict' + +const BB = require('bluebird') + +const crypto = require('crypto') +const figgyPudding = require('figgy-pudding') +const log = require('npmlog') +const npm = require('../npm.js') +const pack = require('../pack.js') +const path = require('path') + +const npmSession = crypto.randomBytes(8).toString('hex') +log.verbose('npm-session', npmSession) + +const SCOPE_REGISTRY_REGEX = /@.*:registry$/gi +const NpmConfig = figgyPudding({}, { + other (key) { + return key.match(SCOPE_REGISTRY_REGEX) + } +}) + +let baseConfig + +module.exports = mkConfig +function mkConfig (...providers) { + if (!baseConfig) { + baseConfig = NpmConfig(npm.config, { + // Add some non-npm-config opts by hand. + cache: path.join(npm.config.get('cache'), '_cacache'), + // NOTE: npm has some magic logic around color distinct from the config + // value, so we have to override it here + color: !!npm.color, + dirPacker: pack.packGitDep, + hashAlgorithm: 'sha1', + includeDeprecated: false, + log, + 'npm-session': npmSession, + 'project-scope': npm.projectScope, + refer: npm.referer, + dmode: npm.modes.exec, + fmode: npm.modes.file, + umask: npm.modes.umask, + npmVersion: npm.version, + tmp: npm.tmp, + Promise: BB + }) + const ownerStats = calculateOwner() + if (ownerStats.uid != null || ownerStats.gid != null) { + baseConfig = baseConfig.concat(ownerStats) + } + } + let conf = baseConfig.concat(...providers) + // Adapt some other configs if missing + if (npm.config.get('prefer-online') === undefined) { + conf = conf.concat({ + 'prefer-online': npm.config.get('cache-max') <= 0 + }) + } + if (npm.config.get('prefer-online') === undefined) { + conf = conf.concat({ + 'prefer-online': npm.config.get('cache-min') >= 9999 + }) + } + return conf +} + +let effectiveOwner +function calculateOwner () { + if (!effectiveOwner) { + effectiveOwner = { uid: 0, gid: 0 } + + // Pretty much only on windows + if (!process.getuid) { + return effectiveOwner + } + + effectiveOwner.uid = +process.getuid() + effectiveOwner.gid = +process.getgid() + + if (effectiveOwner.uid === 0) { + if (process.env.SUDO_UID) effectiveOwner.uid = +process.env.SUDO_UID + if (process.env.SUDO_GID) effectiveOwner.gid = +process.env.SUDO_GID + } + } + + return effectiveOwner +} diff --git a/deps/npm/lib/config/pacote.js b/deps/npm/lib/config/pacote.js deleted file mode 100644 index 505b69da375a44..00000000000000 --- a/deps/npm/lib/config/pacote.js +++ /dev/null @@ -1,141 +0,0 @@ -'use strict' - -const Buffer = require('safe-buffer').Buffer - -const crypto = require('crypto') -const npm = require('../npm') -const log = require('npmlog') -let pack -const path = require('path') - -let effectiveOwner - -const npmSession = crypto.randomBytes(8).toString('hex') -log.verbose('npm-session', npmSession) - -module.exports = pacoteOpts -function pacoteOpts (moreOpts) { - if (!pack) { - pack = require('../pack.js') - } - const ownerStats = calculateOwner() - const opts = { - cache: path.join(npm.config.get('cache'), '_cacache'), - ca: npm.config.get('ca'), - cert: npm.config.get('cert'), - defaultTag: npm.config.get('tag'), - dirPacker: pack.packGitDep, - hashAlgorithm: 'sha1', - includeDeprecated: false, - key: npm.config.get('key'), - localAddress: npm.config.get('local-address'), - log: log, - maxAge: npm.config.get('cache-min'), - maxSockets: npm.config.get('maxsockets'), - npmSession: npmSession, - offline: npm.config.get('offline'), - preferOffline: npm.config.get('prefer-offline') || npm.config.get('cache-min') > 9999, - preferOnline: npm.config.get('prefer-online') || npm.config.get('cache-max') <= 0, - projectScope: npm.projectScope, - proxy: npm.config.get('https-proxy') || npm.config.get('proxy'), - noProxy: npm.config.get('noproxy'), - refer: npm.registry.refer, - registry: npm.config.get('registry'), - retry: { - 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') - }, - scope: npm.config.get('scope'), - strictSSL: npm.config.get('strict-ssl'), - userAgent: npm.config.get('user-agent'), - - dmode: npm.modes.exec, - fmode: npm.modes.file, - umask: npm.modes.umask - } - - if (ownerStats.uid != null || ownerStats.gid != null) { - Object.assign(opts, ownerStats) - } - - npm.config.keys.forEach(function (k) { - const authMatchGlobal = k.match( - /^(_authToken|username|_password|password|email|always-auth|_auth)$/ - ) - const authMatchScoped = k[0] === '/' && k.match( - /(.*):(_authToken|username|_password|password|email|always-auth|_auth)$/ - ) - - // if it matches scoped it will also match global - if (authMatchGlobal || authMatchScoped) { - let nerfDart = null - let key = null - let val = null - - if (!opts.auth) { opts.auth = {} } - - if (authMatchScoped) { - nerfDart = authMatchScoped[1] - key = authMatchScoped[2] - val = npm.config.get(k) - if (!opts.auth[nerfDart]) { - opts.auth[nerfDart] = { - alwaysAuth: !!npm.config.get('always-auth') - } - } - } else { - key = authMatchGlobal[1] - val = npm.config.get(k) - opts.auth.alwaysAuth = !!npm.config.get('always-auth') - } - - const auth = authMatchScoped ? opts.auth[nerfDart] : opts.auth - if (key === '_authToken') { - auth.token = val - } else if (key.match(/password$/i)) { - auth.password = - // the config file stores password auth already-encoded. pacote expects - // the actual username/password pair. - Buffer.from(val, 'base64').toString('utf8') - } else if (key === 'always-auth') { - auth.alwaysAuth = val === 'false' ? false : !!val - } else { - auth[key] = val - } - } - - if (k[0] === '@') { - if (!opts.scopeTargets) { opts.scopeTargets = {} } - opts.scopeTargets[k.replace(/:registry$/, '')] = npm.config.get(k) - } - }) - - Object.keys(moreOpts || {}).forEach((k) => { - opts[k] = moreOpts[k] - }) - - return opts -} - -function calculateOwner () { - if (!effectiveOwner) { - effectiveOwner = { uid: 0, gid: 0 } - - // Pretty much only on windows - if (!process.getuid) { - return effectiveOwner - } - - effectiveOwner.uid = +process.getuid() - effectiveOwner.gid = +process.getgid() - - if (effectiveOwner.uid === 0) { - if (process.env.SUDO_UID) effectiveOwner.uid = +process.env.SUDO_UID - if (process.env.SUDO_GID) effectiveOwner.gid = +process.env.SUDO_GID - } - } - - return effectiveOwner -} diff --git a/deps/npm/lib/config/reg-client.js b/deps/npm/lib/config/reg-client.js deleted file mode 100644 index d4e2417097fa09..00000000000000 --- a/deps/npm/lib/config/reg-client.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict' - -module.exports = regClientConfig -function regClientConfig (npm, log, config) { - return { - 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') - }, - 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'), - maxSockets: config.get('maxsockets'), - scope: npm.projectScope - } -} diff --git a/deps/npm/lib/deprecate.js b/deps/npm/lib/deprecate.js index 9b71d1de494ad7..7fe2fbed4ba554 100644 --- a/deps/npm/lib/deprecate.js +++ b/deps/npm/lib/deprecate.js @@ -1,55 +1,72 @@ -/* eslint-disable standard/no-callback-literal */ -var npm = require('./npm.js') -var mapToRegistry = require('./utils/map-to-registry.js') -var npa = require('npm-package-arg') +'use strict' + +const BB = require('bluebird') + +const npmConfig = require('./config/figgy-config.js') +const fetch = require('libnpm/fetch') +const figgyPudding = require('figgy-pudding') +const otplease = require('./utils/otplease.js') +const npa = require('libnpm/parse-arg') +const semver = require('semver') +const whoami = require('./whoami.js') + +const DeprecateConfig = figgyPudding({}) module.exports = 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/' - 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 - } - npm.registry.get(uri + c.username, params, function (er, list) { - if (er) return cb() - console.error(list) - return cb(null, list[c.username]) + return BB.try(() => { + if (opts.conf.argv.remain.length > 2) { return } + return whoami([], true, () => {}).then(username => { + if (username) { + // first, get a list of remote packages this user owns. + // once we have a user account, then don't complete anything. + // get the list of packages by user + return fetch( + `/-/by-user/${encodeURIComponent(username)}`, + DeprecateConfig() + ).then(list => list[username]) + } }) - }) + }).nodeify(cb) } -function deprecate (args, cb) { - var pkg = args[0] - var msg = args[1] - if (msg === undefined) return cb('Usage: ' + deprecate.usage) +function deprecate ([pkg, msg], opts, cb) { + if (typeof cb !== 'function') { + cb = opts + opts = null + } + opts = DeprecateConfig(opts || npmConfig()) + return BB.try(() => { + if (msg == null) throw new Error(`Usage: ${deprecate.usage}`) + // fetch the data and make sure it exists. + const p = npa(pkg) - // fetch the data and make sure it exists. - var p = npa(pkg) + // npa makes the default spec "latest", but for deprecation + // "*" is the appropriate default. + const spec = p.rawSpec === '' ? '*' : p.fetchSpec - // npa makes the default spec "latest", but for deprecation - // "*" is the appropriate default. - var spec = p.rawSpec === '' ? '*' : p.fetchSpec - - mapToRegistry(p.name, npm.config, function (er, uri, auth) { - if (er) return cb(er) - - var params = { - version: spec, - message: msg, - auth: auth + if (semver.validRange(spec, true) === null) { + throw new Error('invalid version range: ' + spec) } - npm.registry.deprecate(uri, params, cb) - }) + + const uri = '/' + p.escapedName + return fetch.json(uri, opts.concat({ + spec: p, + query: {write: true} + })).then(packument => { + // filter all the versions that match + Object.keys(packument.versions) + .filter(v => semver.satisfies(v, spec)) + .forEach(v => { packument.versions[v].deprecated = msg }) + return otplease(opts, opts => fetch(uri, opts.concat({ + spec: p, + method: 'PUT', + body: packument, + ignoreBody: true + }))) + }) + }).nodeify(cb) } diff --git a/deps/npm/lib/dist-tag.js b/deps/npm/lib/dist-tag.js index bd0c5ae8a27a7d..176e61221eef0e 100644 --- a/deps/npm/lib/dist-tag.js +++ b/deps/npm/lib/dist-tag.js @@ -1,15 +1,22 @@ /* eslint-disable standard/no-callback-literal */ module.exports = distTag -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 usage = require('./utils/usage') -var output = require('./utils/output.js') +const BB = require('bluebird') + +const figgyPudding = require('figgy-pudding') +const log = require('npmlog') +const npa = require('libnpm/parse-arg') +const npmConfig = require('./config/figgy-config.js') +const output = require('./utils/output.js') +const otplease = require('./utils/otplease.js') +const readLocalPkg = BB.promisify(require('./utils/read-local-package.js')) +const regFetch = require('libnpm/fetch') +const semver = require('semver') +const usage = require('./utils/usage') + +const DistTagOpts = figgyPudding({ + tag: {} +}) distTag.usage = usage( 'dist-tag', @@ -30,130 +37,127 @@ distTag.completion = function (opts, cb) { } } -function distTag (args, cb) { - var cmd = args.shift() - switch (cmd) { - 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': - return remove(args[1], args[0], cb) - case 'ls': case 'l': case 'sl': case 'list': - return list(args[0], cb) - default: - return cb('Usage:\n' + distTag.usage) - } +function UsageError () { + throw Object.assign(new Error('Usage:\n' + distTag.usage), { + code: 'EUSAGE' + }) } -function add (spec, tag, cb) { - var thing = npa(spec || '') - var pkg = thing.name - var version = thing.rawSpec - var t = (tag || npm.config.get('tag')).trim() +function distTag ([cmd, pkg, tag], cb) { + const opts = DistTagOpts(npmConfig()) + return BB.try(() => { + switch (cmd) { + case 'add': case 'a': case 'set': case 's': + return add(pkg, tag, opts) + case 'rm': case 'r': case 'del': case 'd': case 'remove': + return remove(pkg, tag, opts) + case 'ls': case 'l': case 'sl': case 'list': + return list(pkg, opts) + default: + if (!pkg) { + return list(cmd, opts) + } else { + UsageError() + } + } + }).then( + x => cb(null, x), + err => { + if (err.code === 'EUSAGE') { + cb(err.message) + } else { + cb(err) + } + } + ) +} - log.verbose('dist-tag add', t, 'to', pkg + '@' + version) +function add (spec, tag, opts) { + spec = npa(spec || '') + const version = spec.rawSpec + const t = (tag || opts.tag).trim() - if (!pkg || !version || !t) return cb('Usage:\n' + distTag.usage) + log.verbose('dist-tag add', t, 'to', spec.name + '@' + version) + + if (!spec || !version || !t) UsageError() if (semver.validRange(t)) { - var er = new Error('Tag name must not be a valid SemVer range: ' + t) - return cb(er) + throw new Error('Tag name must not be a valid SemVer range: ' + t) } - fetchTags(pkg, function (er, tags) { - if (er) return cb(er) - + return fetchTags(spec, opts).then(tags => { if (tags[t] === version) { log.warn('dist-tag add', t, 'is already set to version', version) - return cb() + return } tags[t] = version - - mapToRegistry(pkg, npm.config, function (er, uri, auth, base) { - var params = { - 'package': pkg, - distTag: t, - version: version, - auth: auth - } - - npm.registry.distTags.add(base, params, function (er) { - if (er) return cb(er) - - output('+' + t + ': ' + pkg + '@' + version) - cb() - }) + const url = `/-/package/${spec.escapedName}/dist-tags/${encodeURIComponent(t)}` + const reqOpts = opts.concat({ + method: 'PUT', + body: JSON.stringify(version), + headers: { + 'content-type': 'application/json' + }, + spec + }) + return otplease(reqOpts, reqOpts => regFetch(url, reqOpts)).then(() => { + output(`+${t}: ${spec.name}@${version}`) }) }) } -function remove (tag, pkg, cb) { - log.verbose('dist-tag del', tag, 'from', pkg) - - fetchTags(pkg, function (er, tags) { - if (er) return cb(er) +function remove (spec, tag, opts) { + spec = npa(spec || '') + log.verbose('dist-tag del', tag, 'from', spec.name) + return fetchTags(spec, opts).then(tags => { 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', spec.name) + throw new Error(tag + ' is not a dist-tag on ' + spec.name) } - - var version = tags[tag] + const version = tags[tag] delete tags[tag] - - mapToRegistry(pkg, npm.config, function (er, uri, auth, base) { - var params = { - 'package': pkg, - distTag: tag, - auth: auth - } - - npm.registry.distTags.rm(base, params, function (er) { - if (er) return cb(er) - - output('-' + tag + ': ' + pkg + '@' + version) - cb() - }) + const url = `/-/package/${spec.escapedName}/dist-tags/${encodeURIComponent(tag)}` + const reqOpts = opts.concat({ + method: 'DELETE' + }) + return otplease(reqOpts, reqOpts => regFetch(url, reqOpts)).then(() => { + output(`-${tag}: ${spec.name}@${version}`) }) }) } -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) +function list (spec, opts) { + if (!spec) { + return readLocalPkg().then(pkg => { + if (!pkg) { UsageError() } + return list(pkg, opts) }) } + spec = npa(spec) - fetchTags(pkg, function (er, tags) { - if (er) { - 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 fetchTags(spec, opts).then(tags => { + var msg = Object.keys(tags).map(k => `${k}: ${tags[k]}`).sort().join('\n') output(msg) - cb(er, tags) + return tags + }, err => { + log.error('dist-tag ls', "Couldn't get dist-tag data for", spec) + throw err }) } -function fetchTags (pkg, cb) { - mapToRegistry(pkg, npm.config, function (er, uri, auth, base) { - if (er) return cb(er) - - var params = { - '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)) - } - - cb(null, tags) +function fetchTags (spec, opts) { + return regFetch.json( + `/-/package/${spec.escapedName}/dist-tags`, + opts.concat({ + 'prefer-online': true, + spec }) + ).then(data => { + if (data && typeof data === 'object') delete data._etag + if (!data || !Object.keys(data).length) { + throw new Error('No dist-tags found for ' + spec.name) + } + return data }) } diff --git a/deps/npm/lib/doctor/check-ping.js b/deps/npm/lib/doctor/check-ping.js index e7e82902a7165c..70db255480c371 100644 --- a/deps/npm/lib/doctor/check-ping.js +++ b/deps/npm/lib/doctor/check-ping.js @@ -4,8 +4,12 @@ var ping = require('../ping.js') function checkPing (cb) { var tracker = log.newItem('checkPing', 1) tracker.info('checkPing', 'Pinging registry') - ping({}, true, (_err, pong, data, res) => { - cb(null, [res.statusCode, res.statusMessage]) + ping({}, true, (err, pong) => { + if (err && err.code && err.code.match(/^E\d{3}$/)) { + return cb(null, [err.code.substr(1)]) + } else { + cb(null, [200, 'OK']) + } }) } diff --git a/deps/npm/lib/fetch-package-metadata.js b/deps/npm/lib/fetch-package-metadata.js index cca6dc64f4168e..78eed42bdf0002 100644 --- a/deps/npm/lib/fetch-package-metadata.js +++ b/deps/npm/lib/fetch-package-metadata.js @@ -8,11 +8,11 @@ const rimraf = require('rimraf') const validate = require('aproba') const npa = require('npm-package-arg') const npm = require('./npm') +let npmConfig const npmlog = require('npmlog') const limit = require('call-limit') const tempFilename = require('./utils/temp-filename') const pacote = require('pacote') -let pacoteOpts const isWindows = require('./utils/is-windows.js') function andLogAndFinish (spec, tracker, done) { @@ -52,10 +52,10 @@ function fetchPackageMetadata (spec, where, opts, done) { err.code = 'EWINDOWSPATH' return logAndFinish(err) } - if (!pacoteOpts) { - pacoteOpts = require('./config/pacote') + if (!npmConfig) { + npmConfig = require('./config/figgy-config.js') } - pacote.manifest(dep, pacoteOpts({ + pacote.manifest(dep, npmConfig({ annotate: true, fullMetadata: opts.fullMetadata, log: tracker || npmlog, @@ -85,9 +85,6 @@ function fetchPackageMetadata (spec, where, opts, done) { module.exports.addBundled = addBundled function addBundled (pkg, next) { validate('OF', arguments) - if (!pacoteOpts) { - pacoteOpts = require('./config/pacote') - } if (pkg._bundled !== undefined) return next(null, pkg) if (!pkg.bundleDependencies && pkg._requested.type !== 'directory') return next(null, pkg) @@ -101,7 +98,10 @@ function addBundled (pkg, next) { } pkg._bundled = null const target = tempFilename('unpack') - const opts = pacoteOpts({integrity: pkg._integrity}) + if (!npmConfig) { + npmConfig = require('./config/figgy-config.js') + } + const opts = npmConfig({integrity: pkg._integrity}) pacote.extract(pkg._resolved || pkg._requested || npa.resolve(pkg.name, pkg.version), target, opts).then(() => { log.silly('addBundled', 'read tarball') readPackageTree(target, (err, tree) => { diff --git a/deps/npm/lib/hook.js b/deps/npm/lib/hook.js index b0552c74740ea3..54aea9f1e9d207 100644 --- a/deps/npm/lib/hook.js +++ b/deps/npm/lib/hook.js @@ -2,129 +2,146 @@ const BB = require('bluebird') -const crypto = require('crypto') -const hookApi = require('libnpmhook') -const log = require('npmlog') -const npm = require('./npm.js') +const hookApi = require('libnpm/hook') +const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output.js') +const otplease = require('./utils/otplease.js') const pudding = require('figgy-pudding') const relativeDate = require('tiny-relative-date') const Table = require('cli-table3') -const usage = require('./utils/usage.js') const validate = require('aproba') -hook.usage = usage([ +hook.usage = [ 'npm hook add [--type=]', 'npm hook ls [pkg]', 'npm hook rm ', 'npm hook update ' -]) +].join('\n') hook.completion = (opts, cb) => { validate('OF', [opts, cb]) return cb(null, []) // fill in this array with completion values } -const npmSession = crypto.randomBytes(8).toString('hex') -const hookConfig = pudding() -function config () { - return hookConfig({ - refer: npm.refer, - projectScope: npm.projectScope, - log, - npmSession - }, npm.config) +const HookConfig = pudding({ + json: {}, + loglevel: {}, + parseable: {}, + silent: {}, + unicode: {} +}) + +function UsageError () { + throw Object.assign(new Error(hook.usage), {code: 'EUSAGE'}) } -module.exports = (args, cb) => BB.try(() => hook(args)).nodeify(cb) +module.exports = (args, cb) => BB.try(() => hook(args)).then( + val => cb(null, val), + err => err.code === 'EUSAGE' ? cb(err.message) : cb(err) +) function hook (args) { - switch (args[0]) { - case 'add': - return add(args[1], args[2], args[3]) - case 'ls': - return ls(args[1]) - case 'rm': - return rm(args[1]) - case 'update': - case 'up': - return update(args[1], args[2], args[3]) - } + return otplease(npmConfig(), opts => { + opts = HookConfig(opts) + switch (args[0]) { + case 'add': + return add(args[1], args[2], args[3], opts) + case 'ls': + return ls(args[1], opts) + case 'rm': + return rm(args[1], opts) + case 'update': + case 'up': + return update(args[1], args[2], args[3], opts) + default: + UsageError() + } + }) } -function add (pkg, uri, secret) { - return hookApi.add(pkg, uri, secret, config()) - .then((hook) => { - if (npm.config.get('json')) { - output(JSON.stringify(hook, null, 2)) - } else { - output(`+ ${hookName(hook)} ${ - npm.config.get('unicode') ? ' ➜ ' : ' -> ' - } ${hook.endpoint}`) - } - }) +function add (pkg, uri, secret, opts) { + return hookApi.add(pkg, uri, secret, opts).then(hook => { + if (opts.json) { + output(JSON.stringify(hook, null, 2)) + } else if (opts.parseable) { + output(Object.keys(hook).join('\t')) + output(Object.keys(hook).map(k => hook[k]).join('\t')) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`+ ${hookName(hook)} ${ + opts.unicode ? ' ➜ ' : ' -> ' + } ${hook.endpoint}`) + } + }) } -function ls (pkg) { - return hookApi.ls(pkg, config()) - .then((hooks) => { - if (npm.config.get('json')) { - output(JSON.stringify(hooks, null, 2)) - } else if (!hooks.length) { - output("You don't have any hooks configured yet.") +function ls (pkg, opts) { + return hookApi.ls(opts.concat({package: pkg})).then(hooks => { + if (opts.json) { + output(JSON.stringify(hooks, null, 2)) + } else if (opts.parseable) { + output(Object.keys(hooks[0]).join('\t')) + hooks.forEach(hook => { + output(Object.keys(hook).map(k => hook[k]).join('\t')) + }) + } else if (!hooks.length) { + output("You don't have any hooks configured yet.") + } else if (!opts.silent && opts.loglevel !== 'silent') { + if (hooks.length === 1) { + output('You have one hook configured.') } else { - if (hooks.length === 1) { - output('You have one hook configured.') - } else { - output(`You have ${hooks.length} hooks configured.`) - } - const table = new Table({head: ['id', 'target', 'endpoint']}) - hooks.forEach((hook) => { + output(`You have ${hooks.length} hooks configured.`) + } + const table = new Table({head: ['id', 'target', 'endpoint']}) + hooks.forEach((hook) => { + table.push([ + {rowSpan: 2, content: hook.id}, + hookName(hook), + hook.endpoint + ]) + if (hook.last_delivery) { table.push([ - {rowSpan: 2, content: hook.id}, - hookName(hook), - hook.endpoint + { + colSpan: 1, + content: `triggered ${relativeDate(hook.last_delivery)}` + }, + hook.response_code ]) - if (hook.last_delivery) { - table.push([ - { - colSpan: 1, - content: `triggered ${relativeDate(hook.last_delivery)}` - }, - hook.response_code - ]) - } else { - table.push([{colSpan: 2, content: 'never triggered'}]) - } - }) - output(table.toString()) - } - }) + } else { + table.push([{colSpan: 2, content: 'never triggered'}]) + } + }) + output(table.toString()) + } + }) } -function rm (id) { - return hookApi.rm(id, config()) - .then((hook) => { - if (npm.config.get('json')) { - output(JSON.stringify(hook, null, 2)) - } else { - output(`- ${hookName(hook)} ${ - npm.config.get('unicode') ? ' ✘ ' : ' X ' - } ${hook.endpoint}`) - } - }) +function rm (id, opts) { + return hookApi.rm(id, opts).then(hook => { + if (opts.json) { + output(JSON.stringify(hook, null, 2)) + } else if (opts.parseable) { + output(Object.keys(hook).join('\t')) + output(Object.keys(hook).map(k => hook[k]).join('\t')) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`- ${hookName(hook)} ${ + opts.unicode ? ' ✘ ' : ' X ' + } ${hook.endpoint}`) + } + }) } -function update (id, uri, secret) { - return hookApi.update(id, uri, secret, config()) - .then((hook) => { - if (npm.config.get('json')) { - output(JSON.stringify(hook, null, 2)) - } else { - output(`+ ${hookName(hook)} ${ - npm.config.get('unicode') ? ' ➜ ' : ' -> ' - } ${hook.endpoint}`) - } - }) +function update (id, uri, secret, opts) { + return hookApi.update(id, uri, secret, opts).then(hook => { + if (opts.json) { + output(JSON.stringify(hook, null, 2)) + } else if (opts.parseable) { + output(Object.keys(hook).join('\t')) + output(Object.keys(hook).map(k => hook[k]).join('\t')) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`+ ${hookName(hook)} ${ + opts.unicode ? ' ➜ ' : ' -> ' + } ${hook.endpoint}`) + } + }) } function hookName (hook) { diff --git a/deps/npm/lib/install/action/extract-worker.js b/deps/npm/lib/install/action/extract-worker.js index 2b082b4a574c25..225e5b4aeab668 100644 --- a/deps/npm/lib/install/action/extract-worker.js +++ b/deps/npm/lib/install/action/extract-worker.js @@ -3,16 +3,16 @@ const BB = require('bluebird') const extract = require('pacote/extract') -const npmlog = require('npmlog') +// const npmlog = require('npmlog') module.exports = (args, cb) => { const parsed = typeof args === 'string' ? JSON.parse(args) : args const spec = parsed[0] const extractTo = parsed[1] const opts = parsed[2] - if (!opts.log) { - opts.log = npmlog - } - opts.log.level = opts.loglevel || opts.log.level + // if (!opts.log) { + // opts.log = npmlog + // } + // opts.log.level = opts.loglevel || opts.log.level BB.resolve(extract(spec, extractTo, opts)).nodeify(cb) } diff --git a/deps/npm/lib/install/action/extract.js b/deps/npm/lib/install/action/extract.js index e8d7a6c4f6d1f0..c1c17cdf6c4f35 100644 --- a/deps/npm/lib/install/action/extract.js +++ b/deps/npm/lib/install/action/extract.js @@ -2,6 +2,7 @@ const BB = require('bluebird') +const figgyPudding = require('figgy-pudding') const stat = BB.promisify(require('graceful-fs').stat) const gentlyRm = BB.promisify(require('../../utils/gently-rm.js')) const mkdirp = BB.promisify(require('mkdirp')) @@ -9,8 +10,8 @@ const moduleStagingPath = require('../module-staging-path.js') const move = require('../../utils/move.js') const npa = require('npm-package-arg') const npm = require('../../npm.js') +let npmConfig const packageId = require('../../utils/package-id.js') -let pacoteOpts const path = require('path') const localWorker = require('./extract-worker.js') const workerFarm = require('worker-farm') @@ -19,19 +20,12 @@ const isRegistry = require('../../utils/is-registry.js') const WORKER_PATH = require.resolve('./extract-worker.js') let workers -// NOTE: temporarily disabled on non-OSX due to ongoing issues: -// -// * Seems to make Windows antivirus issues much more common -// * Messes with Docker (I think) -// -// There are other issues that should be fixed that affect OSX too: -// -// * Logging is messed up right now because pacote does its own thing -// * Global deduplication in pacote breaks due to multiple procs -// -// As these get fixed, we can start experimenting with re-enabling it -// at least on some platforms. -const ENABLE_WORKERS = process.platform === 'darwin' +const ExtractOpts = figgyPudding({ + log: {} +}, { other () { return true } }) + +// Disabled for now. Re-enable someday. Just not today. +const ENABLE_WORKERS = false extract.init = () => { if (ENABLE_WORKERS) { @@ -53,10 +47,10 @@ module.exports = extract function extract (staging, pkg, log) { log.silly('extract', packageId(pkg)) const extractTo = moduleStagingPath(staging, pkg) - if (!pacoteOpts) { - pacoteOpts = require('../../config/pacote') + if (!npmConfig) { + npmConfig = require('../../config/figgy-config.js') } - const opts = pacoteOpts({ + let opts = ExtractOpts(npmConfig()).concat({ integrity: pkg.package._integrity, resolved: pkg.package._resolved }) @@ -72,9 +66,18 @@ function extract (staging, pkg, log) { args[0] = spec.raw if (ENABLE_WORKERS && (isRegistry(spec) || spec.type === 'remote')) { // We can't serialize these options - opts.loglevel = opts.log.level - opts.log = null - opts.dirPacker = null + opts = opts.concat({ + loglevel: opts.log.level, + log: null, + dirPacker: null, + Promise: null, + _events: null, + _eventsCount: null, + list: null, + sources: null, + _maxListeners: null, + root: null + }) // workers will run things in parallel! launcher = workers try { diff --git a/deps/npm/lib/install/action/fetch.js b/deps/npm/lib/install/action/fetch.js index 5ad34e29dd27ef..346194e51607e1 100644 --- a/deps/npm/lib/install/action/fetch.js +++ b/deps/npm/lib/install/action/fetch.js @@ -3,14 +3,14 @@ const BB = require('bluebird') const finished = BB.promisify(require('mississippi').finished) +const npmConfig = require('../../config/figgy-config.js') const packageId = require('../../utils/package-id.js') const pacote = require('pacote') -const pacoteOpts = require('../../config/pacote') module.exports = fetch function fetch (staging, pkg, log, next) { log.silly('fetch', packageId(pkg)) - const opts = pacoteOpts({integrity: pkg.package._integrity}) + const opts = npmConfig({integrity: pkg.package._integrity}) return finished(pacote.tarball.stream(pkg.package._requested, opts)) .then(() => next(), next) } diff --git a/deps/npm/lib/install/audit.js b/deps/npm/lib/install/audit.js index f372b425a6fd4e..f5bc5ae1a92d65 100644 --- a/deps/npm/lib/install/audit.js +++ b/deps/npm/lib/install/audit.js @@ -7,118 +7,115 @@ exports.printInstallReport = printInstallReport exports.printParseableReport = printParseableReport exports.printFullReport = printFullReport -const Bluebird = require('bluebird') const auditReport = require('npm-audit-report') +const npmConfig = require('../config/figgy-config.js') +const figgyPudding = require('figgy-pudding') const treeToShrinkwrap = require('../shrinkwrap.js').treeToShrinkwrap const packageId = require('../utils/package-id.js') const output = require('../utils/output.js') const npm = require('../npm.js') const qw = require('qw') -const registryFetch = require('npm-registry-fetch') -const zlib = require('zlib') -const gzip = Bluebird.promisify(zlib.gzip) -const log = require('npmlog') +const regFetch = require('npm-registry-fetch') const perf = require('../utils/perf.js') -const url = require('url') const npa = require('npm-package-arg') const uuid = require('uuid') const ssri = require('ssri') const cloneDeep = require('lodash.clonedeep') -const pacoteOpts = require('../config/pacote.js') // used when scrubbing module names/specifiers const runId = uuid.v4() +const InstallAuditConfig = figgyPudding({ + color: {}, + json: {}, + unicode: {} +}, { + other (key) { + return /:registry$/.test(key) + } +}) + function submitForInstallReport (auditData) { - const cfg = npm.config // avoid the no-dynamic-lookups test - const scopedRegistries = cfg.keys.filter(_ => /:registry$/.test(_)).map(_ => cfg.get(_)) - perf.emit('time', 'audit compress') - // TODO: registryFetch will be adding native support for `Content-Encoding: gzip` at which point - // we'll pass in something like `gzip: true` and not need to JSON stringify, gzip or headers. - return gzip(JSON.stringify(auditData)).then(body => { - perf.emit('timeEnd', 'audit compress') - log.info('audit', 'Submitting payload of ' + body.length + 'bytes') - scopedRegistries.forEach(reg => { - // we don't care about the response so destroy the stream if we can, or leave it flowing - // so it can eventually finish and clean up after itself - fetchAudit(url.resolve(reg, '/-/npm/v1/security/audits/quick')) - .then(_ => { - _.body.on('error', () => {}) - if (_.body.destroy) { - _.body.destroy() - } else { - _.body.resume() - } - }, _ => {}) - }) - perf.emit('time', 'audit submit') - return fetchAudit('/-/npm/v1/security/audits/quick', body).then(response => { - perf.emit('timeEnd', 'audit submit') - perf.emit('time', 'audit body') - return response.json() - }).then(result => { - perf.emit('timeEnd', 'audit body') - return result - }) + const opts = InstallAuditConfig(npmConfig()) + const scopedRegistries = [...opts.keys()].filter( + k => /:registry$/.test(k) + ).map(k => opts[k]) + scopedRegistries.forEach(registry => { + // we don't care about the response so destroy the stream if we can, or leave it flowing + // so it can eventually finish and clean up after itself + regFetch('/-/npm/v1/security/audits/quick', opts.concat({ + method: 'POST', + registry, + gzip: true, + body: auditData + })).then(_ => { + _.body.on('error', () => {}) + if (_.body.destroy) { + _.body.destroy() + } else { + _.body.resume() + } + }, _ => {}) }) -} - -function submitForFullReport (auditData) { - perf.emit('time', 'audit compress') - // TODO: registryFetch will be adding native support for `Content-Encoding: gzip` at which point - // we'll pass in something like `gzip: true` and not need to JSON stringify, gzip or headers. - return gzip(JSON.stringify(auditData)).then(body => { - perf.emit('timeEnd', 'audit compress') - log.info('audit', 'Submitting payload of ' + body.length + ' bytes') - perf.emit('time', 'audit submit') - return fetchAudit('/-/npm/v1/security/audits', body).then(response => { - perf.emit('timeEnd', 'audit submit') - perf.emit('time', 'audit body') - return response.json() - }).then(result => { - perf.emit('timeEnd', 'audit body') - result.runId = runId - return result - }) + perf.emit('time', 'audit submit') + return regFetch('/-/npm/v1/security/audits/quick', opts.concat({ + method: 'POST', + gzip: true, + body: auditData + })).then(response => { + perf.emit('timeEnd', 'audit submit') + perf.emit('time', 'audit body') + return response.json() + }).then(result => { + perf.emit('timeEnd', 'audit body') + return result }) } -function fetchAudit (href, body) { - const opts = pacoteOpts() - return registryFetch(href, { +function submitForFullReport (auditData) { + perf.emit('time', 'audit submit') + const opts = InstallAuditConfig(npmConfig()) + return regFetch('/-/npm/v1/security/audits', opts.concat({ method: 'POST', - headers: { 'content-encoding': 'gzip', 'content-type': 'application/json' }, - config: npm.config, - npmSession: opts.npmSession, - projectScope: npm.projectScope, - log: log, - body: body + gzip: true, + body: auditData + })).then(response => { + perf.emit('timeEnd', 'audit submit') + perf.emit('time', 'audit body') + return response.json() + }).then(result => { + perf.emit('timeEnd', 'audit body') + result.runId = runId + return result }) } function printInstallReport (auditResult) { + const opts = InstallAuditConfig(npmConfig()) return auditReport(auditResult, { reporter: 'install', - withColor: npm.color, - withUnicode: npm.config.get('unicode') + withColor: opts.color, + withUnicode: opts.unicode }).then(result => output(result.report)) } function printFullReport (auditResult) { + const opts = InstallAuditConfig(npmConfig()) return auditReport(auditResult, { log: output, - reporter: npm.config.get('json') ? 'json' : 'detail', - withColor: npm.color, - withUnicode: npm.config.get('unicode') + reporter: opts.json ? 'json' : 'detail', + withColor: opts.color, + withUnicode: opts.unicode }).then(result => output(result.report)) } function printParseableReport (auditResult) { + const opts = InstallAuditConfig(npmConfig()) return auditReport(auditResult, { log: output, reporter: 'parseable', - withColor: npm.color, - withUnicode: npm.config.get('unicode') + withColor: opts.color, + withUnicode: opts.unicode }).then(result => output(result.report)) } diff --git a/deps/npm/lib/install/is-only-dev.js b/deps/npm/lib/install/is-only-dev.js index ef41e8ad1a2659..2877c61a227d09 100644 --- a/deps/npm/lib/install/is-only-dev.js +++ b/deps/npm/lib/install/is-only-dev.js @@ -28,6 +28,7 @@ function andIsOnlyDev (name, seen) { return isDev && !isProd } else { if (seen.has(req)) return true + seen = new Set(seen) seen.add(req) return isOnlyDev(req, seen) } diff --git a/deps/npm/lib/install/is-only-optional.js b/deps/npm/lib/install/is-only-optional.js index 72d6f065e6745b..f1b731578d9422 100644 --- a/deps/npm/lib/install/is-only-optional.js +++ b/deps/npm/lib/install/is-only-optional.js @@ -10,6 +10,7 @@ function isOptional (node, seen) { if (seen.has(node) || node.requiredBy.length === 0) { return false } + seen = new Set(seen) seen.add(node) const swOptional = node.fromShrinkwrap && node.package._optional return node.requiredBy.every(function (req) { diff --git a/deps/npm/lib/logout.js b/deps/npm/lib/logout.js index a3287d42d16592..411f547210b8f1 100644 --- a/deps/npm/lib/logout.js +++ b/deps/npm/lib/logout.js @@ -1,43 +1,44 @@ -module.exports = logout +'use strict' -var dezalgo = require('dezalgo') -var log = require('npmlog') +const BB = require('bluebird') -var npm = require('./npm.js') -var mapToRegistry = require('./utils/map-to-registry.js') +const eu = encodeURIComponent +const getAuth = require('npm-registry-fetch/auth.js') +const log = require('npmlog') +const npm = require('./npm.js') +const npmConfig = require('./config/figgy-config.js') +const npmFetch = require('libnpm/fetch') logout.usage = 'npm logout [--registry=] [--scope=<@scope>]' -function afterLogout (normalized, cb) { +function afterLogout (normalized) { var scope = npm.config.get('scope') if (scope) npm.config.del(scope + ':registry') npm.config.clearCredentialsByURI(normalized) - npm.config.save('user', cb) + return BB.fromNode(cb => npm.config.save('user', cb)) } +module.exports = logout function logout (args, cb) { - cb = dezalgo(cb) - - mapToRegistry('/', npm.config, function (err, uri, auth, normalized) { - if (err) return cb(err) - + const opts = npmConfig() + BB.try(() => { + const reg = npmFetch.pickRegistry('foo', opts) + const auth = getAuth(reg, opts) if (auth.token) { - log.verbose('logout', 'clearing session token for', normalized) - npm.registry.logout(normalized, { auth: auth }, function (err) { - if (err) return cb(err) - - afterLogout(normalized, cb) - }) + log.verbose('logout', 'clearing session token for', reg) + return npmFetch(`/-/user/token/${eu(auth.token)}`, opts.concat({ + method: 'DELETE', + ignoreBody: true + })).then(() => afterLogout(reg)) } else if (auth.username || auth.password) { - log.verbose('logout', 'clearing user credentials for', normalized) - - afterLogout(normalized, cb) + log.verbose('logout', 'clearing user credentials for', reg) + return afterLogout(reg) } else { - cb(new Error( - 'Not logged in to', normalized + ',', "so can't log out." - )) + throw new Error( + 'Not logged in to', reg + ',', "so can't log out." + ) } - }) + }).nodeify(cb) } diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index da5a3636021223..2ee9a991264c7a 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -40,9 +40,7 @@ var which = require('which') var glob = require('glob') var rimraf = require('rimraf') - var lazyProperty = require('lazy-property') var parseJSON = require('./utils/parse-json.js') - var clientConfig = require('./config/reg-client.js') var aliases = require('./config/cmd-list').aliases var cmdList = require('./config/cmd-list').cmdList var plumbing = require('./config/cmd-list').plumbing @@ -106,7 +104,6 @@ }) var registryRefer - var registryLoaded Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { Object.defineProperty(npm.commands, c, { get: function () { @@ -153,7 +150,7 @@ }).filter(function (arg) { return arg && arg.match }).join(' ') - if (registryLoaded) npm.registry.refer = registryRefer + npm.referer = registryRefer } cmd.apply(npm, args) @@ -357,17 +354,6 @@ npm.projectScope = config.get('scope') || scopeifyScope(getProjectScope(npm.prefix)) - // at this point the configs are all set. - // go ahead and spin up the registry client. - lazyProperty(npm, 'registry', function () { - registryLoaded = true - var RegClient = require('npm-registry-client') - var registry = new RegClient(clientConfig(npm, log, npm.config)) - registry.version = npm.version - registry.refer = registryRefer - return registry - }) - startMetrics() return cb(null, npm) diff --git a/deps/npm/lib/org.js b/deps/npm/lib/org.js new file mode 100644 index 00000000000000..d8f857e3dfdd94 --- /dev/null +++ b/deps/npm/lib/org.js @@ -0,0 +1,151 @@ +'use strict' + +const figgyPudding = require('figgy-pudding') +const liborg = require('libnpm/org') +const npmConfig = require('./config/figgy-config.js') +const output = require('./utils/output.js') +const otplease = require('./utils/otplease.js') +const Table = require('cli-table3') + +module.exports = org + +org.subcommands = ['set', 'rm', 'ls'] + +org.usage = + 'npm org set orgname username [developer | admin | owner]\n' + + 'npm org rm orgname username\n' + + 'npm org ls orgname []' + +const OrgConfig = figgyPudding({ + json: {}, + loglevel: {}, + parseable: {}, + silent: {} +}) + +org.completion = function (opts, cb) { + var argv = opts.conf.argv.remain + if (argv.length === 2) { + return cb(null, org.subcommands) + } + switch (argv[2]) { + case 'ls': + case 'add': + case 'rm': + case 'set': + return cb(null, []) + default: + return cb(new Error(argv[2] + ' not recognized')) + } +} + +function UsageError () { + throw Object.assign(new Error(org.usage), {code: 'EUSAGE'}) +} + +function org ([cmd, orgname, username, role], cb) { + otplease(npmConfig(), opts => { + opts = OrgConfig(opts) + switch (cmd) { + case 'add': + case 'set': + return orgSet(orgname, username, role, opts) + case 'rm': + return orgRm(orgname, username, opts) + case 'ls': + return orgList(orgname, username, opts) + default: + UsageError() + } + }).then( + x => cb(null, x), + err => cb(err.code === 'EUSAGE' ? err.message : err) + ) +} + +function orgSet (org, user, role, opts) { + role = role || 'developer' + if (!org) { + throw new Error('First argument `orgname` is required.') + } + if (!user) { + throw new Error('Second argument `username` is required.') + } + if (!['owner', 'admin', 'developer'].find(x => x === role)) { + throw new Error('Third argument `role` must be one of `owner`, `admin`, or `developer`, with `developer` being the default value if omitted.') + } + return liborg.set(org, user, role, opts).then(memDeets => { + if (opts.json) { + output(JSON.stringify(memDeets, null, 2)) + } else if (opts.parseable) { + output(['org', 'orgsize', 'user', 'role'].join('\t')) + output([ + memDeets.org.name, + memDeets.org.size, + memDeets.user, + memDeets.role + ]) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`Added ${memDeets.user} as ${memDeets.role} to ${memDeets.org.name}. You now ${memDeets.org.size} member${memDeets.org.size === 1 ? '' : 's'} in this org.`) + } + return memDeets + }) +} + +function orgRm (org, user, opts) { + if (!org) { + throw new Error('First argument `orgname` is required.') + } + if (!user) { + throw new Error('Second argument `username` is required.') + } + return liborg.rm(org, user, opts).then(() => { + return liborg.ls(org, opts) + }).then(roster => { + user = user.replace(/^[~@]?/, '') + org = org.replace(/^[~@]?/, '') + const userCount = Object.keys(roster).length + if (opts.json) { + output(JSON.stringify({ + user, + org, + userCount, + deleted: true + })) + } else if (opts.parseable) { + output(['user', 'org', 'userCount', 'deleted'].join('\t')) + output([user, org, userCount, true].join('\t')) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`Successfully removed ${user} from ${org}. You now have ${userCount} member${userCount === 1 ? '' : 's'} in this org.`) + } + }) +} + +function orgList (org, user, opts) { + if (!org) { + throw new Error('First argument `orgname` is required.') + } + return liborg.ls(org, opts).then(roster => { + if (user) { + const newRoster = {} + if (roster[user]) { + newRoster[user] = roster[user] + } + roster = newRoster + } + if (opts.json) { + output(JSON.stringify(roster, null, 2)) + } else if (opts.parseable) { + output(['user', 'role'].join('\t')) + Object.keys(roster).forEach(user => { + output([user, roster[user]].join('\t')) + }) + } else if (!opts.silent && opts.loglevel !== 'silent') { + const table = new Table({head: ['user', 'role']}) + Object.keys(roster).sort().forEach(user => { + table.push([user, roster[user]]) + }) + output(table.toString()) + } + }) +} diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index 024e076c4f9ad4..ebd67fb6b37d5d 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -29,13 +29,15 @@ var color = require('ansicolors') var styles = require('ansistyles') var table = require('text-table') var semver = require('semver') -var npa = require('npm-package-arg') +var npa = require('libnpm/parse-arg') var pickManifest = require('npm-pick-manifest') var fetchPackageMetadata = require('./fetch-package-metadata.js') var mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') var npm = require('./npm.js') +const npmConfig = require('./config/figgy-config.js') +const figgyPudding = require('figgy-pudding') +const packument = require('libnpm/packument') var long = npm.config.get('long') -var mapToRegistry = require('./utils/map-to-registry.js') var isExtraneous = require('./install/is-extraneous.js') var computeMetadata = require('./install/deps.js').computeMetadata var computeVersionSpec = require('./install/deps.js').computeVersionSpec @@ -43,6 +45,23 @@ var moduleName = require('./utils/module-name.js') var output = require('./utils/output.js') var ansiTrim = require('./utils/ansi-trim') +const OutdatedConfig = figgyPudding({ + also: {}, + color: {}, + depth: {}, + dev: 'development', + development: {}, + global: {}, + json: {}, + only: {}, + parseable: {}, + prod: 'production', + production: {}, + save: {}, + 'save-dev': {}, + 'save-optional': {} +}) + function uniq (list) { // we maintain the array because we need an array, not iterator, return // value. @@ -68,26 +87,27 @@ function outdated (args, silent, cb) { cb = silent silent = false } + let opts = OutdatedConfig(npmConfig()) 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) + if (opts.depth) opts = opts.concat({depth: 0}) readPackageTree(dir, andComputeMetadata(function (er, tree) { if (!tree) return cb(er) mutateIntoLogicalTree(tree) - outdated_(args, '', tree, {}, 0, function (er, list) { + outdated_(args, '', tree, {}, 0, opts, 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) - if (npm.config.get('json')) { - output(makeJSON(list)) - } else if (npm.config.get('parseable')) { - output(makeParseable(list)) + if (opts.json) { + output(makeJSON(list, opts)) + } else if (opts.parseable) { + output(makeParseable(list, opts)) } else { - var outList = list.map(makePretty) + var outList = list.map(x => makePretty(x, opts)) var outHead = [ 'Package', 'Current', 'Wanted', @@ -97,7 +117,7 @@ function outdated (args, silent, cb) { if (long) outHead.push('Package Type', 'Homepage') var outTable = [outHead].concat(outList) - if (npm.color) { + if (opts.color) { outTable[0] = outTable[0].map(function (heading) { return styles.underline(heading) }) @@ -116,14 +136,14 @@ function outdated (args, silent, cb) { } // [[ dir, dep, has, want, latest, type ]] -function makePretty (p) { +function makePretty (p, opts) { var depname = p[1] var has = p[2] var want = p[3] var latest = p[4] var type = p[6] var deppath = p[7] - var homepage = p[0].package.homepage + var homepage = p[0].package.homepage || '' var columns = [ depname, has || 'MISSING', @@ -136,7 +156,7 @@ function makePretty (p) { columns[6] = homepage } - if (npm.color) { + if (opts.color) { columns[0] = color[has === want || want === 'linked' ? 'yellow' : 'red'](columns[0]) // dep columns[2] = color.green(columns[2]) // want columns[3] = color.magenta(columns[3]) // latest @@ -167,7 +187,7 @@ function makeParseable (list) { }).join(os.EOL) } -function makeJSON (list) { +function makeJSON (list, opts) { var out = {} list.forEach(function (p) { var dep = p[0] @@ -177,7 +197,7 @@ function makeJSON (list) { var want = p[3] var latest = p[4] var type = p[6] - if (!npm.config.get('global')) { + if (!opts.global) { dir = path.relative(process.cwd(), dir) } out[depname] = { current: has, @@ -193,11 +213,11 @@ function makeJSON (list) { return JSON.stringify(out, null, 2) } -function outdated_ (args, path, tree, parentHas, depth, cb) { +function outdated_ (args, path, tree, parentHas, depth, opts, 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')) { + if (depth > opts.depth) { return cb(null, []) } var types = {} @@ -227,11 +247,14 @@ function outdated_ (args, path, tree, parentHas, depth, cb) { // (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')))) { + var dev = opts.dev || /^dev(elopment)?$/.test(opts.also) + var prod = opts.production || /^prod(uction)?$/.test(opts.only) + if ( + (dev || !prod) && + ( + opts['save-dev'] || (!opts.save && !opts['save-optional']) + ) + ) { Object.keys(tree.missingDevDeps).forEach(function (name) { deps.push({ package: { name: name }, @@ -245,15 +268,15 @@ function outdated_ (args, path, tree, parentHas, depth, cb) { }) } - if (npm.config.get('save-dev')) { + if (opts['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')) { + } else if (opts.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')) { + } else if (opts['save-optional']) { deps = deps.filter(function (dep) { return pkg.optionalDependencies[moduleName(dep)] }) deps.forEach(function (dep) { types[moduleName(dep)] = 'optionalDependencies' @@ -262,7 +285,7 @@ function outdated_ (args, path, tree, parentHas, depth, cb) { var doUpdate = dev || ( !prod && !Object.keys(parentHas).length && - !npm.config.get('global') + !opts.global ) if (doUpdate) { Object.keys(pkg.devDependencies || {}).forEach(function (k) { @@ -300,13 +323,13 @@ function outdated_ (args, path, tree, parentHas, depth, cb) { required = computeVersionSpec(tree, dep) } - if (!long) return shouldUpdate(args, dep, name, has, required, depth, path, cb) + if (!long) return shouldUpdate(args, dep, name, has, required, depth, path, opts, cb) - shouldUpdate(args, dep, name, has, required, depth, path, cb, types[name]) + shouldUpdate(args, dep, name, has, required, depth, path, opts, cb, types[name]) }, cb) } -function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { +function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, opts, 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. @@ -322,6 +345,7 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { tree, has, depth + 1, + opts, cb) } @@ -350,11 +374,9 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { } else if (parsed.type === 'file') { return updateLocalDeps() } else { - return mapToRegistry(dep, npm.config, function (er, uri, auth) { - if (er) return cb(er) - - npm.registry.get(uri, { auth: auth }, updateDeps) - }) + return packument(dep, opts.concat({ + 'prefer-online': true + })).nodeify(updateDeps) } function updateLocalDeps (latestRegistryVersion) { diff --git a/deps/npm/lib/owner.js b/deps/npm/lib/owner.js index 3c2660ace113d5..a64cb5e14ccefb 100644 --- a/deps/npm/lib/owner.js +++ b/deps/npm/lib/owner.js @@ -1,12 +1,17 @@ -/* eslint-disable standard/no-callback-literal */ module.exports = owner -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') -var usage = require('./utils/usage') -var output = require('./utils/output.js') +const BB = require('bluebird') + +const log = require('npmlog') +const npa = require('libnpm/parse-arg') +const npmConfig = require('./config/figgy-config.js') +const npmFetch = require('libnpm/fetch') +const output = require('./utils/output.js') +const otplease = require('./utils/otplease.js') +const packument = require('libnpm/packument') +const readLocalPkg = BB.promisify(require('./utils/read-local-package.js')) +const usage = require('./utils/usage') +const whoami = BB.promisify(require('./whoami.js')) owner.usage = usage( 'owner', @@ -14,8 +19,9 @@ owner.usage = usage( '\nnpm owner rm [<@scope>/]' + '\nnpm owner ls [<@scope>/]' ) + owner.completion = function (opts, cb) { - var argv = opts.conf.argv.remain + const argv = opts.conf.argv.remain if (argv.length > 4) return cb() if (argv.length <= 2) { var subs = ['add', 'rm'] @@ -23,130 +29,109 @@ owner.completion = function (opts, cb) { else subs.push('ls', 'list') return cb(null, subs) } - - npm.commands.whoami([], true, function (er, username) { - if (er) return cb() - - var un = encodeURIComponent(username) - var byUser, theUser - switch (argv[2]) { - 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': - if (argv.length > 3) { - theUser = encodeURIComponent(argv[3]) - 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) { - if (er) return cb(er) - // return the intersection - return cb(null, d[theUser].filter(function (p) { + BB.try(() => { + const opts = npmConfig() + return whoami([], true).then(username => { + const un = encodeURIComponent(username) + let byUser, theUser + switch (argv[2]) { + case 'ls': + // FIXME: there used to be registry completion here, but it stopped + // making sense somewhere around 50,000 packages on the registry + return + case 'rm': + if (argv.length > 3) { + theUser = encodeURIComponent(argv[3]) + byUser = `/-/by-user/${theUser}|${un}` + return npmFetch.json(byUser, opts).then(d => { + return d[theUser].filter( // kludge for server adminery. - return un === 'isaacs' || d[un].indexOf(p) === -1 - })) + p => un === 'isaacs' || d[un].indexOf(p) === -1 + ) }) - }) - } - // else fallthrough - /* eslint no-fallthrough:0 */ - case 'add': - if (argv.length > 3) { - theUser = encodeURIComponent(argv[3]) - 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) { - console.error(uri, er || d) - // return mine that they're not already on. - if (er) return cb(er) + } + // else fallthrough + /* eslint no-fallthrough:0 */ + case 'add': + if (argv.length > 3) { + theUser = encodeURIComponent(argv[3]) + byUser = `/-/by-user/${theUser}|${un}` + return npmFetch.json(byUser, opts).then(d => { var mine = d[un] || [] var theirs = d[theUser] || [] - return cb(null, mine.filter(function (p) { - return theirs.indexOf(p) === -1 - })) + return mine.filter(p => theirs.indexOf(p) === -1) }) - }) - } - // just list all users who aren't me. - return mapToRegistry('-/users', npm.config, function (er, uri, auth) { - if (er) return cb(er) + } else { + // just list all users who aren't me. + return npmFetch.json('/-/users', opts).then(list => { + return Object.keys(list).filter(n => n !== un) + }) + } - 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 - })) - }) - }) + default: + return cb() + } + }) + }).nodeify(cb) +} - default: - return cb() - } - }) +function UsageError () { + throw Object.assign(new Error(owner.usage), {code: 'EUSAGE'}) } -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) - default: return unknown(action, cb) - } +function owner ([action, ...args], cb) { + const opts = npmConfig() + BB.try(() => { + switch (action) { + case 'ls': case 'list': return ls(args[0], opts) + case 'add': return add(args[0], args[1], opts) + case 'rm': case 'remove': return rm(args[0], args[1], opts) + default: UsageError() + } + }).then( + data => cb(null, data), + err => err.code === 'EUSAGE' ? cb(err.message) : cb(err) + ) } -function ls (pkg, cb) { +function ls (pkg, opts) { if (!pkg) { - return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(owner.usage) - ls(pkg, cb) + return readLocalPkg().then(pkg => { + if (!pkg) { UsageError() } + return ls(pkg, opts) }) } - mapToRegistry(pkg, npm.config, function (er, uri, auth) { - if (er) return cb(er) - - npm.registry.get(uri, { auth: auth }, function (er, data) { - var msg = '' - if (er) { - log.error('owner ls', "Couldn't get owner data", pkg) - return cb(er) - } + const spec = npa(pkg) + return packument(spec, opts.concat({fullMetadata: true})).then( + data => { var owners = data.maintainers if (!owners || !owners.length) { - msg = 'admin party!' + output('admin party!') } else { - msg = owners.map(function (o) { - return o.name + ' <' + o.email + '>' - }).join('\n') + output(owners.map(o => `${o.name} <${o.email}>`).join('\n')) } - output(msg) - cb(er, owners) - }) - }) + return owners + }, + err => { + log.error('owner ls', "Couldn't get owner data", pkg) + throw err + } + ) } -function add (user, pkg, cb) { - if (!user) return cb(owner.usage) +function add (user, pkg, opts) { + if (!user) { UsageError() } if (!pkg) { - return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(new Error(owner.usage)) - add(user, pkg, cb) + return readLocalPkg().then(pkg => { + if (!pkg) { UsageError() } + return add(user, pkg, opts) }) } - log.verbose('owner add', '%s to %s', user, pkg) - mutate(pkg, user, function (u, owners) { + + const spec = npa(pkg) + return withMutation(spec, user, opts, (u, owners) => { if (!owners) owners = [] for (var i = 0, l = owners.length; i < l; i++) { var o = owners[i] @@ -160,22 +145,23 @@ function add (user, pkg, cb) { } owners.push(u) return owners - }, cb) + }) } -function rm (user, pkg, cb) { +function rm (user, pkg, opts) { + if (!user) { UsageError() } if (!pkg) { - return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(new Error(owner.usage)) - rm(user, pkg, cb) + return readLocalPkg().then(pkg => { + if (!pkg) { UsageError() } + return add(user, pkg, opts) }) } - log.verbose('owner rm', '%s from %s', user, pkg) - mutate(pkg, user, function (u, owners) { - var found = false - var m = owners.filter(function (o) { + + const spec = npa(pkg) + return withMutation(spec, user, opts, function (u, owners) { + let found = false + const m = owners.filter(function (o) { var match = (o.name === user) found = found || match return !match @@ -187,92 +173,70 @@ function rm (user, pkg, cb) { } if (!m.length) { - return new Error( + throw 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 - mapToRegistry(byUser, npm.config, function (er, uri, auth) { - if (er) return cb(er) - - npm.registry.get(uri, { auth: auth }, mutate_) - }) - } else { - mutate_(null, null) - } +function withMutation (spec, user, opts, mutation) { + return BB.try(() => { + if (user) { + const uri = `/-/user/org.couchdb.user:${encodeURIComponent(user)}` + return npmFetch.json(uri, opts).then(mutate_, err => { + log.error('owner mutate', 'Error getting user data for %s', user) + throw err + }) + } else { + return mutate_(null) + } + }) - function mutate_ (er, u) { - if (!er && user && (!u || u.error)) { - er = new Error( + function mutate_ (u) { + if (user && (!u || u.error)) { + throw 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) - return cb(er) - } - 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) { - if (er) { - log.error('owner mutate', 'Error getting package data for %s', pkg) - return cb(er) - } - - // save the number of maintainers before mutation so that we can figure - // out if maintainers were added or removed - var beforeMutation = data.maintainers.length - - var m = mutation(u, data.maintainers) - if (!m) return cb() // handled - if (m instanceof Error) return cb(m) // error - - data = { - _id: data._id, - _rev: data._rev, - maintainers: m - } - var dataPath = pkg.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 - } - npm.registry.request(uri, params, function (er, data) { - if (!er && data.error) { - er = new Error('Failed to update package metadata: ' + JSON.stringify(data)) - } - - if (er) { - log.error('owner mutate', 'Failed to update package metadata') - } else if (m.length > beforeMutation) { - output('+ %s (%s)', user, pkg) - } else if (m.length < beforeMutation) { - output('- %s (%s)', user, pkg) - } - - cb(er, data) - }) + return packument(spec, opts.concat({ + fullMetadata: true + })).then(data => { + // save the number of maintainers before mutation so that we can figure + // out if maintainers were added or removed + const beforeMutation = data.maintainers.length + + const m = mutation(u, data.maintainers) + if (!m) return // handled + if (m instanceof Error) throw m // error + + data = { + _id: data._id, + _rev: data._rev, + maintainers: m + } + const dataPath = `/${spec.escapedName}/-rev/${encodeURIComponent(data._rev)}` + return otplease(opts, opts => { + const reqOpts = opts.concat({ + method: 'PUT', + body: data, + spec }) + return npmFetch.json(dataPath, reqOpts) + }).then(data => { + if (data.error) { + throw new Error('Failed to update package metadata: ' + JSON.stringify(data)) + } else if (m.length > beforeMutation) { + output('+ %s (%s)', user, spec.name) + } else if (m.length < beforeMutation) { + output('- %s (%s)', user, spec.name) + } + return data }) }) } } - -function unknown (action, cb) { - cb('Usage: \n' + owner.usage) -} diff --git a/deps/npm/lib/pack.js b/deps/npm/lib/pack.js index 3b3f5b7bbc7007..78e5bfd174d7b7 100644 --- a/deps/npm/lib/pack.js +++ b/deps/npm/lib/pack.js @@ -18,9 +18,9 @@ const lifecycle = BB.promisify(require('./utils/lifecycle')) const log = require('npmlog') const move = require('move-concurrently') const npm = require('./npm') +const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output') const pacote = require('pacote') -const pacoteOpts = require('./config/pacote') const path = require('path') const PassThrough = require('stream').PassThrough const pathIsInside = require('path-is-inside') @@ -88,8 +88,8 @@ function pack_ (pkg, dir) { } function packFromPackage (arg, target, filename) { - const opts = pacoteOpts() - return pacote.tarball.toFile(arg, target, pacoteOpts()) + const opts = npmConfig() + return pacote.tarball.toFile(arg, target, opts) .then(() => cacache.tmp.withTmp(npm.tmp, {tmpPrefix: 'unpacking'}, (tmp) => { const tmpTarget = path.join(tmp, filename) return pacote.extract(arg, tmpTarget, opts) diff --git a/deps/npm/lib/ping.js b/deps/npm/lib/ping.js index 13f390397ce18c..3023bab00e9943 100644 --- a/deps/npm/lib/ping.js +++ b/deps/npm/lib/ping.js @@ -1,5 +1,16 @@ -var npm = require('./npm.js') -var output = require('./utils/output.js') +'use strict' + +const npmConfig = require('./config/figgy-config.js') +const fetch = require('libnpm/fetch') +const figgyPudding = require('figgy-pudding') +const log = require('npmlog') +const npm = require('./npm.js') +const output = require('./utils/output.js') + +const PingConfig = figgyPudding({ + json: {}, + registry: {} +}) module.exports = ping @@ -10,18 +21,27 @@ function ping (args, silent, cb) { cb = silent silent = false } - var registry = npm.config.get('registry') - if (!registry) return cb(new Error('no default registry set')) - var auth = npm.config.getCredentialsByURI(registry) - npm.registry.ping(registry, {auth: auth}, function (er, pong, data, res) { - if (!silent) { - if (er) { - output('Ping error: ' + er) - } else { - output('Ping success: ' + JSON.stringify(pong)) + const opts = PingConfig(npmConfig()) + const registry = opts.registry + log.notice('PING', registry) + const start = Date.now() + return fetch('/-/ping?write=true', opts).then( + res => res.json().catch(() => ({})) + ).then(details => { + if (silent) { + } else { + const time = Date.now() - start + log.notice('PONG', `${time / 1000}ms`) + if (npm.config.get('json')) { + output(JSON.stringify({ + registry, + time, + details + }, null, 2)) + } else if (Object.keys(details).length) { + log.notice('PONG', `${JSON.stringify(details, null, 2)}`) } } - cb(er, er ? null : pong, data, res) - }) + }).nodeify(cb) } diff --git a/deps/npm/lib/profile.js b/deps/npm/lib/profile.js index ff01db90f722f4..7ce9cb5cce5df2 100644 --- a/deps/npm/lib/profile.js +++ b/deps/npm/lib/profile.js @@ -1,18 +1,23 @@ 'use strict' -const profile = require('npm-profile') -const npm = require('./npm.js') + +const BB = require('bluebird') + +const ansistyles = require('ansistyles') +const figgyPudding = require('figgy-pudding') +const inspect = require('util').inspect const log = require('npmlog') +const npm = require('./npm.js') +const npmConfig = require('./config/figgy-config.js') +const otplease = require('./utils/otplease.js') const output = require('./utils/output.js') +const profile = require('libnpm/profile') +const pulseTillDone = require('./utils/pulse-till-done.js') +const qrcodeTerminal = require('qrcode-terminal') +const queryString = require('query-string') const qw = require('qw') -const Table = require('cli-table3') -const ansistyles = require('ansistyles') -const Bluebird = require('bluebird') const readUserInfo = require('./utils/read-user-info.js') -const qrcodeTerminal = require('qrcode-terminal') +const Table = require('cli-table3') const url = require('url') -const queryString = require('query-string') -const pulseTillDone = require('./utils/pulse-till-done.js') -const inspect = require('util').inspect module.exports = profileCmd @@ -48,6 +53,13 @@ function withCb (prom, cb) { prom.then((value) => cb(null, value), cb) } +const ProfileOpts = figgyPudding({ + json: {}, + otp: {}, + parseable: {}, + registry: {} +}) + function profileCmd (args, cb) { if (args.length === 0) return cb(new Error(profileCmd.usage)) log.gauge.show('profile') @@ -75,36 +87,13 @@ function profileCmd (args, cb) { } } -function config () { - const conf = { - json: npm.config.get('json'), - parseable: npm.config.get('parseable'), - registry: npm.config.get('registry'), - otp: npm.config.get('otp') - } - const creds = npm.config.getCredentialsByURI(conf.registry) - if (creds.token) { - conf.auth = {token: creds.token} - } else if (creds.username) { - conf.auth = {basic: {username: creds.username, password: creds.password}} - } else if (creds.auth) { - const auth = Buffer.from(creds.auth, 'base64').toString().split(':', 2) - conf.auth = {basic: {username: auth[0], password: auth[1]}} - } else { - conf.auth = {} - } - - if (conf.otp) conf.auth.otp = conf.otp - return conf -} - const knownProfileKeys = qw` name email ${'two-factor auth'} fullname homepage freenode twitter github created updated` function get (args) { const tfa = 'two-factor auth' - const conf = config() + const conf = ProfileOpts(npmConfig()) return pulseTillDone.withPromise(profile.get(conf)).then((info) => { if (!info.cidr_whitelist) delete info.cidr_whitelist if (conf.json) { @@ -150,7 +139,7 @@ const writableProfileKeys = qw` email password fullname homepage freenode twitter github` function set (args) { - const conf = config() + let conf = ProfileOpts(npmConfig()) const prop = (args[0] || '').toLowerCase().trim() let value = args.length > 1 ? args.slice(1).join(' ') : null if (prop !== 'password' && value === null) { @@ -164,7 +153,7 @@ function set (args) { if (writableProfileKeys.indexOf(prop) === -1) { return Promise.reject(Error(`"${prop}" is not a property we can set. Valid properties are: ` + writableProfileKeys.join(', '))) } - return Bluebird.try(() => { + return BB.try(() => { if (prop === 'password') { return readUserInfo.password('Current password: ').then((current) => { return readPasswords().then((newpassword) => { @@ -193,23 +182,18 @@ function set (args) { const newUser = {} writableProfileKeys.forEach((k) => { newUser[k] = user[k] }) newUser[prop] = value - return profile.set(newUser, conf).catch((err) => { - if (err.code !== 'EOTP') throw err - return readUserInfo.otp().then((otp) => { - conf.auth.otp = otp - return profile.set(newUser, conf) + return otplease(conf, conf => profile.set(newUser, conf)) + .then((result) => { + if (conf.json) { + output(JSON.stringify({[prop]: result[prop]}, null, 2)) + } else if (conf.parseable) { + output(prop + '\t' + result[prop]) + } else if (result[prop] != null) { + output('Set', prop, 'to', result[prop]) + } else { + output('Set', prop) + } }) - }).then((result) => { - if (conf.json) { - output(JSON.stringify({[prop]: result[prop]}, null, 2)) - } else if (conf.parseable) { - output(prop + '\t' + result[prop]) - } else if (result[prop] != null) { - output('Set', prop, 'to', result[prop]) - } else { - output('Set', prop) - } - }) })) }) } @@ -225,7 +209,7 @@ function enable2fa (args) { ' auth-only - Require two-factor authentication only when logging in\n' + ' auth-and-writes - Require two-factor authentication when logging in AND when publishing')) } - const conf = config() + const conf = ProfileOpts(npmConfig()) if (conf.json || conf.parseable) { return Promise.reject(new Error( 'Enabling two-factor authentication is an interactive operation and ' + @@ -238,15 +222,18 @@ function enable2fa (args) { } } - return Bluebird.try(() => { + return BB.try(() => { // if they're using legacy auth currently then we have to update them to a // bearer token before continuing. - if (conf.auth.basic) { + const auth = getAuth(conf) + if (auth.basic) { log.info('profile', 'Updating authentication to bearer token') - return profile.login(conf.auth.basic.username, conf.auth.basic.password, conf).then((result) => { + return profile.createToken( + auth.basic.password, false, [], conf + ).then((result) => { if (!result.token) throw new Error('Your registry ' + conf.registry + 'does not seem to support bearer tokens. Bearer tokens are required for two-factor authentication') npm.config.setCredentialsByURI(conf.registry, {token: result.token}) - return Bluebird.fromNode((cb) => npm.config.save('user', cb)) + return BB.fromNode((cb) => npm.config.save('user', cb)) }) } }).then(() => { @@ -295,18 +282,36 @@ function enable2fa (args) { }) } +function getAuth (conf) { + const creds = npm.config.getCredentialsByURI(conf.registry) + let auth + if (creds.token) { + auth = {token: creds.token} + } else if (creds.username) { + auth = {basic: {username: creds.username, password: creds.password}} + } else if (creds.auth) { + const basic = Buffer.from(creds.auth, 'base64').toString().split(':', 2) + auth = {basic: {username: basic[0], password: basic[1]}} + } else { + auth = {} + } + + if (conf.otp) auth.otp = conf.otp + return auth +} + function disable2fa (args) { - const conf = config() + let conf = ProfileOpts(npmConfig()) return pulseTillDone.withPromise(profile.get(conf)).then((info) => { if (!info.tfa || info.tfa.pending) { output('Two factor authentication not enabled.') return } return readUserInfo.password().then((password) => { - return Bluebird.try(() => { - if (conf.auth.otp) return + return BB.try(() => { + if (conf.otp) return return readUserInfo.otp('Enter one-time password from your authenticator: ').then((otp) => { - conf.auth.otp = otp + conf = conf.concat({otp}) }) }).then(() => { log.info('profile', 'disabling tfa') diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js index 25f2134b1b16d6..e81fc1a0574546 100644 --- a/deps/npm/lib/publish.js +++ b/deps/npm/lib/publish.js @@ -3,20 +3,20 @@ const BB = require('bluebird') const cacache = require('cacache') -const createReadStream = require('graceful-fs').createReadStream -const getPublishConfig = require('./utils/get-publish-config.js') +const figgyPudding = require('figgy-pudding') +const libpub = require('libnpm/publish') +const libunpub = require('libnpm/unpublish') const lifecycle = BB.promisify(require('./utils/lifecycle.js')) const log = require('npmlog') -const mapToRegistry = require('./utils/map-to-registry.js') -const npa = require('npm-package-arg') -const npm = require('./npm.js') +const npa = require('libnpm/parse-arg') +const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output.js') +const otplease = require('./utils/otplease.js') const pack = require('./pack') -const pacote = require('pacote') -const pacoteOpts = require('./config/pacote') +const { tarball, extract } = require('libnpm') const path = require('path') +const readFileAsync = BB.promisify(require('graceful-fs').readFile) const readJson = BB.promisify(require('read-package-json')) -const readUserInfo = require('./utils/read-user-info.js') const semver = require('semver') const statAsync = BB.promisify(require('graceful-fs').stat) @@ -31,6 +31,16 @@ publish.completion = function (opts, cb) { return cb() } +const PublishConfig = figgyPudding({ + dryRun: 'dry-run', + 'dry-run': { default: false }, + force: { default: false }, + json: { default: false }, + Promise: { default: () => Promise }, + tag: { default: 'latest' }, + tmp: {} +}) + module.exports = publish function publish (args, isRetry, cb) { if (typeof cb !== 'function') { @@ -42,15 +52,16 @@ function publish (args, isRetry, cb) { log.verbose('publish', args) - const t = npm.config.get('tag').trim() + const opts = PublishConfig(npmConfig()) + const t = opts.tag.trim() if (semver.validRange(t)) { return cb(new Error('Tag name must not be a valid SemVer range: ' + t)) } - return publish_(args[0]) + return publish_(args[0], opts) .then((tarball) => { const silent = log.level === 'silent' - if (!silent && npm.config.get('json')) { + if (!silent && opts.json) { output(JSON.stringify(tarball, null, 2)) } else if (!silent) { output(`+ ${tarball.id}`) @@ -59,7 +70,7 @@ function publish (args, isRetry, cb) { .nodeify(cb) } -function publish_ (arg) { +function publish_ (arg, opts) { return statAsync(arg).then((stat) => { if (stat.isDirectory()) { return stat @@ -69,17 +80,17 @@ function publish_ (arg) { throw err } }).then(() => { - return publishFromDirectory(arg) + return publishFromDirectory(arg, opts) }, (err) => { if (err.code !== 'ENOENT' && err.code !== 'ENOTDIR') { throw err } else { - return publishFromPackage(arg) + return publishFromPackage(arg, opts) } }) } -function publishFromDirectory (arg) { +function publishFromDirectory (arg, opts) { // All this readJson is because any of the given scripts might modify the // package.json in question, so we need to refresh after every step. let contents @@ -90,12 +101,12 @@ function publishFromDirectory (arg) { }).then(() => { return readJson(path.join(arg, 'package.json')) }).then((pkg) => { - return cacache.tmp.withTmp(npm.tmp, {tmpPrefix: 'fromDir'}, (tmpDir) => { + return cacache.tmp.withTmp(opts.tmp, {tmpPrefix: 'fromDir'}, (tmpDir) => { const target = path.join(tmpDir, 'package.tgz') return pack.packDirectory(pkg, arg, target, null, true) .tap((c) => { contents = c }) - .then((c) => !npm.config.get('json') && pack.logContents(c)) - .then(() => upload(arg, pkg, false, target)) + .then((c) => !opts.json && pack.logContents(c)) + .then(() => upload(pkg, false, target, opts)) }) }).then(() => { return readJson(path.join(arg, 'package.json')) @@ -107,121 +118,50 @@ function publishFromDirectory (arg) { .then(() => contents) } -function publishFromPackage (arg) { - return cacache.tmp.withTmp(npm.tmp, {tmpPrefix: 'fromPackage'}, (tmp) => { +function publishFromPackage (arg, opts) { + return cacache.tmp.withTmp(opts.tmp, {tmpPrefix: 'fromPackage'}, tmp => { const extracted = path.join(tmp, 'package') const target = path.join(tmp, 'package.json') - const opts = pacoteOpts() - return pacote.tarball.toFile(arg, target, opts) - .then(() => pacote.extract(arg, extracted, opts)) + return tarball.toFile(arg, target, opts) + .then(() => extract(arg, extracted, opts)) .then(() => readJson(path.join(extracted, 'package.json'))) .then((pkg) => { return BB.resolve(pack.getContents(pkg, target)) - .tap((c) => !npm.config.get('json') && pack.logContents(c)) - .tap(() => upload(arg, pkg, false, target)) + .tap((c) => !opts.json && pack.logContents(c)) + .tap(() => upload(pkg, false, target, opts)) }) }) } -function upload (arg, pkg, isRetry, cached) { - if (!pkg) { - return BB.reject(new Error('no package.json file found')) - } - if (pkg.private) { - return BB.reject(new Error( - 'This package has been marked as private\n' + - "Remove the 'private' field from the package.json to publish it." - )) - } - const mappedConfig = getPublishConfig( - pkg.publishConfig, - npm.config, - npm.registry - ) - const config = mappedConfig.config - const registry = mappedConfig.client - - pkg._npmVersion = npm.version - pkg._nodeVersion = process.versions.node - - delete pkg.modules - - return BB.fromNode((cb) => { - mapToRegistry(pkg.name, config, (err, registryURI, auth, registryBase) => { - if (err) { return cb(err) } - cb(null, [registryURI, auth, registryBase]) - }) - }).spread((registryURI, auth, registryBase) => { - // we just want the base registry URL in this case - log.verbose('publish', 'registryBase', registryBase) - log.silly('publish', 'uploading', cached) - - pkg._npmUser = { - name: auth.username, - email: auth.email - } - - const params = { - metadata: pkg, - body: !npm.config.get('dry-run') && createReadStream(cached), - auth: auth - } - - function closeFile () { - if (!npm.config.get('dry-run')) { - params.body.close() - } - } - - // registry-frontdoor cares about the access level, which is only - // configurable for scoped packages - if (config.get('access')) { - if (!npa(pkg.name).scope && config.get('access') === 'restricted') { - throw new Error("Can't restrict access to unscoped packages.") - } - - params.access = config.get('access') - } - - if (npm.config.get('dry-run')) { - log.verbose('publish', '--dry-run mode enabled. Skipping upload.') - return BB.resolve() - } - - log.showProgress('publish:' + pkg._id) - return BB.fromNode((cb) => { - registry.publish(registryBase, params, cb) - }).catch((err) => { - if ( - err.code === 'EPUBLISHCONFLICT' && - npm.config.get('force') && - !isRetry - ) { - log.warn('publish', 'Forced publish over ' + pkg._id) - return BB.fromNode((cb) => { - npm.commands.unpublish([pkg._id], cb) - }).finally(() => { - // close the file we are trying to upload, we will open it again. - closeFile() - // ignore errors. Use the force. Reach out with your feelings. - return upload(arg, pkg, true, cached).catch(() => { - // but if it fails again, then report the first error. - throw err +function upload (pkg, isRetry, cached, opts) { + if (!opts.dryRun) { + return readFileAsync(cached).then(tarball => { + return otplease(opts, opts => { + return libpub(pkg, tarball, opts) + }).catch(err => { + if ( + err.code === 'EPUBLISHCONFLICT' && + opts.force && + !isRetry + ) { + log.warn('publish', 'Forced publish over ' + pkg._id) + return otplease(opts, opts => libunpub( + npa.resolve(pkg.name, pkg.version), opts + )).finally(() => { + // ignore errors. Use the force. Reach out with your feelings. + return otplease(opts, opts => { + return upload(pkg, true, tarball, opts) + }).catch(() => { + // but if it fails again, then report the first error. + throw err + }) }) - }) - } else { - // close the file we are trying to upload, all attempts to resume will open it again - closeFile() - throw err - } - }) - }).catch((err) => { - if (err.code !== 'EOTP' && !(err.code === 'E401' && /one-time pass/.test(err.message))) throw err - // we prompt on stdout and read answers from stdin, so they need to be ttys. - if (!process.stdin.isTTY || !process.stdout.isTTY) throw err - return readUserInfo.otp().then((otp) => { - npm.config.set('otp', otp) - return upload(arg, pkg, isRetry, cached) + } else { + throw err + } + }) }) - }) + } else { + return opts.Promise.resolve(true) + } } diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js index d5aa81a6a00ebd..b930402aedf953 100644 --- a/deps/npm/lib/repo.js +++ b/deps/npm/lib/repo.js @@ -2,10 +2,10 @@ module.exports = repo repo.usage = 'npm repo []' -var openUrl = require('./utils/open-url') -var hostedGitInfo = require('hosted-git-info') -var url_ = require('url') -var fetchPackageMetadata = require('./fetch-package-metadata.js') +const openUrl = require('./utils/open-url') +const hostedGitInfo = require('hosted-git-info') +const url_ = require('url') +const fetchPackageMetadata = require('./fetch-package-metadata.js') repo.completion = function (opts, cb) { // FIXME: there used to be registry completion here, but it stopped making @@ -14,7 +14,7 @@ repo.completion = function (opts, cb) { } function repo (args, cb) { - var n = args.length ? args[0] : '.' + const n = args.length ? args[0] : '.' fetchPackageMetadata(n, '.', {fullMetadata: true}, function (er, d) { if (er) return cb(er) getUrlAndOpen(d, cb) @@ -22,12 +22,12 @@ function repo (args, cb) { } function getUrlAndOpen (d, cb) { - var r = d.repository + const r = d.repository if (!r) return cb(new Error('no repository')) // XXX remove this when npm@v1.3.10 from node 0.10 is deprecated // from https://github.com/npm/npm-www/issues/418 - var info = hostedGitInfo.fromUrl(r.url) - var url = info ? info.browse() : unknownHostedUrl(r.url) + const info = hostedGitInfo.fromUrl(r.url) + const url = info ? info.browse() : unknownHostedUrl(r.url) if (!url) return cb(new Error('no repository: could not get url')) @@ -36,12 +36,12 @@ function getUrlAndOpen (d, cb) { function unknownHostedUrl (url) { try { - var idx = url.indexOf('@') + const idx = url.indexOf('@') if (idx !== -1) { url = url.slice(idx + 1).replace(/:([^\d]+)/, '/$1') } url = url_.parse(url) - var protocol = url.protocol === 'https:' + const protocol = url.protocol === 'https:' ? 'https:' : 'http:' return protocol + '//' + (url.host || '') + diff --git a/deps/npm/lib/search.js b/deps/npm/lib/search.js index 3987be135c9ae6..3c59f8b43d15bb 100644 --- a/deps/npm/lib/search.js +++ b/deps/npm/lib/search.js @@ -2,14 +2,16 @@ module.exports = exports = search -var npm = require('./npm.js') -var allPackageSearch = require('./search/all-package-search') -var esearch = require('./search/esearch.js') -var formatPackageStream = require('./search/format-package-stream.js') -var usage = require('./utils/usage') -var output = require('./utils/output.js') -var log = require('npmlog') -var ms = require('mississippi') +const npm = require('./npm.js') +const allPackageSearch = require('./search/all-package-search') +const figgyPudding = require('figgy-pudding') +const formatPackageStream = require('./search/format-package-stream.js') +const libSearch = require('libnpm/search') +const log = require('npmlog') +const ms = require('mississippi') +const npmConfig = require('./config/figgy-config.js') +const output = require('./utils/output.js') +const usage = require('./utils/usage') search.usage = usage( 'search', @@ -20,46 +22,50 @@ search.completion = function (opts, cb) { cb(null, []) } +const SearchOpts = figgyPudding({ + description: {}, + exclude: {}, + include: {}, + limit: {}, + log: {}, + staleness: {}, + unicode: {} +}) + function search (args, cb) { - var searchOpts = { + const opts = SearchOpts(npmConfig()).concat({ description: npm.config.get('description'), exclude: prepareExcludes(npm.config.get('searchexclude')), include: prepareIncludes(args, npm.config.get('searchopts')), - limit: npm.config.get('searchlimit'), + limit: npm.config.get('searchlimit') || 20, log: log, staleness: npm.config.get('searchstaleness'), unicode: npm.config.get('unicode') - } - - if (searchOpts.include.length === 0) { + }) + if (opts.include.length === 0) { return cb(new Error('search must be called with arguments')) } // Used later to figure out whether we had any packages go out - var anyOutput = false + let anyOutput = false - var entriesStream = ms.through.obj() + const entriesStream = ms.through.obj() - var esearchWritten = false - esearch(searchOpts).on('data', function (pkg) { + let esearchWritten = false + libSearch.stream(opts.include, opts).on('data', pkg => { entriesStream.write(pkg) !esearchWritten && (esearchWritten = true) - }).on('error', function (e) { + }).on('error', err => { if (esearchWritten) { // If esearch errored after already starting output, we can't fall back. - return entriesStream.emit('error', e) + return entriesStream.emit('error', err) } log.warn('search', 'fast search endpoint errored. Using old search.') - allPackageSearch(searchOpts).on('data', function (pkg) { - entriesStream.write(pkg) - }).on('error', function (e) { - entriesStream.emit('error', e) - }).on('end', function () { - entriesStream.end() - }) - }).on('end', function () { - entriesStream.end() - }) + allPackageSearch(opts) + .on('data', pkg => entriesStream.write(pkg)) + .on('error', err => entriesStream.emit('error', err)) + .on('end', () => entriesStream.end()) + }).on('end', () => entriesStream.end()) // Grab a configured output stream that will spit out packages in the // desired format. @@ -71,14 +77,14 @@ function search (args, cb) { parseable: npm.config.get('parseable'), color: npm.color }) - outputStream.on('data', function (chunk) { + outputStream.on('data', chunk => { if (!anyOutput) { anyOutput = true } output(chunk.toString('utf8')) }) log.silly('search', 'searching packages') - ms.pipe(entriesStream, outputStream, function (er) { - if (er) return cb(er) + ms.pipe(entriesStream, outputStream, err => { + if (err) return cb(err) if (!anyOutput && !npm.config.get('json') && !npm.config.get('parseable')) { output('No matches found for ' + (args.map(JSON.stringify).join(' '))) } diff --git a/deps/npm/lib/search/all-package-metadata.js b/deps/npm/lib/search/all-package-metadata.js index 5a27bdbcee658e..5883def5c72e3e 100644 --- a/deps/npm/lib/search/all-package-metadata.js +++ b/deps/npm/lib/search/all-package-metadata.js @@ -1,21 +1,28 @@ 'use strict' -var fs = require('graceful-fs') -var path = require('path') -var mkdir = require('mkdirp') -var chownr = require('chownr') -var npm = require('../npm.js') -var log = require('npmlog') -var cacheFile = require('npm-cache-filename') -var correctMkdir = require('../utils/correct-mkdir.js') -var mapToRegistry = require('../utils/map-to-registry.js') -var jsonstream = require('JSONStream') -var writeStreamAtomic = require('fs-write-stream-atomic') -var ms = require('mississippi') -var sortedUnionStream = require('sorted-union-stream') -var once = require('once') -var gunzip = require('../utils/gunzip-maybe') +const BB = require('bluebird') +const cacheFile = require('npm-cache-filename') +const chownr = BB.promisify(require('chownr')) +const correctMkdir = BB.promisify(require('../utils/correct-mkdir.js')) +const figgyPudding = require('figgy-pudding') +const fs = require('graceful-fs') +const JSONStream = require('JSONStream') +const log = require('npmlog') +const mkdir = BB.promisify(require('mkdirp')) +const ms = require('mississippi') +const npmFetch = require('libnpm/fetch') +const path = require('path') +const sortedUnionStream = require('sorted-union-stream') +const url = require('url') +const writeStreamAtomic = require('fs-write-stream-atomic') + +const statAsync = BB.promisify(fs.stat) + +const APMOpts = figgyPudding({ + cache: {}, + registry: {} +}) // Returns a sorted stream of all package metadata. Internally, takes care of // maintaining its metadata cache and making partial or full remote requests, // according to staleness, validity, etc. @@ -27,63 +34,70 @@ var gunzip = require('../utils/gunzip-maybe') // 4. It must include all entries that exist in the metadata endpoint as of // the value in `_updated` module.exports = allPackageMetadata -function allPackageMetadata (staleness) { - var stream = ms.through.obj() - - mapToRegistry('-/all', npm.config, function (er, uri, auth) { - if (er) return stream.emit('error', er) - - var cacheBase = cacheFile(npm.config.get('cache'))(uri) - var cachePath = path.join(cacheBase, '.cache.json') +function allPackageMetadata (opts) { + const staleness = opts.staleness + const stream = ms.through.obj() - createEntryStream(cachePath, uri, auth, staleness, function (err, entryStream, latest, newEntries) { - if (err) return stream.emit('error', err) - log.silly('all-package-metadata', 'entry stream created') - if (entryStream && newEntries) { - createCacheWriteStream(cachePath, latest, function (err, writeStream) { - if (err) return stream.emit('error', err) - log.silly('all-package-metadata', 'output stream created') - ms.pipeline.obj(entryStream, writeStream, stream) - }) - } else if (entryStream) { - ms.pipeline.obj(entryStream, stream) - } else { - stream.emit('error', new Error('No search sources available')) - } - }) - }) + opts = APMOpts(opts) + const cacheBase = cacheFile(path.resolve(path.dirname(opts.cache)))(url.resolve(opts.registry, '/-/all')) + const cachePath = path.join(cacheBase, '.cache.json') + createEntryStream( + cachePath, staleness, opts + ).then(({entryStream, latest, newEntries}) => { + log.silly('all-package-metadata', 'entry stream created') + if (entryStream && newEntries) { + return createCacheWriteStream(cachePath, latest, opts).then(writer => { + log.silly('all-package-metadata', 'output stream created') + ms.pipeline.obj(entryStream, writer, stream) + }) + } else if (entryStream) { + ms.pipeline.obj(entryStream, stream) + } else { + stream.emit('error', new Error('No search sources available')) + } + }).catch(err => stream.emit('error', err)) return stream } // Creates a stream of the latest available package metadata. // Metadata will come from a combination of the local cache and remote data. module.exports._createEntryStream = createEntryStream -function createEntryStream (cachePath, uri, auth, staleness, cb) { - createCacheEntryStream(cachePath, function (err, cacheStream, cacheLatest) { +function createEntryStream (cachePath, staleness, opts) { + return createCacheEntryStream( + cachePath, opts + ).catch(err => { + log.warn('', 'Failed to read search cache. Rebuilding') + log.silly('all-package-metadata', 'cache read error: ', err) + return {} + }).then(({ + updateStream: cacheStream, + updatedLatest: cacheLatest + }) => { cacheLatest = cacheLatest || 0 - if (err) { - log.warn('', 'Failed to read search cache. Rebuilding') - log.silly('all-package-metadata', 'cache read error: ', err) - } - createEntryUpdateStream(uri, auth, staleness, cacheLatest, function (err, updateStream, updatedLatest) { + return createEntryUpdateStream(staleness, cacheLatest, opts).catch(err => { + log.warn('', 'Search data request failed, search might be stale') + log.silly('all-package-metadata', 'update request error: ', err) + return {} + }).then(({updateStream, updatedLatest}) => { updatedLatest = updatedLatest || 0 - var latest = updatedLatest || cacheLatest + const latest = updatedLatest || cacheLatest if (!cacheStream && !updateStream) { - return cb(new Error('No search sources available')) - } - if (err) { - log.warn('', 'Search data request failed, search might be stale') - log.silly('all-package-metadata', 'update request error: ', err) + throw new Error('No search sources available') } if (cacheStream && updateStream) { // Deduped, unioned, sorted stream from the combination of both. - cb(null, - createMergedStream(cacheStream, updateStream), + return { + entryStream: createMergedStream(cacheStream, updateStream), latest, - !!updatedLatest) + newEntries: !!updatedLatest + } } else { // Either one works if one or the other failed - cb(null, cacheStream || updateStream, latest, !!updatedLatest) + return { + entryStream: cacheStream || updateStream, + latest, + newEntries: !!updatedLatest + } } }) }) @@ -96,66 +110,51 @@ function createEntryStream (cachePath, uri, auth, staleness, cb) { module.exports._createMergedStream = createMergedStream function createMergedStream (a, b) { linkStreams(a, b) - return sortedUnionStream(b, a, function (pkg) { return pkg.name }) + return sortedUnionStream(b, a, ({name}) => name) } // Reads the local index and returns a stream that spits out package data. module.exports._createCacheEntryStream = createCacheEntryStream -function createCacheEntryStream (cacheFile, cb) { +function createCacheEntryStream (cacheFile, opts) { log.verbose('all-package-metadata', 'creating entry stream from local cache') log.verbose('all-package-metadata', cacheFile) - fs.stat(cacheFile, function (err, stat) { - if (err) return cb(err) + return statAsync(cacheFile).then(stat => { // TODO - This isn't very helpful if `cacheFile` is empty or just `{}` - var entryStream = ms.pipeline.obj( + const entryStream = ms.pipeline.obj( fs.createReadStream(cacheFile), - jsonstream.parse('*'), + JSONStream.parse('*'), // I believe this passthrough is necessary cause `jsonstream` returns // weird custom streams that behave funny sometimes. ms.through.obj() ) - extractUpdated(entryStream, 'cached-entry-stream', cb) + return extractUpdated(entryStream, 'cached-entry-stream', opts) }) } // Stream of entry updates from the server. If `latest` is `0`, streams the // entire metadata object from the registry. module.exports._createEntryUpdateStream = createEntryUpdateStream -function createEntryUpdateStream (all, auth, staleness, latest, cb) { +function createEntryUpdateStream (staleness, latest, opts) { log.verbose('all-package-metadata', 'creating remote entry stream') - var params = { - timeout: 600, - follow: true, - staleOk: true, - auth: auth, - streaming: true - } - var partialUpdate = false + let partialUpdate = false + let uri = '/-/all' if (latest && (Date.now() - latest < (staleness * 1000))) { // Skip the request altogether if our `latest` isn't stale. log.verbose('all-package-metadata', 'Local data up to date, skipping update') - return cb(null) + return BB.resolve({}) } else if (latest === 0) { log.warn('', 'Building the local index for the first time, please be patient') log.verbose('all-package-metadata', 'No cached data: requesting full metadata db') } else { log.verbose('all-package-metadata', 'Cached data present with timestamp:', latest, 'requesting partial index update') - all += '/since?stale=update_after&startkey=' + latest + uri += '/since?stale=update_after&startkey=' + latest partialUpdate = true } - npm.registry.request(all, params, function (er, res) { - if (er) return cb(er) + return npmFetch(uri, opts).then(res => { log.silly('all-package-metadata', 'request stream opened, code:', res.statusCode) - // NOTE - The stream returned by `request` seems to be very persnickety - // and this is almost a magic incantation to get it to work. - // Modify how `res` is used here at your own risk. - var entryStream = ms.pipeline.obj( - res, - ms.through(function (chunk, enc, cb) { - cb(null, chunk) - }), - gunzip(), - jsonstream.parse('*', function (pkg, key) { + let entryStream = ms.pipeline.obj( + res.body, + JSONStream.parse('*', (pkg, key) => { if (key[0] === '_updated' || key[0][0] !== '_') { return pkg } @@ -164,9 +163,12 @@ function createEntryUpdateStream (all, auth, staleness, latest, cb) { if (partialUpdate) { // The `/all/since` endpoint doesn't return `_updated`, so we // just use the request's own timestamp. - cb(null, entryStream, Date.parse(res.headers.date)) + return { + updateStream: entryStream, + updatedLatest: Date.parse(res.headers.get('date')) + } } else { - extractUpdated(entryStream, 'entry-update-stream', cb) + return extractUpdated(entryStream, 'entry-update-stream', opts) } }) } @@ -175,36 +177,37 @@ function createEntryUpdateStream (all, auth, staleness, latest, cb) { // first returned entries. This is the "latest" unix timestamp for the metadata // in question. This code does a bit of juggling with the data streams // so that we can pretend that field doesn't exist, but still extract `latest` -function extractUpdated (entryStream, label, cb) { - cb = once(cb) +function extractUpdated (entryStream, label, opts) { log.silly('all-package-metadata', 'extracting latest') - function nope (msg) { - return function () { - log.warn('all-package-metadata', label, msg) - entryStream.removeAllListeners() - entryStream.destroy() - cb(new Error(msg)) - } - } - var onErr = nope('Failed to read stream') - var onEnd = nope('Empty or invalid stream') - entryStream.on('error', onErr) - entryStream.on('end', onEnd) - entryStream.once('data', function (latest) { - log.silly('all-package-metadata', 'got first stream entry for', label, latest) - entryStream.removeListener('error', onErr) - entryStream.removeListener('end', onEnd) - // Because `.once()` unpauses the stream, we re-pause it after the first - // entry so we don't vomit entries into the void. - entryStream.pause() - if (typeof latest === 'number') { - // The extra pipeline is to return a stream that will implicitly unpause - // after having an `.on('data')` listener attached, since using this - // `data` event broke its initial state. - cb(null, ms.pipeline.obj(entryStream, ms.through.obj()), latest) - } else { - cb(new Error('expected first entry to be _updated')) + return new BB((resolve, reject) => { + function nope (msg) { + return function () { + log.warn('all-package-metadata', label, msg) + entryStream.removeAllListeners() + entryStream.destroy() + reject(new Error(msg)) + } } + const onErr = nope('Failed to read stream') + const onEnd = nope('Empty or invalid stream') + entryStream.on('error', onErr) + entryStream.on('end', onEnd) + entryStream.once('data', latest => { + log.silly('all-package-metadata', 'got first stream entry for', label, latest) + entryStream.removeListener('error', onErr) + entryStream.removeListener('end', onEnd) + if (typeof latest === 'number') { + // The extra pipeline is to return a stream that will implicitly unpause + // after having an `.on('data')` listener attached, since using this + // `data` event broke its initial state. + resolve({ + updateStream: entryStream.pipe(ms.through.obj()), + updatedLatest: latest + }) + } else { + reject(new Error('expected first entry to be _updated')) + } + }) }) } @@ -213,44 +216,43 @@ function extractUpdated (entryStream, label, cb) { // The stream is also passthrough, so entries going through it will also // be output from it. module.exports._createCacheWriteStream = createCacheWriteStream -function createCacheWriteStream (cacheFile, latest, cb) { - _ensureCacheDirExists(cacheFile, function (err) { - if (err) return cb(err) +function createCacheWriteStream (cacheFile, latest, opts) { + return _ensureCacheDirExists(cacheFile, opts).then(() => { log.silly('all-package-metadata', 'creating output stream') - var outStream = _createCacheOutStream() - var cacheFileStream = writeStreamAtomic(cacheFile) - var inputStream = _createCacheInStream(cacheFileStream, outStream, latest) + const outStream = _createCacheOutStream() + const cacheFileStream = writeStreamAtomic(cacheFile) + const inputStream = _createCacheInStream( + cacheFileStream, outStream, latest + ) // Glue together the various streams so they fail together. // `cacheFileStream` errors are already handled by the `inputStream` // pipeline - var errEmitted = false - linkStreams(inputStream, outStream, function () { errEmitted = true }) + let errEmitted = false + linkStreams(inputStream, outStream, () => { errEmitted = true }) - cacheFileStream.on('close', function () { !errEmitted && outStream.end() }) + cacheFileStream.on('close', () => !errEmitted && outStream.end()) - cb(null, ms.duplex.obj(inputStream, outStream)) + return ms.duplex.obj(inputStream, outStream) }) } -function _ensureCacheDirExists (cacheFile, cb) { +function _ensureCacheDirExists (cacheFile, opts) { var cacheBase = path.dirname(cacheFile) log.silly('all-package-metadata', 'making sure cache dir exists at', cacheBase) - correctMkdir(npm.cache, function (er, st) { - if (er) return cb(er) - mkdir(cacheBase, function (er, made) { - if (er) return cb(er) - chownr(made || cacheBase, st.uid, st.gid, cb) + return correctMkdir(opts.cache).then(st => { + return mkdir(cacheBase).then(made => { + return chownr(made || cacheBase, st.uid, st.gid) }) }) } function _createCacheOutStream () { + // NOTE: this looks goofy, but it's necessary in order to get + // JSONStream to play nice with the rest of everything. return ms.pipeline.obj( - // These two passthrough `through` streams compensate for some - // odd behavior with `jsonstream`. ms.through(), - jsonstream.parse('*', function (obj, key) { + JSONStream.parse('*', (obj, key) => { // This stream happens to get _updated passed through it, for // implementation reasons. We make sure to filter it out cause // the fact that it comes t @@ -263,9 +265,9 @@ function _createCacheOutStream () { } function _createCacheInStream (writer, outStream, latest) { - var updatedWritten = false - var inStream = ms.pipeline.obj( - ms.through.obj(function (pkg, enc, cb) { + let updatedWritten = false + const inStream = ms.pipeline.obj( + ms.through.obj((pkg, enc, cb) => { if (!updatedWritten && typeof pkg === 'number') { // This is the `_updated` value getting sent through. updatedWritten = true @@ -277,13 +279,11 @@ function _createCacheInStream (writer, outStream, latest) { cb(null, [pkg.name, pkg]) } }), - jsonstream.stringifyObject('{', ',', '}'), - ms.through(function (chunk, enc, cb) { + JSONStream.stringifyObject('{', ',', '}'), + ms.through((chunk, enc, cb) => { // This tees off the buffer data to `outStream`, and then continues // the pipeline as usual - outStream.write(chunk, enc, function () { - cb(null, chunk) - }) + outStream.write(chunk, enc, () => cb(null, chunk)) }), // And finally, we write to the cache file. writer @@ -300,14 +300,14 @@ function linkStreams (a, b, cb) { if (err !== lastError) { lastError = err b.emit('error', err) - cb(err) + cb && cb(err) } }) b.on('error', function (err) { if (err !== lastError) { lastError = err a.emit('error', err) - cb(err) + cb && cb(err) } }) } diff --git a/deps/npm/lib/search/all-package-search.js b/deps/npm/lib/search/all-package-search.js index 7a893d517b82cd..fef343bcbc3ba3 100644 --- a/deps/npm/lib/search/all-package-search.js +++ b/deps/npm/lib/search/all-package-search.js @@ -8,7 +8,7 @@ function allPackageSearch (opts) { // Get a stream with *all* the packages. This takes care of dealing // with the local cache as well, but that's an internal detail. - var allEntriesStream = allPackageMetadata(opts.staleness) + var allEntriesStream = allPackageMetadata(opts) // Grab a stream that filters those packages according to given params. var filterStream = streamFilter(function (pkg) { diff --git a/deps/npm/lib/search/esearch.js b/deps/npm/lib/search/esearch.js deleted file mode 100644 index f4beb7ade66b18..00000000000000 --- a/deps/npm/lib/search/esearch.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' - -var npm = require('../npm.js') -var log = require('npmlog') -var mapToRegistry = require('../utils/map-to-registry.js') -var jsonstream = require('JSONStream') -var ms = require('mississippi') -var gunzip = require('../utils/gunzip-maybe') - -module.exports = esearch - -function esearch (opts) { - var stream = ms.through.obj() - - mapToRegistry('-/v1/search', npm.config, function (er, uri, auth) { - if (er) return stream.emit('error', er) - createResultStream(uri, auth, opts, function (err, resultStream) { - if (err) return stream.emit('error', err) - ms.pipeline.obj(resultStream, stream) - }) - }) - return stream -} - -function createResultStream (uri, auth, opts, cb) { - log.verbose('esearch', 'creating remote entry stream') - var params = { - timeout: 600, - follow: true, - staleOk: true, - auth: auth, - streaming: true - } - var q = buildQuery(opts) - npm.registry.request(uri + '?text=' + encodeURIComponent(q) + '&size=' + opts.limit, params, function (err, res) { - if (err) return cb(err) - log.silly('esearch', 'request stream opened, code:', res.statusCode) - // NOTE - The stream returned by `request` seems to be very persnickety - // and this is almost a magic incantation to get it to work. - // Modify how `res` is used here at your own risk. - var entryStream = ms.pipeline.obj( - res, - ms.through(function (chunk, enc, cb) { - cb(null, chunk) - }), - gunzip(), - jsonstream.parse('objects.*.package', function (data) { - return { - name: data.name, - description: data.description, - maintainers: data.maintainers, - keywords: data.keywords, - version: data.version, - date: data.date ? new Date(data.date) : null - } - }) - ) - return cb(null, entryStream) - }) -} - -function buildQuery (opts) { - return opts.include.join(' ') -} diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index 90a4426523cabc..dbb12b5bd4fba4 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -167,6 +167,8 @@ function childVersion (top, child, req) { function childRequested (top, child, requested) { if (requested.type === 'directory' || requested.type === 'file') { return 'file:' + unixFormatPath(path.relative(top.path, child.package._resolved || requested.fetchSpec)) + } else if (requested.type === 'git' && child.package._from) { + return child.package._from } else if (!isRegistry(requested) && !child.fromBundle) { return child.package._resolved || requested.saveSpec || requested.rawSpec } else if (requested.type === 'tag') { diff --git a/deps/npm/lib/star.js b/deps/npm/lib/star.js index f19cb4b07bebb9..44a762b15c0c03 100644 --- a/deps/npm/lib/star.js +++ b/deps/npm/lib/star.js @@ -1,11 +1,20 @@ -module.exports = star +'use strict' + +const BB = require('bluebird') + +const fetch = require('libnpm/fetch') +const figgyPudding = require('figgy-pudding') +const log = require('npmlog') +const npa = require('libnpm/parse-arg') +const npm = require('./npm.js') +const npmConfig = require('./config/figgy-config.js') +const output = require('./utils/output.js') +const usage = require('./utils/usage.js') +const whoami = require('./whoami.js') -var npm = require('./npm.js') -var log = require('npmlog') -var asyncMap = require('slide').asyncMap -var mapToRegistry = require('./utils/map-to-registry.js') -var usage = require('./utils/usage') -var output = require('./utils/output.js') +const StarConfig = figgyPudding({ + 'unicode': {} +}) star.usage = usage( 'star', @@ -19,27 +28,50 @@ star.completion = function (opts, cb) { cb() } +module.exports = star function star (args, cb) { - if (!args.length) return cb(star.usage) - 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) + const opts = StarConfig(npmConfig()) + return BB.try(() => { + if (!args.length) throw new Error(star.usage) + let s = opts.unicode ? '\u2605 ' : '(*)' + const u = opts.unicode ? '\u2606 ' : '( )' + const using = !(npm.command.match(/^un/)) + if (!using) s = u + return BB.map(args.map(npa), pkg => { + return BB.all([ + whoami([pkg], true, () => {}), + fetch.json(pkg.escapedName, opts.concat({ + spec: pkg, + query: {write: true}, + 'prefer-online': true + })) + ]).then(([username, fullData]) => { + if (!username) { throw new Error('You need to be logged in!') } + const body = { + _id: fullData._id, + _rev: fullData._rev, + users: fullData.users || {} + } - var params = { - starred: using, - auth: auth - } - npm.registry.star(uri, params, function (er, data, raw, req) { - if (!er) { - output(s + ' ' + pkg) - log.verbose('star', data) + if (using) { + log.info('star', 'starring', body._id) + body.users[username] = true + log.verbose('star', 'starring', body) + } else { + delete body.users[username] + log.info('star', 'unstarring', body._id) + log.verbose('star', 'unstarring', body) } - cb(er, data, raw, req) + return fetch.json(pkg.escapedName, opts.concat({ + spec: pkg, + method: 'PUT', + body + })) + }).then(data => { + output(s + ' ' + pkg.name) + log.verbose('star', data) + return data }) }) - }, cb) + }).nodeify(cb) } diff --git a/deps/npm/lib/stars.js b/deps/npm/lib/stars.js index 4771079356a174..ea3581f1d4b444 100644 --- a/deps/npm/lib/stars.js +++ b/deps/npm/lib/stars.js @@ -1,47 +1,37 @@ -module.exports = stars - -stars.usage = 'npm stars []' - -var npm = require('./npm.js') -var log = require('npmlog') -var mapToRegistry = require('./utils/map-to-registry.js') -var output = require('./utils/output.js') +'use strict' -function stars (args, cb) { - npm.commands.whoami([], true, function (er, username) { - var name = args.length === 1 ? args[0] : username +const BB = require('bluebird') - if (er) { - if (er.code === 'ENEEDAUTH' && !name) { - var needAuth = new Error("'npm stars' on your own user account requires auth") - needAuth.code = 'ENEEDAUTH' - return cb(needAuth) - } - - if (er.code !== 'ENEEDAUTH') return cb(er) - } +const npmConfig = require('./config/figgy-config.js') +const fetch = require('libnpm/fetch') +const log = require('npmlog') +const output = require('./utils/output.js') +const whoami = require('./whoami.js') - mapToRegistry('', npm.config, function (er, uri, auth) { - if (er) return cb(er) +stars.usage = 'npm stars []' - var params = { - username: name, - auth: auth +module.exports = stars +function stars ([user], cb) { + const opts = npmConfig() + return BB.try(() => { + return (user ? BB.resolve(user) : whoami([], true, () => {})).then(usr => { + return fetch.json('/-/_view/starredByUser', opts.concat({ + query: {key: `"${usr}"`} // WHY. WHY THE ""?! + })) + }).then(data => data.rows).then(stars => { + if (stars.length === 0) { + log.warn('stars', 'user has not starred any packages.') + } else { + stars.forEach(s => output(s.value)) } - npm.registry.stars(uri, params, showstars) }) - }) - - function showstars (er, data) { - if (er) return cb(er) - - if (data.rows.length === 0) { - log.warn('stars', 'user has not starred any packages.') - } else { - data.rows.forEach(function (a) { - output(a.value) + }).catch(err => { + if (err.code === 'ENEEDAUTH') { + throw Object.assign(new Error("'npm starts' on your own user account requires auth"), { + code: 'ENEEDAUTH' }) + } else { + throw err } - cb() - } + }).nodeify(cb) } diff --git a/deps/npm/lib/team.js b/deps/npm/lib/team.js index 2d9e61cd4384b6..2b56e3b14f95bb 100644 --- a/deps/npm/lib/team.js +++ b/deps/npm/lib/team.js @@ -1,19 +1,37 @@ /* eslint-disable standard/no-callback-literal */ -var mapToRegistry = require('./utils/map-to-registry.js') -var npm = require('./npm') -var output = require('./utils/output.js') + +const columns = require('cli-columns') +const figgyPudding = require('figgy-pudding') +const libteam = require('libnpm/team') +const npmConfig = require('./config/figgy-config.js') +const output = require('./utils/output.js') +const otplease = require('./utils/otplease.js') +const usage = require('./utils/usage') module.exports = team team.subcommands = ['create', 'destroy', 'add', 'rm', 'ls', 'edit'] -team.usage = +team.usage = usage( + 'team', 'npm team create \n' + 'npm team destroy \n' + 'npm team add \n' + 'npm team rm \n' + 'npm team ls |\n' + 'npm team edit ' +) + +const TeamConfig = figgyPudding({ + json: {}, + loglevel: {}, + parseable: {}, + silent: {} +}) + +function UsageError () { + throw Object.assign(new Error(team.usage), {code: 'EUSAGE'}) +} team.completion = function (opts, cb) { var argv = opts.conf.argv.remain @@ -33,24 +51,121 @@ team.completion = function (opts, cb) { } } -function team (args, cb) { +function team ([cmd, entity = '', user = ''], cb) { // Entities are in the format : - var cmd = args.shift() - var entity = (args.shift() || '').split(':') - return mapToRegistry('/', npm.config, function (err, uri, auth) { - if (err) { return cb(err) } - try { - return npm.registry.team(cmd, uri, { - auth: auth, - scope: entity[0].replace(/^@/, ''), // '@' prefix on scope is optional. - team: entity[1], - user: args.shift() - }, function (err, data) { - !err && data && output(JSON.stringify(data, undefined, 2)) - cb(err, data) - }) - } catch (e) { - cb(e.message + '\n\nUsage:\n' + team.usage) + otplease(npmConfig(), opts => { + opts = TeamConfig(opts).concat({description: null}) + entity = entity.replace(/^@/, '') + switch (cmd) { + case 'create': return teamCreate(entity, opts) + case 'destroy': return teamDestroy(entity, opts) + case 'add': return teamAdd(entity, user, opts) + case 'rm': return teamRm(entity, user, opts) + case 'ls': { + const match = entity.match(/[^:]+:.+/) + if (match) { + return teamListUsers(entity, opts) + } else { + return teamListTeams(entity, opts) + } + } + case 'edit': + throw new Error('`npm team edit` is not implemented yet.') + default: + UsageError() + } + }).then( + data => cb(null, data), + err => err.code === 'EUSAGE' ? cb(err.message) : cb(err) + ) +} + +function teamCreate (entity, opts) { + return libteam.create(entity, opts).then(() => { + if (opts.json) { + output(JSON.stringify({ + created: true, + team: entity + })) + } else if (opts.parseable) { + output(`${entity}\tcreated`) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`+@${entity}`) + } + }) +} + +function teamDestroy (entity, opts) { + return libteam.destroy(entity, opts).then(() => { + if (opts.json) { + output(JSON.stringify({ + deleted: true, + team: entity + })) + } else if (opts.parseable) { + output(`${entity}\tdeleted`) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`-@${entity}`) + } + }) +} + +function teamAdd (entity, user, opts) { + return libteam.add(user, entity, opts).then(() => { + if (opts.json) { + output(JSON.stringify({ + added: true, + team: entity, + user + })) + } else if (opts.parseable) { + output(`${user}\t${entity}\tadded`) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`${user} added to @${entity}`) + } + }) +} + +function teamRm (entity, user, opts) { + return libteam.rm(user, entity, opts).then(() => { + if (opts.json) { + output(JSON.stringify({ + removed: true, + team: entity, + user + })) + } else if (opts.parseable) { + output(`${user}\t${entity}\tremoved`) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`${user} removed from @${entity}`) + } + }) +} + +function teamListUsers (entity, opts) { + return libteam.lsUsers(entity, opts).then(users => { + users = users.sort() + if (opts.json) { + output(JSON.stringify(users, null, 2)) + } else if (opts.parseable) { + output(users.join('\n')) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`\n@${entity} has ${users.length} user${users.length === 1 ? '' : 's'}:\n`) + output(columns(users, {padding: 1})) + } + }) +} + +function teamListTeams (entity, opts) { + return libteam.lsTeams(entity, opts).then(teams => { + teams = teams.sort() + if (opts.json) { + output(JSON.stringify(teams, null, 2)) + } else if (opts.parseable) { + output(teams.join('\n')) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`\n@${entity} has ${teams.length} team${teams.length === 1 ? '' : 's'}:\n`) + output(columns(teams.map(t => `@${t}`), {padding: 1})) } }) } diff --git a/deps/npm/lib/token.js b/deps/npm/lib/token.js index d442d37eb806bc..cccbba2f9ad75e 100644 --- a/deps/npm/lib/token.js +++ b/deps/npm/lib/token.js @@ -1,5 +1,5 @@ 'use strict' -const profile = require('npm-profile') +const profile = require('libnpm/profile') const npm = require('./npm.js') const output = require('./utils/output.js') const Table = require('cli-table3') diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js index c2e9edd8006f51..bf5867a2687f9d 100644 --- a/deps/npm/lib/unpublish.js +++ b/deps/npm/lib/unpublish.js @@ -1,119 +1,110 @@ /* eslint-disable standard/no-callback-literal */ +'use strict' 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 output = require('./utils/output.js') - -unpublish.usage = 'npm unpublish [<@scope>/][@]' - -unpublish.completion = function (opts, cb) { - if (opts.conf.argv.remain.length >= 3) return cb() - npm.commands.whoami([], true, function (er, username) { - if (er) return cb() - - var un = encodeURIComponent(username) - if (!un) return cb() - var byUser = '-/by-user/' + un - mapToRegistry(byUser, npm.config, function (er, uri, auth) { - if (er) return cb(er) - - 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. - pkgs = pkgs[un] - if (!pkgs || !pkgs.length) return cb() - var pp = npa(opts.partialWord).name - pkgs = pkgs.filter(function (p) { - return p.indexOf(pp) === 0 - }) - if (pkgs.length > 1) return cb(null, pkgs) - mapToRegistry(pkgs[0], npm.config, function (er, uri, auth) { - if (er) return cb(er) +const BB = require('bluebird') + +const figgyPudding = require('figgy-pudding') +const libaccess = require('libnpm/access') +const libunpub = require('libnpm/unpublish') +const log = require('npmlog') +const npa = require('npm-package-arg') +const npm = require('./npm.js') +const npmConfig = require('./config/figgy-config.js') +const npmFetch = require('npm-registry-fetch') +const otplease = require('./utils/otplease.js') +const output = require('./utils/output.js') +const path = require('path') +const readJson = BB.promisify(require('read-package-json')) +const usage = require('./utils/usage.js') +const whoami = BB.promisify(require('./whoami.js')) + +unpublish.usage = usage('npm unpublish [<@scope>/][@]') + +function UsageError () { + throw Object.assign(new Error(`Usage: ${unpublish.usage}`), { + code: 'EUSAGE' + }) +} - 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 - })) - }) - }) +const UnpublishConfig = figgyPudding({ + force: {}, + loglevel: {}, + silent: {} +}) + +unpublish.completion = function (cliOpts, cb) { + if (cliOpts.conf.argv.remain.length >= 3) return cb() + + whoami([], true).then(username => { + if (!username) { return [] } + const opts = UnpublishConfig(npmConfig()) + return libaccess.lsPackages(username, opts).then(access => { + // 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. + let pkgs = Object.keys(access) + if (!cliOpts.partialWord || !pkgs.length) { return pkgs } + const pp = npa(cliOpts.partialWord).name + pkgs = pkgs.filter(p => !p.indexOf(pp)) + if (pkgs.length > 1) return pkgs + return npmFetch.json(npa(pkgs[0]).escapedName, opts).then(doc => { + const vers = Object.keys(doc.versions) + if (!vers.length) { + return pkgs + } else { + return vers.map(v => `${pkgs[0]}@${v}`) + } }) }) - }) + }).nodeify(cb) } function unpublish (args, cb) { if (args.length > 1) return cb(unpublish.usage) - var thing = args.length ? npa(args[0]) : {} - 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') - 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) - log.verbose('unpublish', data) - gotProject(data.name, data.version, data.publishConfig, cb) - }) - } - return gotProject(project, version, cb) -} - -function gotProject (project, version, publishConfig, cb_) { - if (typeof cb_ !== 'function') { - cb_ = publishConfig - publishConfig = null - } - - function cb (er) { - if (er) return cb_(er) - output('- ' + project + (version ? '@' + version : '')) - cb_() - } - - var mappedConfig = getPublishConfig(publishConfig, npm.config, npm.registry) - var config = mappedConfig.config - var registry = mappedConfig.client - - // remove from the cache first - // npm.commands.cache(['clean', project, version], function (er) { - // if (er) { - // log.error('unpublish', 'Failed to clean cache') - // return cb(er) - // } - - mapToRegistry(project, config, function (er, uri, auth) { - if (er) return cb(er) - - var params = { - version: version, - auth: auth + const spec = args.length && npa(args[0]) + const opts = UnpublishConfig(npmConfig()) + const version = spec.rawSpec + BB.try(() => { + log.silly('unpublish', 'args[0]', args[0]) + log.silly('unpublish', 'spec', spec) + if (!version && !opts.force) { + throw Object.assign(new Error( + 'Refusing to delete entire project.\n' + + 'Run with --force to do this.\n' + + unpublish.usage + ), {code: 'EUSAGE'}) } - registry.unpublish(uri, params, cb) - }) - // }) + if (!spec || path.resolve(spec.name) === npm.localPrefix) { + // if there's a package.json in the current folder, then + // read the package name and version out of that. + const cwdJson = path.join(npm.localPrefix, 'package.json') + return readJson(cwdJson).then(data => { + log.verbose('unpublish', data) + return otplease(opts, opts => { + return libunpub(npa.resolve(data.name, data.version), opts.concat(data.publishConfig)) + }) + }, err => { + if (err && err.code !== 'ENOENT' && err.code !== 'ENOTDIR') { + throw err + } else { + UsageError() + } + }) + } else { + return otplease(opts, opts => libunpub(spec, opts)) + } + }).then( + ret => { + if (!opts.silent && opts.loglevel !== 'silent') { + output(`-${spec.name}${ + spec.type === 'version' ? `@${spec.rawSpec}` : '' + }`) + } + cb(null, ret) + }, + err => err.code === 'EUSAGE' ? cb(err.message) : cb(err) + ) } diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js index c6481abf6737d6..ba9d9f8e252e58 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -202,7 +202,7 @@ function errorHandler (er) { msg.summary.concat(msg.detail).forEach(function (errline) { log.error.apply(log, errline) }) - if (npm.config.get('json')) { + if (npm.config && npm.config.get('json')) { var error = { error: { code: er.code, diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js index 6e148981833d32..55c54634542fac 100644 --- a/deps/npm/lib/utils/error-message.js +++ b/deps/npm/lib/utils/error-message.js @@ -103,8 +103,7 @@ function errorMessage (er) { case 'EOTP': case 'E401': - // the E401 message checking is a hack till we replace npm-registry-client with something - // OTP aware. + // E401 is for places where we accidentally neglect OTP stuff if (er.code === 'EOTP' || /one-time pass/.test(er.message)) { short.push(['', 'This operation requires a one-time password from your authenticator.']) detail.push([ diff --git a/deps/npm/lib/utils/get-publish-config.js b/deps/npm/lib/utils/get-publish-config.js deleted file mode 100644 index ac0ef0934201ad..00000000000000 --- a/deps/npm/lib/utils/get-publish-config.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict' - -const clientConfig = require('../config/reg-client.js') -const Conf = require('../config/core.js').Conf -const log = require('npmlog') -const npm = require('../npm.js') -const RegClient = require('npm-registry-client') - -module.exports = getPublishConfig - -function getPublishConfig (publishConfig, defaultConfig, defaultClient) { - let config = defaultConfig - let client = defaultClient - log.verbose('getPublishConfig', publishConfig) - if (publishConfig) { - config = new Conf(defaultConfig) - config.save = defaultConfig.save.bind(defaultConfig) - - // don't modify the actual publishConfig object, in case we have - // to set a login token or some other data. - config.unshift(Object.keys(publishConfig).reduce(function (s, k) { - s[k] = publishConfig[k] - return s - }, {})) - client = new RegClient(clientConfig(npm, log, config)) - } - - return { config: config, client: client } -} diff --git a/deps/npm/lib/utils/map-to-registry.js b/deps/npm/lib/utils/map-to-registry.js deleted file mode 100644 index d6e0a5b01f4d5f..00000000000000 --- a/deps/npm/lib/utils/map-to-registry.js +++ /dev/null @@ -1,103 +0,0 @@ -var url = require('url') - -var log = require('npmlog') -var npa = require('npm-package-arg') -var config - -module.exports = mapToRegistry - -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') - - log.silly('mapToRegistry', 'scope (from package name)', data.scope) - - registry = config.get(data.scope + ':registry') - if (!registry) { - log.verbose('mapToRegistry', 'no registry URL found in name for scope', data.scope) - } - } - - // ...then --scope=@scope or --scope=scope - var scope = config.get('scope') - if (!registry && scope) { - // I'm an enabler, sorry - if (scope.charAt(0) !== '@') scope = '@' + scope - - log.silly('mapToRegistry', 'scope (from config)', scope) - - registry = config.get(scope + ':registry') - if (!registry) { - 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', '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 uri - log.silly('mapToRegistry', 'data', data) - if (data.type === 'remote') { - uri = data.fetchSpec - } else { - uri = url.resolve(normalized, name) - } - - log.silly('mapToRegistry', 'uri', uri) - - cb(null, uri, scopeAuth(uri, registry, auth), normalized) -} - -function scopeAuth (uri, registry, auth) { - var cleaned = { - scope: auth.scope, - email: auth.email, - alwaysAuth: auth.alwaysAuth, - token: undefined, - username: undefined, - password: undefined, - auth: undefined - } - - var requestHost - var registryHost - - if (auth.token || auth.auth || (auth.username && auth.password)) { - requestHost = url.parse(uri).hostname - registryHost = url.parse(registry).hostname - - if (requestHost === registryHost) { - cleaned.token = auth.token - cleaned.auth = auth.auth - cleaned.username = auth.username - cleaned.password = auth.password - } else if (auth.alwaysAuth) { - log.verbose('scopeAuth', 'alwaysAuth set for', registry) - cleaned.token = auth.token - cleaned.auth = auth.auth - cleaned.username = auth.username - cleaned.password = auth.password - } else { - log.silly('scopeAuth', uri, "doesn't share host with registry", registry) - } - if (!config) config = require('../npm').config - if (config.get('otp')) cleaned.otp = config.get('otp') - } - - return cleaned -} diff --git a/deps/npm/lib/utils/metrics.js b/deps/npm/lib/utils/metrics.js index c51136e78cdb72..0f99c841dbe26c 100644 --- a/deps/npm/lib/utils/metrics.js +++ b/deps/npm/lib/utils/metrics.js @@ -4,12 +4,13 @@ exports.stop = stopMetrics exports.save = saveMetrics exports.send = sendMetrics -var fs = require('fs') -var path = require('path') -var npm = require('../npm.js') -var uuid = require('uuid') +const fs = require('fs') +const path = require('path') +const npm = require('../npm.js') +const regFetch = require('libnpm/fetch') +const uuid = require('uuid') -var inMetrics = false +let inMetrics = false function startMetrics () { if (inMetrics) return @@ -59,15 +60,18 @@ function saveMetrics (itWorked) { function sendMetrics (metricsFile, metricsRegistry) { inMetrics = true var cliMetrics = JSON.parse(fs.readFileSync(metricsFile)) - npm.load({}, function (err) { - if (err) return - npm.registry.config.retry.retries = 0 - npm.registry.sendAnonymousCLIMetrics(metricsRegistry, cliMetrics, function (err) { - if (err) { - fs.writeFileSync(path.join(path.dirname(metricsFile), 'last-send-metrics-error.txt'), err.stack) - } else { - fs.unlinkSync(metricsFile) - } - }) + regFetch( + `/-/npm/anon-metrics/v1/${encodeURIComponent(cliMetrics.metricId)}`, + // NOTE: skip npmConfig() to prevent auth + { + registry: metricsRegistry, + method: 'PUT', + body: cliMetrics.metrics, + retry: false + } + ).then(() => { + fs.unlinkSync(metricsFile) + }, err => { + fs.writeFileSync(path.join(path.dirname(metricsFile), 'last-send-metrics-error.txt'), err.stack) }) } diff --git a/deps/npm/lib/utils/otplease.js b/deps/npm/lib/utils/otplease.js new file mode 100644 index 00000000000000..d0477a896d0049 --- /dev/null +++ b/deps/npm/lib/utils/otplease.js @@ -0,0 +1,27 @@ +'use strict' + +const BB = require('bluebird') + +const optCheck = require('figgy-pudding')({ + prompt: {default: 'This operation requires a one-time password.\nEnter OTP:'}, + otp: {} +}) +const readUserInfo = require('./read-user-info.js') + +module.exports = otplease +function otplease (opts, fn) { + opts = opts.concat ? opts : optCheck(opts) + return BB.try(() => { + return fn(opts) + }).catch(err => { + if (err.code !== 'EOTP' && !(err.code === 'E401' && /one-time pass/.test(err.body))) { + throw err + } else if (!process.stdin.isTTY || !process.stdout.isTTY) { + throw err + } else { + return readUserInfo.otp( + optCheck(opts).prompt + ).then(otp => fn(opts.concat({otp}))) + } + }) +} diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js index b7d7f6ec803100..5dd605029b9d11 100644 --- a/deps/npm/lib/view.js +++ b/deps/npm/lib/view.js @@ -8,17 +8,27 @@ const BB = require('bluebird') const byteSize = require('byte-size') const color = require('ansicolors') const columns = require('cli-columns') +const npmConfig = require('./config/figgy-config.js') +const log = require('npmlog') +const figgyPudding = require('figgy-pudding') +const npa = require('libnpm/parse-arg') +const npm = require('./npm.js') +const packument = require('libnpm/packument') +const path = require('path') +const readJson = require('libnpm/read-json') const relativeDate = require('tiny-relative-date') +const semver = require('semver') const style = require('ansistyles') -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') -var usage = require('./utils/usage') +const usage = require('./utils/usage') +const util = require('util') +const validateName = require('validate-npm-package-name') + +const ViewConfig = figgyPudding({ + global: {}, + json: {}, + tag: {}, + unicode: {} +}) view.usage = usage( 'view', @@ -32,19 +42,14 @@ view.completion = function (opts, cb) { return cb() } // have the package, get the fields. - 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) { - if (er) return cb(er) - 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) - }) - }) + const config = ViewConfig(npmConfig()) + const tag = config.tag + const spec = npa(opts.conf.argv.remain[2]) + return packument(spec, config).then(d => { + const dv = d.versions[d['dist-tags'][tag]] + d.versions = Object.keys(d.versions).sort(semver.compareLoose) + return getFields(d).concat(getFields(dv)) + }).nodeify(cb) function getFields (d, f, pref) { f = f || [] @@ -52,11 +57,11 @@ view.completion = function (opts, cb) { pref = pref || [] Object.keys(d).forEach(function (k) { if (k.charAt(0) === '_' || k.indexOf('.') !== -1) return - var p = pref.concat(k).join('.') + const p = pref.concat(k).join('.') f.push(p) if (Array.isArray(d[k])) { d[k].forEach(function (val, i) { - var pi = p + '[' + i + ']' + const pi = p + '[' + i + ']' if (val && typeof val === 'object') getFields(val, f, [p]) else f.push(pi) }) @@ -76,113 +81,132 @@ function view (args, silent, cb) { if (!args.length) args = ['.'] - var pkg = args.shift() - var nv + const opts = ViewConfig(npmConfig()) + const pkg = args.shift() + let nv if (/^[.]@/.test(pkg)) { nv = npa.resolve(null, pkg.slice(2)) } else { nv = npa(pkg) } - var name = nv.name - var local = (name === '.' || !name) + const name = nv.name + const local = (name === '.' || !name) - if (npm.config.get('global') && local) { + if (opts.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) { + const dir = npm.prefix + BB.resolve(readJson(path.resolve(dir, 'package.json'))).nodeify((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')) - var p = d.name + const p = d.name nv = npa(p) if (pkg && ~pkg.indexOf('@')) { nv.rawSpec = pkg.split('@')[pkg.indexOf('@')] } - fetchAndRead(nv, args, silent, cb) + fetchAndRead(nv, args, silent, opts, cb) }) } else { - fetchAndRead(nv, args, silent, cb) + fetchAndRead(nv, args, silent, opts, cb) } } -function fetchAndRead (nv, args, silent, cb) { +function fetchAndRead (nv, args, silent, opts, cb) { // get the data about this package - var name = nv.name - 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) { - if (er) return cb(er) - if (data['dist-tags'] && data['dist-tags'][version]) { - version = data['dist-tags'][version] - } - - if (data.time && data.time.unpublished) { - var u = data.time.unpublished - er = new Error('Unpublished by ' + u.name + ' on ' + u.time) - er.statusCode = 404 - er.code = 'E404' - er.pkgid = data._id - return cb(er, data) + let version = nv.rawSpec || npm.config.get('tag') + + return packument(nv, opts.concat({ + fullMetadata: true, + 'prefer-online': true + })).catch(err => { + // TODO - this should probably go into pacote, but the tests expect it. + if (err.code === 'E404') { + err.message = `'${nv.name}' is not in the npm registry.` + const validated = validateName(nv.name) + if (!validated.validForNewPackages) { + err.message += '\n' + err.message += (validated.errors || []).join('\n') + err.message += (validated.warnings || []).join('\n') + } else { + err.message += '\nYou should bug the author to publish it' + err.message += '\n(or use the name yourself!)' + err.message += '\n' + err.message += '\nNote that you can also install from a' + err.message += '\ntarball, folder, http url, or git url.' } + } + throw err + }).then(data => { + if (data['dist-tags'] && data['dist-tags'][version]) { + version = data['dist-tags'][version] + } - var results = [] - var error = null - var versions = data.versions || {} - data.versions = Object.keys(versions).sort(semver.compareLoose) - if (!args.length) args = [''] + if (data.time && data.time.unpublished) { + const u = data.time.unpublished + let er = new Error('Unpublished by ' + u.name + ' on ' + u.time) + er.statusCode = 404 + er.code = 'E404' + er.pkgid = data._id + throw er + } - // remove readme unless we asked for it - if (args.indexOf('readme') === -1) { - delete data.readme - } + const results = [] + let error = null + const versions = data.versions || {} + data.versions = Object.keys(versions).sort(semver.compareLoose) + if (!args.length) args = [''] - Object.keys(versions).forEach(function (v) { - if (semver.satisfies(v, version, true)) { - args.forEach(function (args) { - // remove readme unless we asked for it - if (args.indexOf('readme') !== -1) { - delete versions[v].readme - } - results.push(showFields(data, versions[v], args)) - }) - } - }) - var retval = results.reduce(reducer, {}) - - if (args.length === 1 && args[0] === '') { - retval = cleanBlanks(retval) - log.silly('cleanup', retval) - } + // remove readme unless we asked for it + if (args.indexOf('readme') === -1) { + delete data.readme + } - if (error || silent) { - cb(error, retval) - } else if ( - !npm.config.get('json') && - args.length === 1 && - args[0] === '' - ) { - data.version = version - BB.all(results.map((v) => prettyView(data, v[Object.keys(v)[0]]['']))) - .nodeify(cb) - .then(() => retval) - } else { - printData(retval, data._id, cb.bind(null, error, retval)) + Object.keys(versions).forEach(function (v) { + 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)) + }) } }) - }) + let retval = results.reduce(reducer, {}) + + if (args.length === 1 && args[0] === '') { + retval = cleanBlanks(retval) + log.silly('view', retval) + } + + if (silent) { + } else if (error) { + throw error + } else if ( + !opts.json && + args.length === 1 && + args[0] === '' + ) { + data.version = version + return BB.all( + results.map((v) => prettyView(data, v[Object.keys(v)[0]][''], opts)) + ).then(() => retval) + } else { + return BB.fromNode(cb => { + printData(retval, data._id, opts, cb) + }).then(() => retval) + } + }).nodeify(cb) } -function prettyView (packument, manifest) { +function prettyView (packument, manifest, opts) { // More modern, pretty printing of default view - const unicode = npm.config.get('unicode') + const unicode = opts.unicode return BB.try(() => { if (!manifest) { log.error( @@ -312,7 +336,7 @@ function prettyView (packument, manifest) { } function cleanBlanks (obj) { - var clean = {} + const clean = {} Object.keys(obj).forEach(function (version) { clean[version] = obj[version][''] }) @@ -334,7 +358,7 @@ function reducer (l, r) { // return whatever was printed function showFields (data, version, fields) { - var o = {} + const o = {} ;[data, version].forEach(function (s) { Object.keys(s).forEach(function (k) { o[k] = s[k] @@ -344,18 +368,18 @@ function showFields (data, version, fields) { } function search (data, fields, version, title) { - var field - var tail = fields + let field + const tail = fields while (!field && fields.length) field = tail.shift() fields = [field].concat(tail) - var o + let o if (!field && !tail.length) { o = {} o[version] = {} o[version][title] = data return o } - var index = field.match(/(.+)\[([^\]]+)\]$/) + let index = field.match(/(.+)\[([^\]]+)\]$/) if (index) { field = index[1] index = index[2] @@ -369,10 +393,10 @@ function search (data, fields, version, title) { if (data.length === 1) { return search(data[0], fields, version, title) } - var results = [] + let results = [] data.forEach(function (data, i) { - var tl = title.length - var newt = title.substr(0, tl - fields.join('.').length - 1) + + const tl = title.length + const newt = title.substr(0, tl - fields.join('.').length - 1) + '[' + i + ']' + [''].concat(fields).join('.') results.push(search(data, fields.slice(), version, newt)) }) @@ -395,32 +419,32 @@ function search (data, fields, version, title) { return o } -function printData (data, name, cb) { - var versions = Object.keys(data) - var msg = '' - var msgJson = [] - var includeVersions = versions.length > 1 - var includeFields +function printData (data, name, opts, cb) { + const versions = Object.keys(data) + let msg = '' + let msgJson = [] + const includeVersions = versions.length > 1 + let includeFields versions.forEach(function (v) { - var fields = Object.keys(data[v]) + const fields = Object.keys(data[v]) includeFields = includeFields || (fields.length > 1) - if (npm.config.get('json')) msgJson.push({}) + if (opts.json) msgJson.push({}) fields.forEach(function (f) { - var d = cleanup(data[v][f]) - if (fields.length === 1 && npm.config.get('json')) { + let d = cleanup(data[v][f]) + if (fields.length === 1 && opts.json) { msgJson[msgJson.length - 1][f] = d } if (includeVersions || includeFields || typeof d !== 'string') { - if (npm.config.get('json')) { + if (opts.json) { msgJson[msgJson.length - 1][f] = d } else { d = util.inspect(d, { showHidden: false, depth: 5, colors: npm.color, maxArrayLength: null }) } - } else if (typeof d === 'string' && npm.config.get('json')) { + } else if (typeof d === 'string' && opts.json) { d = JSON.stringify(d) } - if (!npm.config.get('json')) { + if (!opts.json) { if (f && includeFields) f += ' = ' if (d.indexOf('\n') !== -1) d = ' \n' + d msg += (includeVersions ? name + '@' + v + ' ' : '') + @@ -429,9 +453,9 @@ function printData (data, name, cb) { }) }) - if (npm.config.get('json')) { + if (opts.json) { if (msgJson.length && Object.keys(msgJson[0]).length === 1) { - var k = Object.keys(msgJson[0])[0] + const k = Object.keys(msgJson[0])[0] msgJson = msgJson.map(function (m) { return m[k] }) } @@ -465,7 +489,7 @@ function cleanup (data) { data.versions = Object.keys(data.versions || {}) } - var keys = Object.keys(data) + let 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]) diff --git a/deps/npm/lib/whoami.js b/deps/npm/lib/whoami.js index e8af6595d15cc1..5145b447de4c6b 100644 --- a/deps/npm/lib/whoami.js +++ b/deps/npm/lib/whoami.js @@ -1,47 +1,63 @@ -var npm = require('./npm.js') -var output = require('./utils/output.js') +'use strict' + +const BB = require('bluebird') + +const npmConfig = require('./config/figgy-config.js') +const fetch = require('libnpm/fetch') +const figgyPudding = require('figgy-pudding') +const npm = require('./npm.js') +const output = require('./utils/output.js') + +const WhoamiConfig = figgyPudding({ + json: {}, + registry: {} +}) module.exports = whoami whoami.usage = 'npm whoami [--registry ]\n(just prints username according to given registry)' -function whoami (args, silent, cb) { +function whoami ([spec], silent, cb) { // FIXME: need tighter checking on this, but is a breaking change if (typeof cb !== 'function') { cb = silent silent = false } - - var registry = npm.config.get('registry') - if (!registry) return cb(new Error('no default registry set')) - - var auth = npm.config.getCredentialsByURI(registry) - if (auth) { - if (auth.username) { - if (!silent) output(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) { - if (er) return cb(er) - if (!username) { - var needNewSession = new Error( + const opts = WhoamiConfig(npmConfig()) + return BB.try(() => { + // First, check if we have a user/pass-based auth + const registry = opts.registry + if (!registry) throw new Error('no default registry set') + return npm.config.getCredentialsByURI(registry) + }).then(({username, token}) => { + if (username) { + return username + } else if (token) { + return fetch.json('/-/whoami', opts.concat({ + spec + })).then(({username}) => { + if (username) { + return username + } else { + throw Object.assign(new Error( 'Your auth token is no longer valid. Please log in again.' - ) - needNewSession.code = 'ENEEDAUTH' - return cb(needNewSession) + ), {code: 'ENEEDAUTH'}) } - - if (!silent) output(username) - cb(null, username) }) + } else { + // At this point, if they have a credentials object, it doesn't have a + // token or auth in it. Probably just the default registry. + throw Object.assign(new Error( + 'This command requires you to be logged in.' + ), {code: 'ENEEDAUTH'}) } - } - - // 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.' - ) - needAuth.code = 'ENEEDAUTH' - process.nextTick(cb.bind(this, needAuth)) + }).then(username => { + if (silent) { + } else if (opts.json) { + output(JSON.stringify(username)) + } else { + output(username) + } + return username + }).nodeify(cb) } diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index ebb32ed4984dfa..d616e80ebb5319 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "December 2018" "" "" +.TH "NPM" "1" "January 2019" "" "" .SH "NAME" \fBnpm\fR \- a JavaScript package manager .P diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 70a9eb013aebea..db77a4092d972b 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" "December 2018" "" "" +.TH "NPM\-ACCESS" "1" "January 2019" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SH SYNOPSIS @@ -11,6 +11,9 @@ npm access restricted [] npm access grant [] npm access revoke [] +npm access 2fa\-required [] +npm access 2fa\-not\-required [] + npm access ls\-packages [||] npm access ls\-collaborators [ []] npm access edit [] @@ -32,6 +35,10 @@ grant / revoke: Add or remove the ability of users and teams to have read\-only or read\-write access to a package\. .IP \(bu 2 +2fa\-required / 2fa\-not\-required: +Configure whether a package requires that anyone publishing it have two\-factor +authentication enabled on their account\. +.IP \(bu 2 ls\-packages: Show all of the packages a user or a team is able to access, along with the access level, except for read\-only public packages (it won't print the whole @@ -80,6 +87,8 @@ Management of teams and team memberships is done with the \fBnpm team\fP command .SH SEE ALSO .RS 0 .IP \(bu 2 +\fBlibnpmaccess\fP \fIhttps://npm\.im/libnpmaccess\fR +.IP \(bu 2 npm help team .IP \(bu 2 npm help publish diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 33f3c705e41fb8..a2158576572409 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" "December 2018" "" "" +.TH "NPM\-ADDUSER" "1" "January 2019" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-audit.1 b/deps/npm/man/man1/npm-audit.1 index 90e3e7ad4b5f78..dee3bb03e1e751 100644 --- a/deps/npm/man/man1/npm-audit.1 +++ b/deps/npm/man/man1/npm-audit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-AUDIT" "1" "December 2018" "" "" +.TH "NPM\-AUDIT" "1" "January 2019" "" "" .SH "NAME" \fBnpm-audit\fR \- Run a security audit .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index e4ac9b1a782470..edec701bb2bc14 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "1" "December 2018" "" "" +.TH "NPM\-BIN" "1" "January 2019" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 67e57069c857cb..d34e0987414369 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "1" "December 2018" "" "" +.TH "NPM\-BUGS" "1" "January 2019" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 index 153fac58db013f..b4247d95bdfb44 100644 --- a/deps/npm/man/man1/npm-build.1 +++ b/deps/npm/man/man1/npm-build.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUILD" "1" "December 2018" "" "" +.TH "NPM\-BUILD" "1" "January 2019" "" "" .SH "NAME" \fBnpm-build\fR \- Build a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index cdc27fa591618c..2b00e67c35c75d 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" "December 2018" "" "" +.TH "NPM\-BUNDLE" "1" "January 2019" "" "" .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 0b82fac3a1c653..2dc3481048a05f 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" "December 2018" "" "" +.TH "NPM\-CACHE" "1" "January 2019" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1 index d38f56eb5f6ccf..b872c00415b249 100644 --- a/deps/npm/man/man1/npm-ci.1 +++ b/deps/npm/man/man1/npm-ci.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CI" "1" "December 2018" "" "" +.TH "NPM\-CI" "1" "January 2019" "" "" .SH "NAME" \fBnpm-ci\fR \- Install a project with a clean slate .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index 8a4cb41d3aac2c..9f424dc2e36b78 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM\-COMPLETION" "1" "December 2018" "" "" +.TH "NPM\-COMPLETION" "1" "January 2019" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 81c797a1211cd8..cc9f9cff4e21e2 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "1" "December 2018" "" "" +.TH "NPM\-CONFIG" "1" "January 2019" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 0d6f80848e27b4..8f221481298c7a 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" "December 2018" "" "" +.TH "NPM\-DEDUPE" "1" "January 2019" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 121f2b9f866d2b..1cf39ddb45152f 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "1" "December 2018" "" "" +.TH "NPM\-DEPRECATE" "1" "January 2019" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index f9e52f93042157..b10e8ce3583d00 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" "December 2018" "" "" +.TH "NPM\-DIST\-TAG" "1" "January 2019" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SH SYNOPSIS @@ -29,6 +29,7 @@ Clear a tag that is no longer in use from the package\. ls: Show all of the dist\-tags for a package, defaulting to the package in the current prefix\. +This is the default action if none is specified\. .RE .P diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index 3ed38e648a25f0..6d7ac688b39528 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" "December 2018" "" "" +.TH "NPM\-DOCS" "1" "January 2019" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-doctor.1 b/deps/npm/man/man1/npm-doctor.1 index c15ae915644c96..aa55d1518ee371 100644 --- a/deps/npm/man/man1/npm-doctor.1 +++ b/deps/npm/man/man1/npm-doctor.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCTOR" "1" "December 2018" "" "" +.TH "NPM\-DOCTOR" "1" "January 2019" "" "" .SH "NAME" \fBnpm-doctor\fR \- Check your environments .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index ef2a4145852946..9146f3b76d428f 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "1" "December 2018" "" "" +.TH "NPM\-EDIT" "1" "January 2019" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 83ea6148f6ec54..89df72517841d2 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "1" "December 2018" "" "" +.TH "NPM\-EXPLORE" "1" "January 2019" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index c7214a8048890b..e298e8d98142e8 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "1" "December 2018" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "January 2019" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 3c4e92b824713f..c07f2859175f96 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP" "1" "December 2018" "" "" +.TH "NPM\-HELP" "1" "January 2019" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-hook.1 b/deps/npm/man/man1/npm-hook.1 index 6dcc942ea69eb4..47b175167378c6 100644 --- a/deps/npm/man/man1/npm-hook.1 +++ b/deps/npm/man/man1/npm-hook.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HOOK" "1" "December 2018" "" "" +.TH "NPM\-HOOK" "1" "January 2019" "" "" .SH "NAME" \fBnpm-hook\fR \- Manage registry hooks .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 2e9915a58b4790..988126a399a5e9 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" "December 2018" "" "" +.TH "NPM\-INIT" "1" "January 2019" "" "" .SH "NAME" \fBnpm-init\fR \- create a package\.json file .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-install-ci-test.1 b/deps/npm/man/man1/npm-install-ci-test.1 index 70862f426c2f5a..6cdda35e2a2b83 100644 --- a/deps/npm/man/man1/npm-install-ci-test.1 +++ b/deps/npm/man/man1/npm-install-ci-test.1 @@ -1,4 +1,4 @@ -.TH "NPM" "" "December 2018" "" "" +.TH "NPM" "" "January 2019" "" "" .SH "NAME" \fBnpm\fR .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index 9e6124550308dd..ae8d5223f15d70 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM" "" "December 2018" "" "" +.TH "NPM" "" "January 2019" "" "" .SH "NAME" \fBnpm\fR .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 7ecc6cf35dd2df..f2cdfeda49cf82 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "December 2018" "" "" +.TH "NPM\-INSTALL" "1" "January 2019" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index a70f0b4eebf540..292b9e50a03850 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "December 2018" "" "" +.TH "NPM\-LINK" "1" "January 2019" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index f0dddf165fdcb5..df27d4b55b973c 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LOGOUT" "1" "December 2018" "" "" +.TH "NPM\-LOGOUT" "1" "January 2019" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index c68d86ce9f5f5c..59fa5878268686 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "December 2018" "" "" +.TH "NPM\-LS" "1" "January 2019" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SH SYNOPSIS @@ -22,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@6.5.0 /path/to/npm +npm@6.7.0 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-org.1 b/deps/npm/man/man1/npm-org.1 new file mode 100644 index 00000000000000..2cef7e05e62596 --- /dev/null +++ b/deps/npm/man/man1/npm-org.1 @@ -0,0 +1,72 @@ +.TH "NPM\-ORG" "1" "January 2019" "" "" +.SH "NAME" +\fBnpm-org\fR \- Manage orgs +.SH SYNOPSIS +.P +.RS 2 +.nf +npm org set [developer | admin | owner] +npm org rm +npm org ls [] +.fi +.RE +.SH EXAMPLE +.P +Add a new developer to an org: +.P +.RS 2 +.nf +$ npm org set my\-org @mx\-smith +.fi +.RE +.P +Add a new admin to an org (or change a developer to an admin): +.P +.RS 2 +.nf +$ npm org set my\-org @mx\-santos admin +.fi +.RE +.P +Remove a user from an org: +.P +.RS 2 +.nf +$ npm org rm my\-org mx\-santos +.fi +.RE +.P +List all users in an org: +.P +.RS 2 +.nf +$ npm org ls my\-org +.fi +.RE +.P +List all users in JSON format: +.P +.RS 2 +.nf +$ npm org ls my\-org \-\-json +.fi +.RE +.P +See what role a user has in an org: +.P +.RS 2 +.nf +$ npm org ls my\-org @mx\-santos +.fi +.RE +.SH DESCRIPTION +.P +You can use the \fBnpm org\fP commands to manage and view users of an organization\. +It supports adding and removing users, changing their roles, listing them, and +finding specific ones and their roles\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +Documentation on npm Orgs \fIhttps://docs\.npmjs\.com/orgs/\fR + +.RE diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index ca26a1a3ca6fa2..7e0a18bef9a007 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "December 2018" "" "" +.TH "NPM\-OUTDATED" "1" "January 2019" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index b188cb5c03fd5f..c7209ddc9c4bb2 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "December 2018" "" "" +.TH "NPM\-OWNER" "1" "January 2019" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index f17f2139e9a131..34af68565e2a75 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "December 2018" "" "" +.TH "NPM\-PACK" "1" "January 2019" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index 7a6c461b492f36..200f51383dd4c4 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" "December 2018" "" "" +.TH "NPM\-PING" "1" "January 2019" "" "" .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 e26ab20c5d9b8b..372647ecaa04f8 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" "December 2018" "" "" +.TH "NPM\-PREFIX" "1" "January 2019" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SH SYNOPSIS @@ -11,7 +11,8 @@ npm prefix [\-g] .SH DESCRIPTION .P Print the local prefix to standard out\. This is the closest parent directory -to contain a package\.json file unless \fB\-g\fP is also specified\. +to contain a \fBpackage\.json\fP file or \fBnode_modules\fP directory, unless \fB\-g\fP is +also specified\. .P If \fB\-g\fP is specified, this will be the value of the global prefix\. See npm help 7 \fBnpm\-config\fP for more detail\. diff --git a/deps/npm/man/man1/npm-profile.1 b/deps/npm/man/man1/npm-profile.1 index 91eb3e5b84bda4..1bd7dcc2e117a7 100644 --- a/deps/npm/man/man1/npm-profile.1 +++ b/deps/npm/man/man1/npm-profile.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PROFILE" "1" "December 2018" "" "" +.TH "NPM\-PROFILE" "1" "January 2019" "" "" .SH "NAME" \fBnpm-profile\fR \- Change settings on your registry profile .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 29f4e3f7638198..6a3ed6d62f8a38 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "December 2018" "" "" +.TH "NPM\-PRUNE" "1" "January 2019" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index ea7ea69aad1e46..934a9ad810b98f 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "December 2018" "" "" +.TH "NPM\-PUBLISH" "1" "January 2019" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index daab56a1f6fff7..8005c9513f2497 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "December 2018" "" "" +.TH "NPM\-REBUILD" "1" "January 2019" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 5e105e109573c7..261d44a86087c1 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "1" "December 2018" "" "" +.TH "NPM\-REPO" "1" "January 2019" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 8058ae62bd0445..084f5690eda38e 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" "December 2018" "" "" +.TH "NPM\-RESTART" "1" "January 2019" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index 7c123431a5d984..fd4246d8791f6a 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "December 2018" "" "" +.TH "NPM\-ROOT" "1" "January 2019" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index 98917db085412c..e349dab426526e 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "December 2018" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "January 2019" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index 1ee0f51b1709ef..95a8d0966bc7df 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "December 2018" "" "" +.TH "NPM\-SEARCH" "1" "January 2019" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index a2a4afdacbdd25..3f9658febf76c8 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" "December 2018" "" "" +.TH "NPM\-SHRINKWRAP" "1" "January 2019" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions for publication .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 106c50a8c0c924..ae8c61667da3c5 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "December 2018" "" "" +.TH "NPM\-STAR" "1" "January 2019" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 38042d2c1e226b..2f6038cb5d2be2 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "December 2018" "" "" +.TH "NPM\-STARS" "1" "January 2019" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index f36f19af52f84c..7ea6362bdc90f0 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" "December 2018" "" "" +.TH "NPM\-START" "1" "January 2019" "" "" .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 65d257d8f41b50..2fa4d88ab3804b 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" "December 2018" "" "" +.TH "NPM\-STOP" "1" "January 2019" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index 692f9e3f5a271f..6ed65ab44f8de3 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" "December 2018" "" "" +.TH "NPM\-TEAM" "1" "January 2019" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index e644339a405be7..0183a8e079968c 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" "December 2018" "" "" +.TH "NPM\-TEST" "1" "January 2019" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-token.1 b/deps/npm/man/man1/npm-token.1 index 2a00d6273607aa..d7ab2e18b7478a 100644 --- a/deps/npm/man/man1/npm-token.1 +++ b/deps/npm/man/man1/npm-token.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TOKEN" "1" "December 2018" "" "" +.TH "NPM\-TOKEN" "1" "January 2019" "" "" .SH "NAME" \fBnpm-token\fR \- Manage your authentication tokens .SH SYNOPSIS @@ -12,7 +12,7 @@ npm token revoke .RE .SH DESCRIPTION .P -This list you list, create and revoke authentication tokens\. +This lets you list, create and revoke authentication tokens\. .RS 0 .IP \(bu 2 \fBnpm token list\fP: diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 18115b4141a400..07c413e299beea 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "1" "December 2018" "" "" +.TH "NPM\-UNINSTALL" "1" "January 2019" "" "" .SH "NAME" \fBnpm-uninstall\fR \- Remove a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index c4f628c791e475..25eb7044acb32a 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "December 2018" "" "" +.TH "NPM\-UNPUBLISH" "1" "January 2019" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 4084d91124fd4d..6486b8aef073b4 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "December 2018" "" "" +.TH "NPM\-UPDATE" "1" "January 2019" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 1fb0950052ac7e..bae79b58186a5f 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" "December 2018" "" "" +.TH "NPM\-VERSION" "1" "January 2019" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index f5d8b6a84d9bdf..713de6e3cb22a8 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "December 2018" "" "" +.TH "NPM\-VIEW" "1" "January 2019" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index f44ff37ce0ffcf..08f23ddf0cbc23 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "December 2018" "" "" +.TH "NPM\-WHOAMI" "1" "January 2019" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 9dc282959eaa9c..38cf7686a434b8 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "December 2018" "" "" +.TH "NPM" "1" "January 2019" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SH SYNOPSIS @@ -10,7 +10,7 @@ npm [args] .RE .SH VERSION .P -6.5.0 +6.7.0 .SH DESCRIPTION .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index 901e658c2ff434..0fa03d9715058f 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" "December 2018" "" "" +.TH "NPM\-FOLDERS" "5" "January 2019" "" "" .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 901e658c2ff434..0fa03d9715058f 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" "December 2018" "" "" +.TH "NPM\-FOLDERS" "5" "January 2019" "" "" .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 64d5408cdb3e47..dd20f7cb5f3ca1 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" "December 2018" "" "" +.TH "PACKAGE\.JSON" "5" "January 2019" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-package-locks.5 b/deps/npm/man/man5/npm-package-locks.5 index cddd15648ee4a4..b3692cebb2e139 100644 --- a/deps/npm/man/man5/npm-package-locks.5 +++ b/deps/npm/man/man5/npm-package-locks.5 @@ -1,4 +1,4 @@ -.TH "NPM\-PACKAGE\-LOCKS" "5" "December 2018" "" "" +.TH "NPM\-PACKAGE\-LOCKS" "5" "January 2019" "" "" .SH "NAME" \fBnpm-package-locks\fR \- An explanation of npm lockfiles .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-shrinkwrap.json.5 b/deps/npm/man/man5/npm-shrinkwrap.json.5 index b346fb33d71917..c1d4db9af34b74 100644 --- a/deps/npm/man/man5/npm-shrinkwrap.json.5 +++ b/deps/npm/man/man5/npm-shrinkwrap.json.5 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP\.JSON" "5" "December 2018" "" "" +.TH "NPM\-SHRINKWRAP\.JSON" "5" "January 2019" "" "" .SH "NAME" \fBnpm-shrinkwrap.json\fR \- A publishable lockfile .SH DESCRIPTION diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index e1af5ff4806f04..3d6bf7d568d132 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "December 2018" "" "" +.TH "NPMRC" "5" "January 2019" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SH DESCRIPTION diff --git a/deps/npm/man/man5/package-lock.json.5 b/deps/npm/man/man5/package-lock.json.5 index eeb5bc28609ecd..dcb215423d7303 100644 --- a/deps/npm/man/man5/package-lock.json.5 +++ b/deps/npm/man/man5/package-lock.json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\-LOCK\.JSON" "5" "December 2018" "" "" +.TH "PACKAGE\-LOCK\.JSON" "5" "January 2019" "" "" .SH "NAME" \fBpackage-lock.json\fR \- A manifestation of the manifest .SH DESCRIPTION diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index 64d5408cdb3e47..dd20f7cb5f3ca1 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" "December 2018" "" "" +.TH "PACKAGE\.JSON" "5" "January 2019" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7 index 1d8ba4055361a8..9268b14cf9f4b9 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" "December 2018" "" "" +.TH "NPM\-CODING\-STYLE" "7" "January 2019" "" "" .SH "NAME" \fBnpm-coding-style\fR \- npm's "funny" coding style .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index 82e6e7e8a27d19..9b05942bb0b28f 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" "December 2018" "" "" +.TH "NPM\-CONFIG" "7" "January 2019" "" "" .SH "NAME" \fBnpm-config\fR \- More than you probably want to know about npm configuration .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index 88c8ac2c9e925a..bd36cbabb7991a 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" "December 2018" "" "" +.TH "NPM\-DEVELOPERS" "7" "January 2019" "" "" .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 9c63852455de11..95716579e50527 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" "December 2018" "" "" +.TH "NPM\-DISPUTES" "7" "January 2019" "" "" .SH "NAME" \fBnpm-disputes\fR \- Handling Module Name Disputes .P diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7 index dd7c7317345ec6..1d7d5d0bf46cac 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" "December 2018" "" "" +.TH "NPM\-INDEX" "7" "January 2019" "" "" .SH "NAME" \fBnpm-index\fR \- Index of all npm documentation .SS npm help README @@ -94,6 +94,9 @@ Log out of the registry .SS npm help ls .P List installed packages +.SS npm help org +.P +Manage orgs .SS npm help outdated .P Check for outdated packages diff --git a/deps/npm/man/man7/npm-orgs.7 b/deps/npm/man/man7/npm-orgs.7 index 619b42e863035b..9f34c3cb7940ef 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" "December 2018" "" "" +.TH "NPM\-ORGS" "7" "January 2019" "" "" .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 3cb1c86577507d..4c454c81f0c313 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" "December 2018" "" "" +.TH "NPM\-REGISTRY" "7" "January 2019" "" "" .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 8fdede6cca3ae7..6ba7c309224567 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" "December 2018" "" "" +.TH "NPM\-SCOPE" "7" "January 2019" "" "" .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 3c2b95f1af4596..9f5462e8a876d0 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" "December 2018" "" "" +.TH "NPM\-SCRIPTS" "7" "January 2019" "" "" .SH "NAME" \fBnpm-scripts\fR \- How npm handles the "scripts" field .SH DESCRIPTION diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7 index b93f704ffcaf42..f7d0781055cea5 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" "December 2018" "" "" +.TH "NPM\-REMOVAL" "1" "January 2019" "" "" .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 64b836ae9d6207..60f62c7e23d013 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "December 2018" "" "" +.TH "SEMVER" "7" "January 2019" "" "" .SH "NAME" \fBsemver\fR \- The semantic versioner for npm .SH Install @@ -34,8 +34,6 @@ As a command\-line utility: .nf $ semver \-h -SemVer 5\.3\.0 - A JavaScript implementation of the http://semver\.org/ specification Copyright Isaac Z\. Schlueter @@ -59,6 +57,9 @@ Options: \-l \-\-loose Interpret versions and ranges loosely +\-p \-\-include\-prerelease + Always include prerelease versions in range matching + \-c \-\-coerce Coerce a string into SemVer if possible (does not imply \-\-loose) @@ -344,9 +345,23 @@ part ::= nr | [\-0\-9A\-Za\-z]+ .RE .SH Functions .P -All methods and classes take a final \fBloose\fP boolean argument that, if -true, will be more forgiving about not\-quite\-valid semver strings\. -The resulting output will always be 100% strict, of course\. +All methods and classes take a final \fBoptions\fP object argument\. All +options in this object are \fBfalse\fP by default\. The options supported +are: +.RS 0 +.IP \(bu 2 +\fBloose\fP Be more forgiving about not\-quite\-valid semver strings\. +(Any resulting output will always be 100% strict compliant, of +course\.) For backwards compatibility reasons, if the \fBoptions\fP +argument is a boolean value instead of an object, it is interpreted +to be the \fBloose\fP param\. +.IP \(bu 2 +\fBincludePrerelease\fP Set to suppress the default +behavior \fIhttps://github\.com/npm/node\-semver#prerelease\-tags\fR of +excluding prerelease tagged versions from ranges unless they are +explicitly opted into\. + +.RE .P Strict\-mode Comparators and Ranges will be strict about the SemVer strings that they parse\. diff --git a/deps/npm/node_modules/JSONStream/index.js b/deps/npm/node_modules/JSONStream/index.js index a92967f568a4c2..8c587af769a2d7 100755 --- a/deps/npm/node_modules/JSONStream/index.js +++ b/deps/npm/node_modules/JSONStream/index.js @@ -3,6 +3,8 @@ var Parser = require('jsonparse') , through = require('through') +var bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from + /* the value of this.stack that creationix's jsonparse has is weird. @@ -17,7 +19,7 @@ exports.parse = function (path, map) { var parser = new Parser() var stream = through(function (chunk) { if('string' === typeof chunk) - chunk = new Buffer(chunk) + chunk = bufferFrom ? Buffer.from(chunk) : new Buffer(chunk) parser.write(chunk) }, function (data) { diff --git a/deps/npm/node_modules/JSONStream/package.json b/deps/npm/node_modules/JSONStream/package.json index 23588d31b13a4a..91783af0b0ab64 100644 --- a/deps/npm/node_modules/JSONStream/package.json +++ b/deps/npm/node_modules/JSONStream/package.json @@ -1,28 +1,29 @@ { - "_from": "JSONStream@1.3.4", - "_id": "JSONStream@1.3.4", + "_from": "JSONStream@1.3.5", + "_id": "JSONStream@1.3.5", "_inBundle": false, - "_integrity": "sha512-Y7vfi3I5oMOYIr+WxV8NZxDSwcbNgzdKYsTNInmycOq9bUYwGg9ryu57Wg5NLmCjqdFPNUmpMBo3kSJN9tCbXg==", + "_integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "_location": "/JSONStream", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "JSONStream@1.3.4", + "raw": "JSONStream@1.3.5", "name": "JSONStream", "escapedName": "JSONStream", - "rawSpec": "1.3.4", + "rawSpec": "1.3.5", "saveSpec": null, - "fetchSpec": "1.3.4" + "fetchSpec": "1.3.5" }, "_requiredBy": [ "#USER", - "/" + "/", + "/npm-registry-fetch" ], - "_resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.4.tgz", - "_shasum": "615bb2adb0cd34c8f4c447b5f6512fa1d8f16a2e", - "_spec": "JSONStream@1.3.4", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "_shasum": "3208c1f08d3a4d99261ab64f92302bc15e111ca0", + "_spec": "JSONStream@1.3.5", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Dominic Tarr", "email": "dominic.tarr@gmail.com", @@ -69,7 +70,7 @@ "url": "git://github.com/dominictarr/JSONStream.git" }, "scripts": { - "test": "set -e; for t in test/*.js; do echo '***' $t '***'; node $t; done" + "test": "node test/run.js" }, - "version": "1.3.4" + "version": "1.3.5" } diff --git a/deps/npm/node_modules/JSONStream/test/parsejson.js b/deps/npm/node_modules/JSONStream/test/parsejson.js index 7f157175f5c48d..df4fbbe73a40d6 100644 --- a/deps/npm/node_modules/JSONStream/test/parsejson.js +++ b/deps/npm/node_modules/JSONStream/test/parsejson.js @@ -9,6 +9,9 @@ var r = Math.random() , p = new Parser() , assert = require('assert') , times = 20 + , bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from + , str + while (times --) { assert.equal(JSON.parse(JSON.stringify(r)), r, 'core JSON') @@ -18,7 +21,8 @@ while (times --) { assert.equal(v,r) } console.error('correct', r) - p.write (new Buffer(JSON.stringify([r]))) + str = JSON.stringify([r]) + p.write (bufferFrom ? Buffer.from(str) : new Buffer(str)) diff --git a/deps/npm/node_modules/JSONStream/test/run.js b/deps/npm/node_modules/JSONStream/test/run.js new file mode 100644 index 00000000000000..7d62e7385bd44f --- /dev/null +++ b/deps/npm/node_modules/JSONStream/test/run.js @@ -0,0 +1,13 @@ +var readdirSync = require('fs').readdirSync +var spawnSync = require('child_process').spawnSync +var extname = require('path').extname + +var files = readdirSync(__dirname) +files.forEach(function(file){ + if (extname(file) !== '.js' || file === 'run.js') + return + console.log(`*** ${file} ***`) + var result = spawnSync(process.argv0, [file], { stdio: 'inherit', cwd: __dirname} ) + if (result.status !== 0) + process.exit(result.status) +}) diff --git a/deps/npm/node_modules/aproba/CHANGELOG.md b/deps/npm/node_modules/aproba/CHANGELOG.md new file mode 100644 index 00000000000000..bab30ecb7e625d --- /dev/null +++ b/deps/npm/node_modules/aproba/CHANGELOG.md @@ -0,0 +1,4 @@ +2.0.0 + * Drop support for 0.10 and 0.12. They haven't been in travis but still, + since we _know_ we'll break with them now it's only polite to do a + major bump. diff --git a/deps/npm/node_modules/aproba/index.js b/deps/npm/node_modules/aproba/index.js index 6f3f797c09a750..fd947481ba5575 100644 --- a/deps/npm/node_modules/aproba/index.js +++ b/deps/npm/node_modules/aproba/index.js @@ -1,38 +1,39 @@ 'use strict' +module.exports = validate function isArguments (thingy) { return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') } -var types = { - '*': {label: 'any', check: function () { return true }}, - A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, - S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, - N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, - F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, - O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, - B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, - E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, - Z: {label: 'null', check: function (thingy) { return thingy == null }} +const types = { + '*': {label: 'any', check: () => true}, + A: {label: 'array', check: _ => Array.isArray(_) || isArguments(_)}, + S: {label: 'string', check: _ => typeof _ === 'string'}, + N: {label: 'number', check: _ => typeof _ === 'number'}, + F: {label: 'function', check: _ => typeof _ === 'function'}, + O: {label: 'object', check: _ => typeof _ === 'object' && _ != null && !types.A.check(_) && !types.E.check(_)}, + B: {label: 'boolean', check: _ => typeof _ === 'boolean'}, + E: {label: 'error', check: _ => _ instanceof Error}, + Z: {label: 'null', check: _ => _ == null} } function addSchema (schema, arity) { - var group = arity[schema.length] = arity[schema.length] || [] + const group = arity[schema.length] = arity[schema.length] || [] if (group.indexOf(schema) === -1) group.push(schema) } -var validate = module.exports = function (rawSchemas, args) { +function validate (rawSchemas, args) { if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') if (!args) throw missingRequiredArg(1, 'args') if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) if (!types.A.check(args)) throw invalidType(1, ['array'], args) - var schemas = rawSchemas.split('|') - var arity = {} + const schemas = rawSchemas.split('|') + const arity = {} - schemas.forEach(function (schema) { - for (var ii = 0; ii < schema.length; ++ii) { - var type = schema[ii] + schemas.forEach(schema => { + for (let ii = 0; ii < schema.length; ++ii) { + const type = schema[ii] if (!types[type]) throw unknownType(ii, type) } if (/E.*E/.test(schema)) throw moreThanOneError(schema) @@ -43,20 +44,18 @@ var validate = module.exports = function (rawSchemas, args) { if (schema.length === 1) addSchema('', arity) } }) - var matching = arity[args.length] + let matching = arity[args.length] if (!matching) { throw wrongNumberOfArgs(Object.keys(arity), args.length) } - for (var ii = 0; ii < args.length; ++ii) { - var newMatching = matching.filter(function (schema) { - var type = schema[ii] - var typeCheck = types[type].check + for (let ii = 0; ii < args.length; ++ii) { + let newMatching = matching.filter(schema => { + const type = schema[ii] + const typeCheck = types[type].check return typeCheck(args[ii]) }) if (!newMatching.length) { - var labels = matching.map(function (schema) { - return types[schema[ii]].label - }).filter(function (schema) { return schema != null }) + const labels = matching.map(_ => types[_[ii]].label).filter(_ => _ != null) throw invalidType(ii, labels, args[ii]) } matching = newMatching @@ -72,8 +71,8 @@ function unknownType (num, type) { } function invalidType (num, expectedTypes, value) { - var valueType - Object.keys(types).forEach(function (typeCode) { + let valueType + Object.keys(types).forEach(typeCode => { if (types[typeCode].check(value)) valueType = types[typeCode].label }) return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + @@ -85,8 +84,8 @@ function englishList (list) { } function wrongNumberOfArgs (expected, got) { - var english = englishList(expected) - var args = expected.every(function (ex) { return ex.length === 1 }) + const english = englishList(expected) + const args = expected.every(ex => ex.length === 1) ? 'argument' : 'arguments' return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) @@ -98,8 +97,9 @@ function moreThanOneError (schema) { } function newException (code, msg) { - var e = new Error(msg) - e.code = code - if (Error.captureStackTrace) Error.captureStackTrace(e, validate) - return e + const err = new Error(msg) + err.code = code + /* istanbul ignore else */ + if (Error.captureStackTrace) Error.captureStackTrace(err, validate) + return err } diff --git a/deps/npm/node_modules/aproba/package.json b/deps/npm/node_modules/aproba/package.json index 534c6beb57e4ee..42a7798b0e7829 100644 --- a/deps/npm/node_modules/aproba/package.json +++ b/deps/npm/node_modules/aproba/package.json @@ -1,38 +1,29 @@ { - "_args": [ - [ - "aproba@1.2.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "aproba@1.2.0", - "_id": "aproba@1.2.0", + "_from": "aproba@2.0.0", + "_id": "aproba@2.0.0", "_inBundle": false, - "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "_integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "_location": "/aproba", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "aproba@1.2.0", + "raw": "aproba@2.0.0", "name": "aproba", "escapedName": "aproba", - "rawSpec": "1.2.0", + "rawSpec": "2.0.0", "saveSpec": null, - "fetchSpec": "1.2.0" + "fetchSpec": "2.0.0" }, "_requiredBy": [ + "#USER", "/", - "/copy-concurrently", - "/gauge", - "/gentle-fs", - "/move-concurrently", - "/npm-profile", - "/run-queue" + "/npm-profile" ], - "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "_spec": "1.2.0", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "_shasum": "52520b8ae5b569215b354efc0caa3fe1e45a8adc", + "_spec": "aproba@2.0.0", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Rebecca Turner", "email": "me@re-becca.org" @@ -40,11 +31,13 @@ "bugs": { "url": "https://github.com/iarna/aproba/issues" }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, "description": "A ridiculously light-weight argument validator (now browser friendly)", "devDependencies": { - "standard": "^10.0.3", - "tap": "^10.0.2" + "standard": "^11.0.1", + "tap": "^12.0.1" }, "directories": { "test": "test" @@ -65,7 +58,8 @@ "url": "git+https://github.com/iarna/aproba.git" }, "scripts": { - "test": "standard && tap -j3 test/*.js" + "pretest": "standard", + "test": "tap --100 -J test/*.js" }, - "version": "1.2.0" + "version": "2.0.0" } diff --git a/deps/npm/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/.travis.yml similarity index 100% rename from deps/npm/node_modules/readable-stream/.travis.yml rename to deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/.travis.yml diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/CONTRIBUTING.md b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 00000000000000..f478d58dca85b2 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a 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. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 00000000000000..16ffb93f24bece --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/README.md b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/README.md new file mode 100644 index 00000000000000..23fe3f3e3009a2 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/README.md @@ -0,0 +1,58 @@ +# readable-stream + +***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). + +If 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, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md similarity index 99% rename from deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md rename to deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md index 83275f192e4077..c141a99c26c638 100644 --- a/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -56,5 +56,3 @@ simpler stream creation * add isPaused/isFlowing * add new docs section * move isPaused to that section - - diff --git a/deps/npm/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/duplex-browser.js similarity index 100% rename from deps/npm/node_modules/readable-stream/duplex-browser.js rename to deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/duplex-browser.js diff --git a/deps/npm/node_modules/readable-stream/duplex.js b/deps/npm/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/are-we-there-yet/node_modules/readable-stream/duplex.js diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000000000..a1ca813e5acbd8 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,131 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000000000..a9c835884828d8 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,47 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000000000..bf34ac65e1108f --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1019 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000000000..5d1f8b876d98c7 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,214 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000000000..b3f4e85a2f6e35 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,687 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/BufferList.js similarity index 100% rename from deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js rename to deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/BufferList.js diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 00000000000000..5a0a0d88cec6f3 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,74 @@ +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; \ No newline at end of file diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 00000000000000..9332a3fdae7060 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 00000000000000..ce2ad5b6ee57f4 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/package.json b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..387f98ab910c0e --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/package.json @@ -0,0 +1,81 @@ +{ + "_from": "readable-stream@^2.0.6", + "_id": "readable-stream@2.3.6", + "_inBundle": false, + "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "_location": "/are-we-there-yet/readable-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "readable-stream@^2.0.6", + "name": "readable-stream", + "escapedName": "readable-stream", + "rawSpec": "^2.0.6", + "saveSpec": null, + "fetchSpec": "^2.0.6" + }, + "_requiredBy": [ + "/are-we-there-yet" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", + "_spec": "readable-stream@^2.0.6", + "_where": "/Users/aeschright/code/cli/node_modules/are-we-there-yet", + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "deprecated": false, + "description": "Streams3, a user-land copy of the stream library from Node.js", + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "license": "MIT", + "main": "readable.js", + "name": "readable-stream", + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov", + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" + }, + "version": "2.3.6" +} diff --git a/deps/npm/node_modules/readable-stream/passthrough.js b/deps/npm/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/are-we-there-yet/node_modules/readable-stream/passthrough.js diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/readable-browser.js new file mode 100644 index 00000000000000..e50372592ee6c6 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/readable.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/readable.js new file mode 100644 index 00000000000000..ec89ec53306497 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/deps/npm/node_modules/readable-stream/transform.js b/deps/npm/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/are-we-there-yet/node_modules/readable-stream/transform.js diff --git a/deps/npm/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/writable-browser.js similarity index 100% rename from deps/npm/node_modules/readable-stream/writable-browser.js rename to deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/writable-browser.js diff --git a/deps/npm/node_modules/readable-stream/writable.js b/deps/npm/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/are-we-there-yet/node_modules/readable-stream/writable.js diff --git a/deps/npm/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/.travis.yml similarity index 100% rename from deps/npm/node_modules/string_decoder/.travis.yml rename to deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/.travis.yml diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/README.md b/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/README.md new file mode 100644 index 00000000000000..5fd58315ed5880 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/README.md @@ -0,0 +1,47 @@ +# string_decoder + +***Node-core v8.9.4 string_decoder for userland*** + + +[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) +[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) + + +```bash +npm install --save string_decoder +``` + +***Node-core string_decoder for userland*** + +This package is a mirror of the string_decoder implementation in Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). + +As of version 1.0.0 **string_decoder** uses semantic versioning. + +## Previous versions + +Previous version 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. + +## Update + +The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. + +## Streams Working Group + +`string_decoder` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + +See [readable-stream](https://github.com/nodejs/readable-stream) for +more details. diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js new file mode 100644 index 00000000000000..2e89e63f7933e4 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js @@ -0,0 +1,296 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} \ No newline at end of file diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/package.json b/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/package.json new file mode 100644 index 00000000000000..1e76b8bffe4086 --- /dev/null +++ b/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/package.json @@ -0,0 +1,59 @@ +{ + "_from": "string_decoder@~1.1.1", + "_id": "string_decoder@1.1.1", + "_inBundle": false, + "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "_location": "/are-we-there-yet/string_decoder", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "string_decoder@~1.1.1", + "name": "string_decoder", + "escapedName": "string_decoder", + "rawSpec": "~1.1.1", + "saveSpec": null, + "fetchSpec": "~1.1.1" + }, + "_requiredBy": [ + "/are-we-there-yet/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", + "_spec": "string_decoder@~1.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/are-we-there-yet/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/nodejs/string_decoder/issues" + }, + "bundleDependencies": false, + "dependencies": { + "safe-buffer": "~5.1.0" + }, + "deprecated": false, + "description": "The string_decoder module from Node core", + "devDependencies": { + "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", + "tap": "~0.4.8" + }, + "homepage": "https://github.com/nodejs/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "main": "lib/string_decoder.js", + "name": "string_decoder", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "test": "tap test/parallel/*.js && node test/verify-dependencies" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/byte-size/README.hbs b/deps/npm/node_modules/byte-size/README.hbs index ebf5101b37002e..8a57e4a9c784a8 100644 --- a/deps/npm/node_modules/byte-size/README.hbs +++ b/deps/npm/node_modules/byte-size/README.hbs @@ -7,6 +7,34 @@ {{>main}} +### Load anywhere + +This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation. + +Node.js: + +```js +const byteSize = require('byte-size') +``` + +Within Node.js with ECMAScript Module support enabled: + +```js +import byteSize from 'byte-size' +``` + +Within a modern browser ECMAScript Module: + +```js +import byteSize from './node_modules/byte-size/index.mjs' +``` + +Old browser (adds `window.byteSize`): + +```html + +``` + * * * © 2014-18 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). diff --git a/deps/npm/node_modules/byte-size/README.md b/deps/npm/node_modules/byte-size/README.md index 768f21d347da20..4d383ad76b6a5a 100644 --- a/deps/npm/node_modules/byte-size/README.md +++ b/deps/npm/node_modules/byte-size/README.md @@ -8,7 +8,7 @@ ## byte-size -Convert a bytes value to a more human-readable format. Choose between [metric or IEC units](https://en.wikipedia.org/wiki/Gigabyte), summarised below. +An isomorphic, load-anywhere function to convert a bytes value into a more human-readable format. Choose between [metric or IEC units](https://en.wikipedia.org/wiki/Gigabyte), summarised below. Value | Metric ----- | ------------- @@ -100,6 +100,34 @@ const byteSize = require('byte-size') '1.5 Kio' ``` +### Load anywhere + +This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation. + +Node.js: + +```js +const byteSize = require('byte-size') +``` + +Within Node.js with ECMAScript Module support enabled: + +```js +import byteSize from 'byte-size' +``` + +Within a modern browser ECMAScript Module: + +```js +import byteSize from './node_modules/byte-size/index.mjs' +``` + +Old browser (adds `window.byteSize`): + +```html + +``` + * * * © 2014-18 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). diff --git a/deps/npm/node_modules/byte-size/dist/index.js b/deps/npm/node_modules/byte-size/dist/index.js new file mode 100644 index 00000000000000..8253a63545b3ac --- /dev/null +++ b/deps/npm/node_modules/byte-size/dist/index.js @@ -0,0 +1,152 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.byteSize = factory()); +}(this, function () { 'use strict'; + + /** + * An isomorphic, load-anywhere function to convert a bytes value into a more human-readable format. Choose between [metric or IEC units](https://en.wikipedia.org/wiki/Gigabyte), summarised below. + * + * Value | Metric + * ----- | ------------- + * 1000 | kB kilobyte + * 1000^2 | MB megabyte + * 1000^3 | GB gigabyte + * 1000^4 | TB terabyte + * 1000^5 | PB petabyte + * 1000^6 | EB exabyte + * 1000^7 | ZB zettabyte + * 1000^8 | YB yottabyte + * + * Value | IEC + * ----- | ------------ + * 1024 | KiB kibibyte + * 1024^2 | MiB mebibyte + * 1024^3 | GiB gibibyte + * 1024^4 | TiB tebibyte + * 1024^5 | PiB pebibyte + * 1024^6 | EiB exbibyte + * 1024^7 | ZiB zebibyte + * 1024^8 | YiB yobibyte + * + * Value | Metric (octet) + * ----- | ------------- + * 1000 | ko kilooctet + * 1000^2 | Mo megaoctet + * 1000^3 | Go gigaoctet + * 1000^4 | To teraoctet + * 1000^5 | Po petaoctet + * 1000^6 | Eo exaoctet + * 1000^7 | Zo zettaoctet + * 1000^8 | Yo yottaoctet + * + * Value | IEC (octet) + * ----- | ------------ + * 1024 | Kio kilooctet + * 1024^2 | Mio mebioctet + * 1024^3 | Gio gibioctet + * 1024^4 | Tio tebioctet + * 1024^5 | Pio pebioctet + * 1024^6 | Eio exbioctet + * 1024^7 | Zio zebioctet + * 1024^8 | Yio yobioctet + * + * @module byte-size + * @example + * ```js + * const byteSize = require('byte-size') + * ``` + */ + + class ByteSize { + constructor (bytes, options) { + options = options || {}; + options.units = options.units || 'metric'; + options.precision = typeof options.precision === 'undefined' ? 1 : options.precision; + + const table = [ + { expFrom: 0, expTo: 1, metric: 'B', iec: 'B', metric_octet: 'o', iec_octet: 'o' }, + { expFrom: 1, expTo: 2, metric: 'kB', iec: 'KiB', metric_octet: 'ko', iec_octet: 'Kio' }, + { expFrom: 2, expTo: 3, metric: 'MB', iec: 'MiB', metric_octet: 'Mo', iec_octet: 'Mio' }, + { expFrom: 3, expTo: 4, metric: 'GB', iec: 'GiB', metric_octet: 'Go', iec_octet: 'Gio' }, + { expFrom: 4, expTo: 5, metric: 'TB', iec: 'TiB', metric_octet: 'To', iec_octet: 'Tio' }, + { expFrom: 5, expTo: 6, metric: 'PB', iec: 'PiB', metric_octet: 'Po', iec_octet: 'Pio' }, + { expFrom: 6, expTo: 7, metric: 'EB', iec: 'EiB', metric_octet: 'Eo', iec_octet: 'Eio' }, + { expFrom: 7, expTo: 8, metric: 'ZB', iec: 'ZiB', metric_octet: 'Zo', iec_octet: 'Zio' }, + { expFrom: 8, expTo: 9, metric: 'YB', iec: 'YiB', metric_octet: 'Yo', iec_octet: 'Yio' } + ]; + + const base = options.units === 'metric' || options.units === 'metric_octet' ? 1000 : 1024; + const prefix = bytes < 0 ? '-' : ''; + bytes = Math.abs(bytes); + + for (let i = 0; i < table.length; i++) { + const lower = Math.pow(base, table[i].expFrom); + const upper = Math.pow(base, table[i].expTo); + if (bytes >= lower && bytes < upper) { + const units = table[i][options.units]; + if (i === 0) { + this.value = prefix + bytes; + this.unit = units; + return + } else { + this.value = prefix + (bytes / lower).toFixed(options.precision); + this.unit = units; + return + } + } + } + + this.value = prefix + bytes; + this.unit = ''; + } + + toString () { + return `${this.value} ${this.unit}`.trim() + } + } + + /** + * @param {number} - the bytes value to convert. + * @param [options] {object} - optional config. + * @param [options.precision=1] {number} - number of decimal places. + * @param [options.units=metric] {string} - select `'metric'`, `'iec'`, `'metric_octet'` or `'iec_octet'` units. + * @returns {{ value: string, unit: string}} + * @alias module:byte-size + * @example + * ```js + * > const byteSize = require('byte-size') + * + * > byteSize(1580) + * { value: '1.6', unit: 'kB' } + * + * > byteSize(1580, { units: 'iec' }) + * { value: '1.5', unit: 'KiB' } + * + * > byteSize(1580, { units: 'iec', precision: 3 }) + * { value: '1.543', unit: 'KiB' } + * + * > byteSize(1580, { units: 'iec', precision: 0 }) + * { value: '2', unit: 'KiB' } + * + * > byteSize(1580, { units: 'metric_octet' }) + * { value: '1.6', unit: 'ko' } + * + * > byteSize(1580, { units: 'iec_octet' }) + * { value: '1.5', unit: 'Kio' } + * + * > byteSize(1580, { units: 'iec_octet' }).toString() + * '1.5 Kio' + * + * > const { value, unit } = byteSize(1580, { units: 'iec_octet' }) + * > `${value} ${unit}` + * '1.5 Kio' + * ``` + */ + function byteSize (bytes, options) { + return new ByteSize(bytes, options) + } + + return byteSize; + +})); diff --git a/deps/npm/node_modules/byte-size/index.js b/deps/npm/node_modules/byte-size/index.mjs similarity index 90% rename from deps/npm/node_modules/byte-size/index.js rename to deps/npm/node_modules/byte-size/index.mjs index ec1a0293892e62..2de3e205b087c6 100644 --- a/deps/npm/node_modules/byte-size/index.js +++ b/deps/npm/node_modules/byte-size/index.mjs @@ -1,7 +1,5 @@ -'use strict' - /** - * Convert a bytes value to a more human-readable format. Choose between [metric or IEC units](https://en.wikipedia.org/wiki/Gigabyte), summarised below. + * An isomorphic, load-anywhere function to convert a bytes value into a more human-readable format. Choose between [metric or IEC units](https://en.wikipedia.org/wiki/Gigabyte), summarised below. * * Value | Metric * ----- | ------------- @@ -53,7 +51,6 @@ * const byteSize = require('byte-size') * ``` */ -module.exports = byteSize class ByteSize { constructor (bytes, options) { @@ -74,6 +71,8 @@ class ByteSize { ] const base = options.units === 'metric' || options.units === 'metric_octet' ? 1000 : 1024 + const prefix = bytes < 0 ? '-' : ''; + bytes = Math.abs(bytes); for (let i = 0; i < table.length; i++) { const lower = Math.pow(base, table[i].expFrom) @@ -81,18 +80,18 @@ class ByteSize { if (bytes >= lower && bytes < upper) { const units = table[i][options.units] if (i === 0) { - this.value = String(bytes) + this.value = prefix + bytes this.unit = units return } else { - this.value = (bytes / lower).toFixed(options.precision) + this.value = prefix + (bytes / lower).toFixed(options.precision) this.unit = units return } } } - this.value = String(bytes) + this.value = prefix + bytes this.unit = '' } @@ -141,3 +140,5 @@ class ByteSize { function byteSize (bytes, options) { return new ByteSize(bytes, options) } + +export default byteSize diff --git a/deps/npm/node_modules/byte-size/package.json b/deps/npm/node_modules/byte-size/package.json index f69fc683f38cc6..57e46ba988d9b5 100644 --- a/deps/npm/node_modules/byte-size/package.json +++ b/deps/npm/node_modules/byte-size/package.json @@ -1,32 +1,28 @@ { - "_args": [ - [ - "byte-size@4.0.3", - "/Users/rebecca/code/npm" - ] - ], - "_from": "byte-size@4.0.3", - "_id": "byte-size@4.0.3", + "_from": "byte-size@5.0.1", + "_id": "byte-size@5.0.1", "_inBundle": false, - "_integrity": "sha512-JGC3EV2bCzJH/ENSh3afyJrH4vwxbHTuO5ljLoI5+2iJOcEpMgP8T782jH9b5qGxf2mSUIp1lfGnfKNrRHpvVg==", + "_integrity": "sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw==", "_location": "/byte-size", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "byte-size@4.0.3", + "raw": "byte-size@5.0.1", "name": "byte-size", "escapedName": "byte-size", - "rawSpec": "4.0.3", + "rawSpec": "5.0.1", "saveSpec": null, - "fetchSpec": "4.0.3" + "fetchSpec": "5.0.1" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/byte-size/-/byte-size-4.0.3.tgz", - "_spec": "4.0.3", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz", + "_shasum": "4b651039a5ecd96767e71a3d7ed380e48bed4191", + "_spec": "byte-size@5.0.1", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Lloyd Brookes", "email": "75pound@gmail.com" @@ -34,6 +30,7 @@ "bugs": { "url": "https://github.com/75lb/byte-size/issues" }, + "bundleDependencies": false, "contributors": [ { "name": "Raul Perez", @@ -41,14 +38,20 @@ "url": "http://repejota.com" } ], + "deprecated": false, "description": "Convert a bytes (and octets) value to a more human-readable format. Choose between metric or IEC units.", "devDependencies": { - "coveralls": "^3.0.1", + "coveralls": "^3.0.2", "jsdoc-to-markdown": "^4.0.1", - "test-runner": "^0.5.0" + "rollup": "^0.68.1", + "test-runner": "^0.5.1" + }, + "engines": { + "node": ">=6.0.0" }, "files": [ - "index.js" + "index.mjs", + "dist/index.js" ], "homepage": "https://github.com/75lb/byte-size#readme", "keywords": [ @@ -62,6 +65,7 @@ "IEC" ], "license": "MIT", + "main": "dist/index.js", "name": "byte-size", "repository": { "type": "git", @@ -69,8 +73,11 @@ }, "scripts": { "cover": "istanbul cover ./node_modules/.bin/test-runner test.js && cat coverage/lcov.info | ./node_modules/.bin/coveralls", - "docs": "jsdoc2md -t README.hbs index.js > README.md; echo", - "test": "test-runner test.js" + "dist": "rollup -c dist/index.config.js", + "docs": "jsdoc2md -t README.hbs dist/index.js > README.md; echo", + "test": "npm run test:js && npm run test:mjs", + "test:js": "rollup -c dist/test.config.js && node dist/test.js", + "test:mjs": "node --experimental-modules test/test.mjs" }, - "version": "4.0.3" + "version": "5.0.1" } diff --git a/deps/npm/node_modules/cacache/CHANGELOG.md b/deps/npm/node_modules/cacache/CHANGELOG.md index ec9174f80d76cb..847174be70f4de 100644 --- a/deps/npm/node_modules/cacache/CHANGELOG.md +++ b/deps/npm/node_modules/cacache/CHANGELOG.md @@ -2,6 +2,36 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [11.3.2](https://github.com/zkat/cacache/compare/v11.3.1...v11.3.2) (2018-12-21) + + +### Bug Fixes + +* **get:** make sure to handle errors in the .then ([b10bcd0](https://github.com/zkat/cacache/commit/b10bcd0)) + + + + +## [11.3.1](https://github.com/zkat/cacache/compare/v11.3.0...v11.3.1) (2018-11-05) + + +### Bug Fixes + +* **get:** export hasContent.sync properly ([d76c920](https://github.com/zkat/cacache/commit/d76c920)) + + + + +# [11.3.0](https://github.com/zkat/cacache/compare/v11.2.0...v11.3.0) (2018-11-05) + + +### Features + +* **get:** add sync API for reading ([db1e094](https://github.com/zkat/cacache/commit/db1e094)) + + + # [11.2.0](https://github.com/zkat/cacache/compare/v11.1.0...v11.2.0) (2018-08-08) diff --git a/deps/npm/node_modules/cacache/get.js b/deps/npm/node_modules/cacache/get.js index 7bafe128e4bf38..008cb83a9ed87a 100644 --- a/deps/npm/node_modules/cacache/get.js +++ b/deps/npm/node_modules/cacache/get.js @@ -63,6 +63,55 @@ function getData (byDigest, cache, key, opts) { }) } +module.exports.sync = function get (cache, key, opts) { + return getDataSync(false, cache, key, opts) +} +module.exports.sync.byDigest = function getByDigest (cache, digest, opts) { + return getDataSync(true, cache, digest, opts) +} +function getDataSync (byDigest, cache, key, opts) { + opts = GetOpts(opts) + const memoized = ( + byDigest + ? memo.get.byDigest(cache, key, opts) + : memo.get(cache, key, opts) + ) + if (memoized && opts.memoize !== false) { + return byDigest ? memoized : { + metadata: memoized.entry.metadata, + data: memoized.data, + integrity: memoized.entry.integrity, + size: memoized.entry.size + } + } + const entry = !byDigest && index.find.sync(cache, key, opts) + if (!entry && !byDigest) { + throw new index.NotFoundError(cache, key) + } + const data = read.sync( + cache, + byDigest ? key : entry.integrity, + { + integrity: opts.integrity, + size: opts.size + } + ) + const res = byDigest + ? data + : { + metadata: entry.metadata, + data: data, + size: entry.size, + integrity: entry.integrity + } + if (opts.memoize && byDigest) { + memo.put.byDigest(cache, key, res, opts) + } else if (opts.memoize) { + memo.put(cache, entry, res.data, opts) + } + return res +} + module.exports.stream = getStream function getStream (cache, key, opts) { opts = GetOpts(opts) @@ -113,7 +162,7 @@ function getStream (cache, key, opts) { memoStream, stream ) - }, err => stream.emit('error', err)) + }).catch(err => stream.emit('error', err)) return stream } diff --git a/deps/npm/node_modules/cacache/lib/entry-index.js b/deps/npm/node_modules/cacache/lib/entry-index.js index 43fa7b95b1d0fe..29a688eea26abe 100644 --- a/deps/npm/node_modules/cacache/lib/entry-index.js +++ b/deps/npm/node_modules/cacache/lib/entry-index.js @@ -75,10 +75,36 @@ function insert (cache, key, integrity, opts) { }) } +module.exports.insert.sync = insertSync +function insertSync (cache, key, integrity, opts) { + opts = IndexOpts(opts) + const bucket = bucketPath(cache, key) + const entry = { + key, + integrity: integrity && ssri.stringify(integrity), + time: Date.now(), + size: opts.size, + metadata: opts.metadata + } + fixOwner.mkdirfix.sync(path.dirname(bucket), opts.uid, opts.gid) + const stringified = JSON.stringify(entry) + fs.appendFileSync( + bucket, `\n${hashEntry(stringified)}\t${stringified}` + ) + try { + fixOwner.chownr.sync(bucket, opts.uid, opts.gid) + } catch (err) { + if (err.code !== 'ENOENT') { + throw err + } + } + return formatEntry(cache, entry) +} + module.exports.find = find function find (cache, key) { const bucket = bucketPath(cache, key) - return bucketEntries(cache, bucket).then(entries => { + return bucketEntries(bucket).then(entries => { return entries.reduce((latest, next) => { if (next && next.key === key) { return formatEntry(cache, next) @@ -95,11 +121,36 @@ function find (cache, key) { }) } +module.exports.find.sync = findSync +function findSync (cache, key) { + const bucket = bucketPath(cache, key) + try { + return bucketEntriesSync(bucket).reduce((latest, next) => { + if (next && next.key === key) { + return formatEntry(cache, next) + } else { + return latest + } + }, null) + } catch (err) { + if (err.code === 'ENOENT') { + return null + } else { + throw err + } + } +} + module.exports.delete = del function del (cache, key, opts) { return insert(cache, key, null, opts) } +module.exports.delete.sync = delSync +function delSync (cache, key, opts) { + return insertSync(cache, key, null, opts) +} + module.exports.lsStream = lsStream function lsStream (cache) { const indexDir = bucketDir(cache) @@ -116,7 +167,6 @@ function lsStream (cache) { // "/cachename///*" return readdirOrEmpty(subbucketPath).map(entry => { const getKeyToEntry = bucketEntries( - cache, path.join(subbucketPath, entry) ).reduce((acc, entry) => { acc.set(entry.key, entry) @@ -152,32 +202,39 @@ function ls (cache) { }) } -function bucketEntries (cache, bucket, filter) { +function bucketEntries (bucket, filter) { return readFileAsync( bucket, 'utf8' - ).then(data => { - let entries = [] - data.split('\n').forEach(entry => { - if (!entry) { return } - const pieces = entry.split('\t') - if (!pieces[1] || hashEntry(pieces[1]) !== pieces[0]) { - // Hash is no good! Corruption or malice? Doesn't matter! - // EJECT EJECT - return - } - let obj - try { - obj = JSON.parse(pieces[1]) - } catch (e) { - // Entry is corrupted! - return - } - if (obj) { - entries.push(obj) - } - }) - return entries + ).then(data => _bucketEntries(data, filter)) +} + +function bucketEntriesSync (bucket, filter) { + const data = fs.readFileSync(bucket, 'utf8') + return _bucketEntries(data, filter) +} + +function _bucketEntries (data, filter) { + let entries = [] + data.split('\n').forEach(entry => { + if (!entry) { return } + const pieces = entry.split('\t') + if (!pieces[1] || hashEntry(pieces[1]) !== pieces[0]) { + // Hash is no good! Corruption or malice? Doesn't matter! + // EJECT EJECT + return + } + let obj + try { + obj = JSON.parse(pieces[1]) + } catch (e) { + // Entry is corrupted! + return + } + if (obj) { + entries.push(obj) + } }) + return entries } module.exports._bucketDir = bucketDir diff --git a/deps/npm/node_modules/cacache/lib/util/fix-owner.js b/deps/npm/node_modules/cacache/lib/util/fix-owner.js index 7000bff04807a0..0c8f9f87537b0b 100644 --- a/deps/npm/node_modules/cacache/lib/util/fix-owner.js +++ b/deps/npm/node_modules/cacache/lib/util/fix-owner.js @@ -31,6 +31,34 @@ function fixOwner (filepath, uid, gid) { ) } +module.exports.chownr.sync = fixOwnerSync +function fixOwnerSync (filepath, uid, gid) { + if (!process.getuid) { + // This platform doesn't need ownership fixing + return + } + if (typeof uid !== 'number' && typeof gid !== 'number') { + // There's no permissions override. Nothing to do here. + return + } + if ((typeof uid === 'number' && process.getuid() === uid) && + (typeof gid === 'number' && process.getgid() === gid)) { + // No need to override if it's already what we used. + return + } + try { + chownr.sync( + filepath, + typeof uid === 'number' ? uid : process.getuid(), + typeof gid === 'number' ? gid : process.getgid() + ) + } catch (err) { + if (err.code === 'ENOENT') { + return null + } + } +} + module.exports.mkdirfix = mkdirfix function mkdirfix (p, uid, gid, cb) { return mkdirp(p).then(made => { @@ -42,3 +70,21 @@ function mkdirfix (p, uid, gid, cb) { return fixOwner(p, uid, gid).then(() => null) }) } + +module.exports.mkdirfix.sync = mkdirfixSync +function mkdirfixSync (p, uid, gid) { + try { + const made = mkdirp.sync(p) + if (made) { + fixOwnerSync(made, uid, gid) + return made + } + } catch (err) { + if (err.code === 'EEXIST') { + fixOwnerSync(p, uid, gid) + return null + } else { + throw err + } + } +} diff --git a/deps/npm/node_modules/cacache/locales/en.js b/deps/npm/node_modules/cacache/locales/en.js index 22025cf0e895e6..1715fdb53cd3f6 100644 --- a/deps/npm/node_modules/cacache/locales/en.js +++ b/deps/npm/node_modules/cacache/locales/en.js @@ -18,12 +18,15 @@ x.ls.stream = cache => ls.stream(cache) x.get = (cache, key, opts) => get(cache, key, opts) x.get.byDigest = (cache, hash, opts) => get.byDigest(cache, hash, opts) +x.get.sync = (cache, key, opts) => get.sync(cache, key, opts) +x.get.sync.byDigest = (cache, key, opts) => get.sync.byDigest(cache, key, opts) x.get.stream = (cache, key, opts) => get.stream(cache, key, opts) x.get.stream.byDigest = (cache, hash, opts) => get.stream.byDigest(cache, hash, opts) x.get.copy = (cache, key, dest, opts) => get.copy(cache, key, dest, opts) x.get.copy.byDigest = (cache, hash, dest, opts) => get.copy.byDigest(cache, hash, dest, opts) x.get.info = (cache, key) => get.info(cache, key) x.get.hasContent = (cache, hash) => get.hasContent(cache, hash) +x.get.hasContent.sync = (cache, hash) => get.hasContent.sync(cache, hash) x.put = (cache, key, data, opts) => put(cache, key, data, opts) x.put.stream = (cache, key, opts) => put.stream(cache, key, opts) diff --git a/deps/npm/node_modules/cacache/locales/es.js b/deps/npm/node_modules/cacache/locales/es.js index 9a27de6585a231..ac4e4cfe7d2f46 100644 --- a/deps/npm/node_modules/cacache/locales/es.js +++ b/deps/npm/node_modules/cacache/locales/es.js @@ -18,12 +18,15 @@ x.ls.flujo = cache => ls.stream(cache) x.saca = (cache, clave, ops) => get(cache, clave, ops) x.saca.porHacheo = (cache, hacheo, ops) => get.byDigest(cache, hacheo, ops) +x.saca.sinc = (cache, clave, ops) => get.sync(cache, clave, ops) +x.saca.sinc.porHacheo = (cache, hacheo, ops) => get.sync.byDigest(cache, hacheo, ops) x.saca.flujo = (cache, clave, ops) => get.stream(cache, clave, ops) x.saca.flujo.porHacheo = (cache, hacheo, ops) => get.stream.byDigest(cache, hacheo, ops) x.sava.copia = (cache, clave, destino, opts) => get.copy(cache, clave, destino, opts) x.sava.copia.porHacheo = (cache, hacheo, destino, opts) => get.copy.byDigest(cache, hacheo, destino, opts) x.saca.info = (cache, clave) => get.info(cache, clave) x.saca.tieneDatos = (cache, hacheo) => get.hasContent(cache, hacheo) +x.saca.tieneDatos.sinc = (cache, hacheo) => get.hasContent.sync(cache, hacheo) x.mete = (cache, clave, datos, ops) => put(cache, clave, datos, ops) x.mete.flujo = (cache, clave, ops) => put.stream(cache, clave, ops) diff --git a/deps/npm/node_modules/npm-registry-client/LICENSE b/deps/npm/node_modules/cacache/node_modules/chownr/LICENSE similarity index 100% rename from deps/npm/node_modules/npm-registry-client/LICENSE rename to deps/npm/node_modules/cacache/node_modules/chownr/LICENSE diff --git a/deps/npm/node_modules/cacache/node_modules/chownr/README.md b/deps/npm/node_modules/cacache/node_modules/chownr/README.md new file mode 100644 index 00000000000000..70e9a54a32b8e0 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/chownr/README.md @@ -0,0 +1,3 @@ +Like `chown -R`. + +Takes the same arguments as `fs.chown()` diff --git a/deps/npm/node_modules/cacache/node_modules/chownr/chownr.js b/deps/npm/node_modules/cacache/node_modules/chownr/chownr.js new file mode 100644 index 00000000000000..7e63928827e2c6 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/chownr/chownr.js @@ -0,0 +1,88 @@ +'use strict' +const fs = require('fs') +const path = require('path') + +/* istanbul ignore next */ +const LCHOWN = fs.lchown ? 'lchown' : 'chown' +/* istanbul ignore next */ +const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync' + +// fs.readdir could only accept an options object as of node v6 +const nodeVersion = process.version +let readdir = (path, options, cb) => fs.readdir(path, options, cb) +let readdirSync = (path, options) => fs.readdirSync(path, options) +/* istanbul ignore next */ +if (/^v4\./.test(nodeVersion)) + readdir = (path, options, cb) => fs.readdir(path, cb) + +const chownrKid = (p, child, uid, gid, cb) => { + if (typeof child === 'string') + return fs.lstat(path.resolve(p, child), (er, stats) => { + if (er) + return cb(er) + stats.name = child + chownrKid(p, stats, uid, gid, cb) + }) + + if (child.isDirectory()) { + chownr(path.resolve(p, child.name), uid, gid, er => { + if (er) + return cb(er) + fs[LCHOWN](path.resolve(p, child.name), uid, gid, cb) + }) + } else + fs[LCHOWN](path.resolve(p, child.name), uid, gid, cb) +} + + +const chownr = (p, uid, gid, cb) => { + readdir(p, { withFileTypes: true }, (er, children) => { + // any error other than ENOTDIR or ENOTSUP means it's not readable, + // or doesn't exist. give up. + if (er && er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP') + return cb(er) + if (er || !children.length) return fs[LCHOWN](p, uid, gid, cb) + + let len = children.length + let errState = null + const then = er => { + if (errState) return + if (er) return cb(errState = er) + if (-- len === 0) return fs[LCHOWN](p, uid, gid, cb) + } + + children.forEach(child => chownrKid(p, child, uid, gid, then)) + }) +} + +const chownrKidSync = (p, child, uid, gid) => { + if (typeof child === 'string') { + const stats = fs.lstatSync(path.resolve(p, child)) + stats.name = child + child = stats + } + + if (child.isDirectory()) + chownrSync(path.resolve(p, child.name), uid, gid) + + fs[LCHOWNSYNC](path.resolve(p, child.name), uid, gid) +} + +const chownrSync = (p, uid, gid) => { + let children + try { + children = readdirSync(p, { withFileTypes: true }) + } catch (er) { + if (er && er.code === 'ENOTDIR' && er.code !== 'ENOTSUP') + return fs[LCHOWNSYNC](p, uid, gid) + throw er + } + + if (children.length) + children.forEach(child => chownrKidSync(p, child, uid, gid)) + + return fs[LCHOWNSYNC](p, uid, gid) +} + +module.exports = chownr +chownr.sync = chownrSync diff --git a/deps/npm/node_modules/cacache/node_modules/chownr/package.json b/deps/npm/node_modules/cacache/node_modules/chownr/package.json new file mode 100644 index 00000000000000..4871f94bf391d7 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/chownr/package.json @@ -0,0 +1,59 @@ +{ + "_from": "chownr@^1.1.1", + "_id": "chownr@1.1.1", + "_inBundle": false, + "_integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "_location": "/cacache/chownr", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "chownr@^1.1.1", + "name": "chownr", + "escapedName": "chownr", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/cacache" + ], + "_resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "_shasum": "54726b8b8fff4df053c42187e801fb4412df1494", + "_spec": "chownr@^1.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/cacache", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/chownr/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "like `chown -R`", + "devDependencies": { + "mkdirp": "0.3", + "rimraf": "", + "tap": "^12.0.1" + }, + "files": [ + "chownr.js" + ], + "homepage": "https://github.com/isaacs/chownr#readme", + "license": "ISC", + "main": "chownr.js", + "name": "chownr", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/chownr.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --cov" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/cacache/node_modules/lru-cache/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/lru-cache/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/README.md b/deps/npm/node_modules/cacache/node_modules/lru-cache/README.md new file mode 100644 index 00000000000000..435dfebb7e27d0 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/lru-cache/README.md @@ -0,0 +1,166 @@ +# lru cache + +A cache object that deletes the least-recently-used items. + +[![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache) + +## Installation: + +```javascript +npm install lru-cache --save +``` + +## Usage: + +```javascript +var LRU = require("lru-cache") + , options = { max: 500 + , length: function (n, key) { return n * 2 + key.length } + , dispose: function (key, n) { n.close() } + , maxAge: 1000 * 60 * 60 } + , cache = new LRU(options) + , otherCache = new LRU(50) // sets just the max size + +cache.set("key", "value") +cache.get("key") // "value" + +// non-string keys ARE fully supported +// but note that it must be THE SAME object, not +// just a JSON-equivalent object. +var someObject = { a: 1 } +cache.set(someObject, 'a value') +// Object keys are not toString()-ed +cache.set('[object Object]', 'a different value') +assert.equal(cache.get(someObject), 'a value') +// A similar object with same keys/values won't work, +// because it's a different object identity +assert.equal(cache.get({ a: 1 }), undefined) + +cache.reset() // empty the cache +``` + +If you put more stuff in it, then items will fall out. + +If you try to put an oversized thing in it, then it'll fall out right +away. + +## Options + +* `max` The maximum size of the cache, checked by applying the length + function to all values in the cache. Not setting this is kind of + silly, since that's the whole purpose of this lib, but it defaults + to `Infinity`. Setting it to a non-number or negative number will + throw a `TypeError`. Setting it to 0 makes it be `Infinity`. +* `maxAge` Maximum age in ms. Items are not pro-actively pruned out + as they age, but if you try to get an item that is too old, it'll + drop it and return undefined instead of giving it to you. + Setting this to a negative value will make everything seem old! + Setting it to a non-number will throw a `TypeError`. +* `length` Function that is used to calculate the length of stored + items. If you're storing strings or buffers, then you probably want + to do something like `function(n, key){return n.length}`. The default is + `function(){return 1}`, which is fine if you want to store `max` + like-sized things. The item is passed as the first argument, and + the key is passed as the second argumnet. +* `dispose` Function that is called on items when they are dropped + from the cache. This can be handy if you want to close file + descriptors or do other cleanup tasks when items are no longer + accessible. Called with `key, value`. It's called *before* + actually removing the item from the internal cache, so if you want + to immediately put it back in, you'll have to do that in a + `nextTick` or `setTimeout` callback or it won't do anything. +* `stale` By default, if you set a `maxAge`, it'll only actually pull + stale items out of the cache when you `get(key)`. (That is, it's + not pre-emptively doing a `setTimeout` or anything.) If you set + `stale:true`, it'll return the stale value before deleting it. If + you don't set this, then it'll return `undefined` when you try to + get a stale entry, as if it had already been deleted. +* `noDisposeOnSet` By default, if you set a `dispose()` method, then + it'll be called whenever a `set()` operation overwrites an existing + key. If you set this option, `dispose()` will only be called when a + key falls out of the cache, not when it is overwritten. +* `updateAgeOnGet` When using time-expiring entries with `maxAge`, + setting this to `true` will make each item's effective time update + to the current time whenever it is retrieved from cache, causing it + to not expire. (It can still fall out of cache based on recency of + use, of course.) + +## API + +* `set(key, value, maxAge)` +* `get(key) => value` + + Both of these will update the "recently used"-ness of the key. + They do what you think. `maxAge` is optional and overrides the + cache `maxAge` option if provided. + + If the key is not found, `get()` will return `undefined`. + + The key and val can be any value. + +* `peek(key)` + + Returns the key value (or `undefined` if not found) without + updating the "recently used"-ness of the key. + + (If you find yourself using this a lot, you *might* be using the + wrong sort of data structure, but there are some use cases where + it's handy.) + +* `del(key)` + + Deletes a key out of the cache. + +* `reset()` + + Clear the cache entirely, throwing away all values. + +* `has(key)` + + Check if a key is in the cache, without updating the recent-ness + or deleting it for being stale. + +* `forEach(function(value,key,cache), [thisp])` + + Just like `Array.prototype.forEach`. Iterates over all the keys + in the cache, in order of recent-ness. (Ie, more recently used + items are iterated over first.) + +* `rforEach(function(value,key,cache), [thisp])` + + The same as `cache.forEach(...)` but items are iterated over in + reverse order. (ie, less recently used items are iterated over + first.) + +* `keys()` + + Return an array of the keys in the cache. + +* `values()` + + Return an array of the values in the cache. + +* `length` + + Return total length of objects in cache taking into account + `length` options function. + +* `itemCount` + + Return total quantity of objects currently in cache. Note, that + `stale` (see options) items are returned as part of this item + count. + +* `dump()` + + Return an array of the cache entries ready for serialization and usage + with 'destinationCache.load(arr)`. + +* `load(cacheEntriesArray)` + + Loads another cache entries array, obtained with `sourceCache.dump()`, + into the cache. The destination cache is reset before loading new entries + +* `prune()` + + Manually iterates over the entire cache proactively pruning old entries diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/index.js b/deps/npm/node_modules/cacache/node_modules/lru-cache/index.js new file mode 100644 index 00000000000000..573b6b85b9779d --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/lru-cache/index.js @@ -0,0 +1,334 @@ +'use strict' + +// A linked list to keep track of recently-used-ness +const Yallist = require('yallist') + +const MAX = Symbol('max') +const LENGTH = Symbol('length') +const LENGTH_CALCULATOR = Symbol('lengthCalculator') +const ALLOW_STALE = Symbol('allowStale') +const MAX_AGE = Symbol('maxAge') +const DISPOSE = Symbol('dispose') +const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') +const LRU_LIST = Symbol('lruList') +const CACHE = Symbol('cache') +const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') + +const naiveLength = () => 1 + +// lruList is a yallist where the head is the youngest +// item, and the tail is the oldest. the list contains the Hit +// objects as the entries. +// Each Hit object has a reference to its Yallist.Node. This +// never changes. +// +// cache is a Map (or PseudoMap) that matches the keys to +// the Yallist.Node object. +class LRUCache { + constructor (options) { + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} + + if (options.max && (typeof options.max !== 'number' || options.max < 0)) + throw new TypeError('max must be a non-negative number') + // Kind of weird to have a default max of Infinity, but oh well. + const max = this[MAX] = options.max || Infinity + + const lc = options.length || naiveLength + this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc + this[ALLOW_STALE] = options.stale || false + if (options.maxAge && typeof options.maxAge !== 'number') + throw new TypeError('maxAge must be a number') + this[MAX_AGE] = options.maxAge || 0 + this[DISPOSE] = options.dispose + this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false + this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false + this.reset() + } + + // resize the cache when the max changes. + set max (mL) { + if (typeof mL !== 'number' || mL < 0) + throw new TypeError('max must be a non-negative number') + + this[MAX] = mL || Infinity + trim(this) + } + get max () { + return this[MAX] + } + + set allowStale (allowStale) { + this[ALLOW_STALE] = !!allowStale + } + get allowStale () { + return this[ALLOW_STALE] + } + + set maxAge (mA) { + if (typeof mA !== 'number') + throw new TypeError('maxAge must be a non-negative number') + + this[MAX_AGE] = mA + trim(this) + } + get maxAge () { + return this[MAX_AGE] + } + + // resize the cache when the lengthCalculator changes. + set lengthCalculator (lC) { + if (typeof lC !== 'function') + lC = naiveLength + + if (lC !== this[LENGTH_CALCULATOR]) { + this[LENGTH_CALCULATOR] = lC + this[LENGTH] = 0 + this[LRU_LIST].forEach(hit => { + hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) + this[LENGTH] += hit.length + }) + } + trim(this) + } + get lengthCalculator () { return this[LENGTH_CALCULATOR] } + + get length () { return this[LENGTH] } + get itemCount () { return this[LRU_LIST].length } + + rforEach (fn, thisp) { + thisp = thisp || this + for (let walker = this[LRU_LIST].tail; walker !== null;) { + const prev = walker.prev + forEachStep(this, fn, walker, thisp) + walker = prev + } + } + + forEach (fn, thisp) { + thisp = thisp || this + for (let walker = this[LRU_LIST].head; walker !== null;) { + const next = walker.next + forEachStep(this, fn, walker, thisp) + walker = next + } + } + + keys () { + return this[LRU_LIST].toArray().map(k => k.key) + } + + values () { + return this[LRU_LIST].toArray().map(k => k.value) + } + + reset () { + if (this[DISPOSE] && + this[LRU_LIST] && + this[LRU_LIST].length) { + this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) + } + + this[CACHE] = new Map() // hash of items by key + this[LRU_LIST] = new Yallist() // list of items in order of use recency + this[LENGTH] = 0 // length of items in the list + } + + dump () { + return this[LRU_LIST].map(hit => + isStale(this, hit) ? false : { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }).toArray().filter(h => h) + } + + dumpLru () { + return this[LRU_LIST] + } + + set (key, value, maxAge) { + maxAge = maxAge || this[MAX_AGE] + + if (maxAge && typeof maxAge !== 'number') + throw new TypeError('maxAge must be a number') + + const now = maxAge ? Date.now() : 0 + const len = this[LENGTH_CALCULATOR](value, key) + + if (this[CACHE].has(key)) { + if (len > this[MAX]) { + del(this, this[CACHE].get(key)) + return false + } + + const node = this[CACHE].get(key) + const item = node.value + + // dispose of the old one before overwriting + // split out into 2 ifs for better coverage tracking + if (this[DISPOSE]) { + if (!this[NO_DISPOSE_ON_SET]) + this[DISPOSE](key, item.value) + } + + item.now = now + item.maxAge = maxAge + item.value = value + this[LENGTH] += len - item.length + item.length = len + this.get(key) + trim(this) + return true + } + + const hit = new Entry(key, value, len, now, maxAge) + + // oversized objects fall out of cache automatically. + if (hit.length > this[MAX]) { + if (this[DISPOSE]) + this[DISPOSE](key, value) + + return false + } + + this[LENGTH] += hit.length + this[LRU_LIST].unshift(hit) + this[CACHE].set(key, this[LRU_LIST].head) + trim(this) + return true + } + + has (key) { + if (!this[CACHE].has(key)) return false + const hit = this[CACHE].get(key).value + return !isStale(this, hit) + } + + get (key) { + return get(this, key, true) + } + + peek (key) { + return get(this, key, false) + } + + pop () { + const node = this[LRU_LIST].tail + if (!node) + return null + + del(this, node) + return node.value + } + + del (key) { + del(this, this[CACHE].get(key)) + } + + load (arr) { + // reset the cache + this.reset() + + const now = Date.now() + // A previous serialized cache has the most recent items first + for (let l = arr.length - 1; l >= 0; l--) { + const hit = arr[l] + const expiresAt = hit.e || 0 + if (expiresAt === 0) + // the item was created without expiration in a non aged cache + this.set(hit.k, hit.v) + else { + const maxAge = expiresAt - now + // dont add already expired items + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge) + } + } + } + } + + prune () { + this[CACHE].forEach((value, key) => get(this, key, false)) + } +} + +const get = (self, key, doUse) => { + const node = self[CACHE].get(key) + if (node) { + const hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!self[ALLOW_STALE]) + return undefined + } else { + if (doUse) { + if (self[UPDATE_AGE_ON_GET]) + node.value.now = Date.now() + self[LRU_LIST].unshiftNode(node) + } + } + return hit.value + } +} + +const isStale = (self, hit) => { + if (!hit || (!hit.maxAge && !self[MAX_AGE])) + return false + + const diff = Date.now() - hit.now + return hit.maxAge ? diff > hit.maxAge + : self[MAX_AGE] && (diff > self[MAX_AGE]) +} + +const trim = self => { + if (self[LENGTH] > self[MAX]) { + for (let walker = self[LRU_LIST].tail; + self[LENGTH] > self[MAX] && walker !== null;) { + // We know that we're about to delete this one, and also + // what the next least recently used key will be, so just + // go ahead and set it now. + const prev = walker.prev + del(self, walker) + walker = prev + } + } +} + +const del = (self, node) => { + if (node) { + const hit = node.value + if (self[DISPOSE]) + self[DISPOSE](hit.key, hit.value) + + self[LENGTH] -= hit.length + self[CACHE].delete(hit.key) + self[LRU_LIST].removeNode(node) + } +} + +class Entry { + constructor (key, value, length, now, maxAge) { + this.key = key + this.value = value + this.length = length + this.now = now + this.maxAge = maxAge || 0 + } +} + +const forEachStep = (self, fn, node, thisp) => { + let hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!self[ALLOW_STALE]) + hit = undefined + } + if (hit) + fn.call(thisp, hit.value, hit.key, self) +} + +module.exports = LRUCache diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/package.json b/deps/npm/node_modules/cacache/node_modules/lru-cache/package.json new file mode 100644 index 00000000000000..1d41a07afbda4c --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/lru-cache/package.json @@ -0,0 +1,67 @@ +{ + "_from": "lru-cache@^5.1.1", + "_id": "lru-cache@5.1.1", + "_inBundle": false, + "_integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "_location": "/cacache/lru-cache", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lru-cache@^5.1.1", + "name": "lru-cache", + "escapedName": "lru-cache", + "rawSpec": "^5.1.1", + "saveSpec": null, + "fetchSpec": "^5.1.1" + }, + "_requiredBy": [ + "/cacache" + ], + "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "_shasum": "1da27e6710271947695daf6848e847f01d84b920", + "_spec": "lru-cache@^5.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/cacache", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "bundleDependencies": false, + "dependencies": { + "yallist": "^3.0.2" + }, + "deprecated": false, + "description": "A cache object that deletes the least-recently-used items.", + "devDependencies": { + "benchmark": "^2.1.4", + "tap": "^12.1.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/isaacs/node-lru-cache#readme", + "keywords": [ + "mru", + "lru", + "cache" + ], + "license": "ISC", + "main": "index.js", + "name": "lru-cache", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "scripts": { + "coveragerport": "tap --coverage-report=html", + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "snap": "TAP_SNAPSHOT=1 tap test/*.js -J", + "test": "tap test/*.js --100 -J" + }, + "version": "5.1.1" +} diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/LICENSE b/deps/npm/node_modules/cacache/node_modules/unique-filename/LICENSE new file mode 100644 index 00000000000000..69619c125ea7ef --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/LICENSE @@ -0,0 +1,5 @@ +Copyright npm, Inc + +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/cacache/node_modules/unique-filename/README.md b/deps/npm/node_modules/cacache/node_modules/unique-filename/README.md new file mode 100644 index 00000000000000..74b62b2ab4426e --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/README.md @@ -0,0 +1,33 @@ +unique-filename +=============== + +Generate a unique filename for use in temporary directories or caches. + +``` +var uniqueFilename = require('unique-filename') + +// returns something like: /tmp/912ec803b2ce49e4a541068d495ab570 +var randomTmpfile = uniqueFilename(os.tmpdir()) + +// returns something like: /tmp/my-test-912ec803b2ce49e4a541068d495ab570 +var randomPrefixedTmpfile = uniqueFilename(os.tmpdir(), 'my-test') + +var uniqueTmpfile = uniqueFilename('/tmp', 'testing', '/my/thing/to/uniq/on') +``` + +### uniqueFilename(*dir*, *fileprefix*, *uniqstr*) → String + +Returns the full path of a unique filename that looks like: +`dir/prefix-7ddd44c0` +or `dir/7ddd44c0` + +*dir* – The path you want the filename in. `os.tmpdir()` is a good choice for this. + +*fileprefix* – A string to append prior to the unique part of the filename. +The parameter is required if *uniqstr* is also passed in but is otherwise +optional and can be `undefined`/`null`/`''`. If present and not empty +then this string plus a hyphen are prepended to the unique part. + +*uniqstr* – Optional, if not passed the unique part of the resulting +filename will be random. If passed in it will be generated from this string +in a reproducable way. diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/__root__/index.html b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/__root__/index.html new file mode 100644 index 00000000000000..cd55391a67a4ce --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/__root__/index.html @@ -0,0 +1,73 @@ + + + + Code coverage report for __root__/ + + + + + + +
        +

        Code coverage report for __root__/

        +

        + Statements: 100% (4 / 4)      + Branches: 100% (2 / 2)      + Functions: 100% (1 / 1)      + Lines: 100% (4 / 4)      + Ignored: none      +

        +
        All files » __root__/
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        FileStatementsBranchesFunctionsLines
        index.js100%(4 / 4)100%(2 / 2)100%(1 / 1)100%(4 / 4)
        +
        +
        + + + + + + diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/__root__/index.js.html b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/__root__/index.js.html new file mode 100644 index 00000000000000..02e5768d3fb647 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/__root__/index.js.html @@ -0,0 +1,69 @@ + + + + Code coverage report for index.js + + + + + + +
        +

        Code coverage report for index.js

        +

        + Statements: 100% (4 / 4)      + Branches: 100% (2 / 2)      + Functions: 100% (1 / 1)      + Lines: 100% (4 / 4)      + Ignored: none      +

        +
        All files » __root__/ » index.js
        +
        +
        +
        
        +
        +
        1 +2 +3 +4 +5 +6 +7 +8 +9  +1 +  +1 +  +1 +6 +  + 
        'use strict'
        +var path = require('path')
        + 
        +var uniqueSlug = require('unique-slug')
        + 
        +module.exports = function (filepath, prefix, uniq) {
        +  return path.join(filepath, (prefix ? prefix + '-' : '') + uniqueSlug(uniq))
        +}
        + 
        + +
        + + + + + + diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/base.css b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/base.css new file mode 100644 index 00000000000000..a6a2f3284d0221 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/base.css @@ -0,0 +1,182 @@ +body, html { + margin:0; padding: 0; +} +body { + font-family: Helvetica Neue, Helvetica,Arial; + font-size: 10pt; +} +div.header, div.footer { + background: #eee; + padding: 1em; +} +div.header { + z-index: 100; + position: fixed; + top: 0; + border-bottom: 1px solid #666; + width: 100%; +} +div.footer { + border-top: 1px solid #666; +} +div.body { + margin-top: 10em; +} +div.meta { + font-size: 90%; + text-align: center; +} +h1, h2, h3 { + font-weight: normal; +} +h1 { + font-size: 12pt; +} +h2 { + font-size: 10pt; +} +pre { + font-family: Consolas, Menlo, Monaco, monospace; + margin: 0; + padding: 0; + line-height: 1.3; + font-size: 14px; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} + +div.path { font-size: 110%; } +div.path a:link, div.path a:visited { color: #000; } +table.coverage { border-collapse: collapse; margin:0; padding: 0 } + +table.coverage td { + margin: 0; + padding: 0; + color: #111; + vertical-align: top; +} +table.coverage td.line-count { + width: 50px; + text-align: right; + padding-right: 5px; +} +table.coverage td.line-coverage { + color: #777 !important; + text-align: right; + border-left: 1px solid #666; + border-right: 1px solid #666; +} + +table.coverage td.text { +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 40px; +} +table.coverage td span.cline-neutral { + background: #eee; +} +table.coverage td span.cline-yes { + background: #b5d592; + color: #999; +} +table.coverage td span.cline-no { + background: #fc8c84; +} + +.cstat-yes { color: #111; } +.cstat-no { background: #fc8c84; color: #111; } +.fstat-no { background: #ffc520; color: #111 !important; } +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + +.missing-if-branch { + display: inline-block; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: black; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} + +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} + +.entity, .metric { font-weight: bold; } +.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; } +.metric small { font-size: 80%; font-weight: normal; color: #666; } + +div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; } +div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; } +div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; } +div.coverage-summary th.file { border-right: none !important; } +div.coverage-summary th.pic { border-left: none !important; text-align: right; } +div.coverage-summary th.pct { border-right: none !important; } +div.coverage-summary th.abs { border-left: none !important; text-align: right; } +div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; } +div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; } +div.coverage-summary td.file { border-left: 1px solid #666; white-space: nowrap; } +div.coverage-summary td.pic { min-width: 120px !important; } +div.coverage-summary a:link { text-decoration: none; color: #000; } +div.coverage-summary a:visited { text-decoration: none; color: #777; } +div.coverage-summary a:hover { text-decoration: underline; } +div.coverage-summary tfoot td { border-top: 1px solid #666; } + +div.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +div.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +div.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} + +.high { background: #b5d592 !important; } +.medium { background: #ffe87c !important; } +.low { background: #fc8c84 !important; } + +span.cover-fill, span.cover-empty { + display:inline-block; + border:1px solid #444; + background: white; + height: 12px; +} +span.cover-fill { + background: #ccc; + border-right: 1px solid #444; +} +span.cover-empty { + background: white; + border-left: none; +} +span.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/index.html b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/index.html new file mode 100644 index 00000000000000..b10d186cc3978e --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/index.html @@ -0,0 +1,73 @@ + + + + Code coverage report for All files + + + + + + +
        +

        Code coverage report for All files

        +

        + Statements: 100% (4 / 4)      + Branches: 100% (2 / 2)      + Functions: 100% (1 / 1)      + Lines: 100% (4 / 4)      + Ignored: none      +

        +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        FileStatementsBranchesFunctionsLines
        __root__/100%(4 / 4)100%(2 / 2)100%(1 / 1)100%(4 / 4)
        +
        +
        + + + + + + diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/prettify.css b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/prettify.css new file mode 100644 index 00000000000000..b317a7cda31a44 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/prettify.js b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/prettify.js new file mode 100644 index 00000000000000..ef51e03866898f --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/sort-arrow-sprite.png b/deps/npm/node_modules/cacache/node_modules/unique-filename/coverage/sort-arrow-sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..03f704a609c6fd0dbfdac63466a7d7c958b5cbf3 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + el = getNthColumn(i).querySelector('.sorter'); + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/index.js b/deps/npm/node_modules/cacache/node_modules/unique-filename/index.js new file mode 100644 index 00000000000000..02bf1e273143c1 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/index.js @@ -0,0 +1,8 @@ +'use strict' +var path = require('path') + +var uniqueSlug = require('unique-slug') + +module.exports = function (filepath, prefix, uniq) { + return path.join(filepath, (prefix ? prefix + '-' : '') + uniqueSlug(uniq)) +} diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/package.json b/deps/npm/node_modules/cacache/node_modules/unique-filename/package.json new file mode 100644 index 00000000000000..7f245898c08aba --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/package.json @@ -0,0 +1,56 @@ +{ + "_from": "unique-filename@^1.1.1", + "_id": "unique-filename@1.1.1", + "_inBundle": false, + "_integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "_location": "/cacache/unique-filename", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unique-filename@^1.1.1", + "name": "unique-filename", + "escapedName": "unique-filename", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/cacache" + ], + "_resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "_shasum": "1d69769369ada0583103a1e6ae87681b56573230", + "_spec": "unique-filename@^1.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/cacache", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/unique-filename/issues" + }, + "bundleDependencies": false, + "dependencies": { + "unique-slug": "^2.0.0" + }, + "deprecated": false, + "description": "Generate a unique filename for use in temporary directories or caches.", + "devDependencies": { + "standard": "^5.4.1", + "tap": "^2.3.1" + }, + "homepage": "https://github.com/iarna/unique-filename", + "keywords": [], + "license": "ISC", + "main": "index.js", + "name": "unique-filename", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/unique-filename.git" + }, + "scripts": { + "test": "standard && tap test" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/cacache/node_modules/unique-filename/test/index.js b/deps/npm/node_modules/cacache/node_modules/unique-filename/test/index.js new file mode 100644 index 00000000000000..105b4e52e8b407 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/unique-filename/test/index.js @@ -0,0 +1,23 @@ +'sue strict' +var t = require('tap') +var uniqueFilename = require('../index.js') + +t.plan(6) + +var randomTmpfile = uniqueFilename('tmp') +t.like(randomTmpfile, /^tmp.[a-f0-9]{8}$/, 'random tmp file') + +var randomAgain = uniqueFilename('tmp') +t.notEqual(randomAgain, randomTmpfile, 'random tmp files are not the same') + +var randomPrefixedTmpfile = uniqueFilename('tmp', 'my-test') +t.like(randomPrefixedTmpfile, /^tmp.my-test-[a-f0-9]{8}$/, 'random prefixed tmp file') + +var randomPrefixedAgain = uniqueFilename('tmp', 'my-test') +t.notEqual(randomPrefixedAgain, randomPrefixedTmpfile, 'random prefixed tmp files are not the same') + +var uniqueTmpfile = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on') +t.like(uniqueTmpfile, /^tmp.testing-7ddd44c0$/, 'unique filename') + +var uniqueAgain = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on') +t.is(uniqueTmpfile, uniqueAgain, 'same unique string component produces same filename') diff --git a/deps/npm/node_modules/cacache/node_modules/yallist/LICENSE b/deps/npm/node_modules/cacache/node_modules/yallist/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/yallist/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/cacache/node_modules/yallist/README.md b/deps/npm/node_modules/cacache/node_modules/yallist/README.md new file mode 100644 index 00000000000000..f5861018696688 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/yallist/README.md @@ -0,0 +1,204 @@ +# yallist + +Yet Another Linked List + +There are many doubly-linked list implementations like it, but this +one is mine. + +For when an array would be too big, and a Map can't be iterated in +reverse order. + + +[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) + +## basic usage + +```javascript +var yallist = require('yallist') +var myList = yallist.create([1, 2, 3]) +myList.push('foo') +myList.unshift('bar') +// of course pop() and shift() are there, too +console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] +myList.forEach(function (k) { + // walk the list head to tail +}) +myList.forEachReverse(function (k, index, list) { + // walk the list tail to head +}) +var myDoubledList = myList.map(function (k) { + return k + k +}) +// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] +// mapReverse is also a thing +var myDoubledListReverse = myList.mapReverse(function (k) { + return k + k +}) // ['foofoo', 6, 4, 2, 'barbar'] + +var reduced = myList.reduce(function (set, entry) { + set += entry + return set +}, 'start') +console.log(reduced) // 'startfoo123bar' +``` + +## api + +The whole API is considered "public". + +Functions with the same name as an Array method work more or less the +same way. + +There's reverse versions of most things because that's the point. + +### Yallist + +Default export, the class that holds and manages a list. + +Call it with either a forEach-able (like an array) or a set of +arguments, to initialize the list. + +The Array-ish methods all act like you'd expect. No magic length, +though, so if you change that it won't automatically prune or add +empty spots. + +### Yallist.create(..) + +Alias for Yallist function. Some people like factories. + +#### yallist.head + +The first node in the list + +#### yallist.tail + +The last node in the list + +#### yallist.length + +The number of nodes in the list. (Change this at your peril. It is +not magic like Array length.) + +#### yallist.toArray() + +Convert the list to an array. + +#### yallist.forEach(fn, [thisp]) + +Call a function on each item in the list. + +#### yallist.forEachReverse(fn, [thisp]) + +Call a function on each item in the list, in reverse order. + +#### yallist.get(n) + +Get the data at position `n` in the list. If you use this a lot, +probably better off just using an Array. + +#### yallist.getReverse(n) + +Get the data at position `n`, counting from the tail. + +#### yallist.map(fn, thisp) + +Create a new Yallist with the result of calling the function on each +item. + +#### yallist.mapReverse(fn, thisp) + +Same as `map`, but in reverse. + +#### yallist.pop() + +Get the data from the list tail, and remove the tail from the list. + +#### yallist.push(item, ...) + +Insert one or more items to the tail of the list. + +#### yallist.reduce(fn, initialValue) + +Like Array.reduce. + +#### yallist.reduceReverse + +Like Array.reduce, but in reverse. + +#### yallist.reverse + +Reverse the list in place. + +#### yallist.shift() + +Get the data from the list head, and remove the head from the list. + +#### yallist.slice([from], [to]) + +Just like Array.slice, but returns a new Yallist. + +#### yallist.sliceReverse([from], [to]) + +Just like yallist.slice, but the result is returned in reverse. + +#### yallist.toArray() + +Create an array representation of the list. + +#### yallist.toArrayReverse() + +Create a reversed array representation of the list. + +#### yallist.unshift(item, ...) + +Insert one or more items to the head of the list. + +#### yallist.unshiftNode(node) + +Move a Node object to the front of the list. (That is, pull it out of +wherever it lives, and make it the new head.) + +If the node belongs to a different list, then that list will remove it +first. + +#### yallist.pushNode(node) + +Move a Node object to the end of the list. (That is, pull it out of +wherever it lives, and make it the new tail.) + +If the node belongs to a list already, then that list will remove it +first. + +#### yallist.removeNode(node) + +Remove a node from the list, preserving referential integrity of head +and tail and other nodes. + +Will throw an error if you try to have a list remove a node that +doesn't belong to it. + +### Yallist.Node + +The class that holds the data and is actually the list. + +Call with `var n = new Node(value, previousNode, nextNode)` + +Note that if you do direct operations on Nodes themselves, it's very +easy to get into weird states where the list is broken. Be careful :) + +#### node.next + +The next node in the list. + +#### node.prev + +The previous node in the list. + +#### node.value + +The data the node contains. + +#### node.list + +The list to which this node belongs. (Null if it does not belong to +any list.) diff --git a/deps/npm/node_modules/cacache/node_modules/yallist/iterator.js b/deps/npm/node_modules/cacache/node_modules/yallist/iterator.js new file mode 100644 index 00000000000000..d41c97a19f9849 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/yallist/iterator.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = function (Yallist) { + Yallist.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value + } + } +} diff --git a/deps/npm/node_modules/cacache/node_modules/yallist/package.json b/deps/npm/node_modules/cacache/node_modules/yallist/package.json new file mode 100644 index 00000000000000..91ea442aa86f1c --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/yallist/package.json @@ -0,0 +1,62 @@ +{ + "_from": "yallist@^3.0.2", + "_id": "yallist@3.0.3", + "_inBundle": false, + "_integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "_location": "/cacache/yallist", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "yallist@^3.0.2", + "name": "yallist", + "escapedName": "yallist", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/cacache/lru-cache" + ], + "_resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "_shasum": "b4b049e314be545e3ce802236d6cd22cd91c3de9", + "_spec": "yallist@^3.0.2", + "_where": "/Users/aeschright/code/cli/node_modules/cacache/node_modules/lru-cache", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/yallist/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Yet Another Linked List", + "devDependencies": { + "tap": "^12.1.0" + }, + "directories": { + "test": "test" + }, + "files": [ + "yallist.js", + "iterator.js" + ], + "homepage": "https://github.com/isaacs/yallist#readme", + "license": "ISC", + "main": "yallist.js", + "name": "yallist", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/yallist.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --100" + }, + "version": "3.0.3" +} diff --git a/deps/npm/node_modules/cacache/node_modules/yallist/yallist.js b/deps/npm/node_modules/cacache/node_modules/yallist/yallist.js new file mode 100644 index 00000000000000..b0ab36cf31b7a6 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/yallist/yallist.js @@ -0,0 +1,376 @@ +'use strict' +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self +} + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length-- + node.next = null + node.prev = null + node.list = null +} + +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length++ +} + +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length++ +} + +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined + } + + var res = this.tail.value + this.tail = this.tail.prev + if (this.tail) { + this.tail.next = null + } else { + this.head = null + } + this.length-- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) { + return undefined + } + + var res = this.head.value + this.head = this.head.next + if (this.head) { + this.head.prev = null + } else { + this.tail = null + } + this.length-- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this +} + +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } +} + +try { + // add if support for Symbol.iterator is present + require('./iterator.js')(Yallist) +} catch (er) {} diff --git a/deps/npm/node_modules/cacache/package.json b/deps/npm/node_modules/cacache/package.json index bf13242f80eb5f..7b45446dc710bc 100644 --- a/deps/npm/node_modules/cacache/package.json +++ b/deps/npm/node_modules/cacache/package.json @@ -1,19 +1,21 @@ { - "_from": "cacache@11.2.0", - "_id": "cacache@11.2.0", + "_from": "cacache@11.3.2", + "_id": "cacache@11.3.2", "_inBundle": false, - "_integrity": "sha512-IFWl6lfK6wSeYCHUXh+N1lY72UDrpyrYQJNIVQf48paDuWbv5RbAtJYf/4gUQFObTCHZwdZ5sI8Iw7nqwP6nlQ==", + "_integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==", "_location": "/cacache", - "_phantomChildren": {}, + "_phantomChildren": { + "unique-slug": "2.0.0" + }, "_requested": { "type": "version", "registry": true, - "raw": "cacache@11.2.0", + "raw": "cacache@11.3.2", "name": "cacache", "escapedName": "cacache", - "rawSpec": "11.2.0", + "rawSpec": "11.3.2", "saveSpec": null, - "fetchSpec": "11.2.0" + "fetchSpec": "11.3.2" }, "_requiredBy": [ "#USER", @@ -21,10 +23,10 @@ "/make-fetch-happen", "/pacote" ], - "_resolved": "https://registry.npmjs.org/cacache/-/cacache-11.2.0.tgz", - "_shasum": "617bdc0b02844af56310e411c0878941d5739965", - "_spec": "cacache@11.2.0", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz", + "_shasum": "2d81e308e3d258ca38125b676b98b2ac9ce69bfa", + "_spec": "cacache@11.3.2", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -56,19 +58,19 @@ } ], "dependencies": { - "bluebird": "^3.5.1", - "chownr": "^1.0.1", - "figgy-pudding": "^3.1.0", - "glob": "^7.1.2", - "graceful-fs": "^4.1.11", - "lru-cache": "^4.1.3", + "bluebird": "^3.5.3", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.3", + "graceful-fs": "^4.1.15", + "lru-cache": "^5.1.1", "mississippi": "^3.0.0", "mkdirp": "^0.5.1", "move-concurrently": "^1.0.1", "promise-inflight": "^1.0.1", "rimraf": "^2.6.2", - "ssri": "^6.0.0", - "unique-filename": "^1.1.0", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", "y18n": "^4.0.0" }, "deprecated": false, @@ -81,7 +83,7 @@ "standard": "^11.0.1", "standard-version": "^4.4.0", "tacks": "^1.2.7", - "tap": "^12.0.1", + "tap": "^12.1.1", "weallbehave": "^1.2.0", "weallcontribute": "^1.0.8" }, @@ -124,5 +126,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "11.2.0" + "version": "11.3.2" } diff --git a/deps/npm/node_modules/chownr/chownr.js b/deps/npm/node_modules/chownr/chownr.js index ecd7b452df57d7..7e63928827e2c6 100644 --- a/deps/npm/node_modules/chownr/chownr.js +++ b/deps/npm/node_modules/chownr/chownr.js @@ -1,52 +1,88 @@ -module.exports = chownr -chownr.sync = chownrSync +'use strict' +const fs = require('fs') +const path = require('path') + +/* istanbul ignore next */ +const LCHOWN = fs.lchown ? 'lchown' : 'chown' +/* istanbul ignore next */ +const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync' + +// fs.readdir could only accept an options object as of node v6 +const nodeVersion = process.version +let readdir = (path, options, cb) => fs.readdir(path, options, cb) +let readdirSync = (path, options) => fs.readdirSync(path, options) +/* istanbul ignore next */ +if (/^v4\./.test(nodeVersion)) + readdir = (path, options, cb) => fs.readdir(path, cb) + +const chownrKid = (p, child, uid, gid, cb) => { + if (typeof child === 'string') + return fs.lstat(path.resolve(p, child), (er, stats) => { + if (er) + return cb(er) + stats.name = child + chownrKid(p, stats, uid, gid, cb) + }) -var fs = require("fs") -, path = require("path") - -function chownr (p, uid, gid, cb) { - fs.readdir(p, function (er, children) { - // any error other than ENOTDIR means it's not readable, or - // doesn't exist. give up. - if (er && er.code !== "ENOTDIR") return cb(er) - if (er || !children.length) return fs.chown(p, uid, gid, cb) - - var len = children.length - , 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()) - chownr(pathChild, uid, gid, then) - else - then() - }) + if (child.isDirectory()) { + chownr(path.resolve(p, child.name), uid, gid, er => { + if (er) + return cb(er) + fs[LCHOWN](path.resolve(p, child.name), uid, gid, cb) }) - function then (er) { + } else + fs[LCHOWN](path.resolve(p, child.name), uid, gid, cb) +} + + +const chownr = (p, uid, gid, cb) => { + readdir(p, { withFileTypes: true }, (er, children) => { + // any error other than ENOTDIR or ENOTSUP means it's not readable, + // or doesn't exist. give up. + if (er && er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP') + return cb(er) + if (er || !children.length) return fs[LCHOWN](p, uid, gid, cb) + + let len = children.length + let errState = null + const then = er => { if (errState) return if (er) return cb(errState = er) - if (-- len === 0) return fs.chown(p, uid, gid, cb) + if (-- len === 0) return fs[LCHOWN](p, uid, gid, cb) } + + children.forEach(child => chownrKid(p, child, uid, gid, then)) }) } -function chownrSync (p, uid, gid) { - var children +const chownrKidSync = (p, child, uid, gid) => { + if (typeof child === 'string') { + const stats = fs.lstatSync(path.resolve(p, child)) + stats.name = child + child = stats + } + + if (child.isDirectory()) + chownrSync(path.resolve(p, child.name), uid, gid) + + fs[LCHOWNSYNC](path.resolve(p, child.name), uid, gid) +} + +const chownrSync = (p, uid, gid) => { + let children try { - children = fs.readdirSync(p) + children = readdirSync(p, { withFileTypes: true }) } catch (er) { - if (er && er.code === "ENOTDIR") return fs.chownSync(p, uid, gid) + if (er && er.code === 'ENOTDIR' && er.code !== 'ENOTSUP') + return fs[LCHOWNSYNC](p, uid, gid) throw er } - if (!children.length) return fs.chownSync(p, uid, gid) - children.forEach(function (child) { - var pathChild = path.resolve(p, child) - var stats = fs.lstatSync(pathChild) - if (!stats.isSymbolicLink()) - chownrSync(pathChild, uid, gid) - }) - return fs.chownSync(p, uid, gid) + if (children.length) + children.forEach(child => chownrKidSync(p, child, uid, gid)) + + return fs[LCHOWNSYNC](p, uid, gid) } + +module.exports = chownr +chownr.sync = chownrSync diff --git a/deps/npm/node_modules/chownr/package.json b/deps/npm/node_modules/chownr/package.json index f9a67c82435f97..0004fa0e1eb005 100644 --- a/deps/npm/node_modules/chownr/package.json +++ b/deps/npm/node_modules/chownr/package.json @@ -1,36 +1,28 @@ { - "_args": [ - [ - "chownr@1.0.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "chownr@1.0.1", - "_id": "chownr@1.0.1", + "_from": "chownr@1.1.1", + "_id": "chownr@1.1.1", "_inBundle": false, - "_integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "_integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "_location": "/chownr", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "chownr@1.0.1", + "raw": "chownr@1.1.1", "name": "chownr", "escapedName": "chownr", - "rawSpec": "1.0.1", + "rawSpec": "1.1.1", "saveSpec": null, - "fetchSpec": "1.0.1" + "fetchSpec": "1.1.1" }, "_requiredBy": [ - "/", - "/cacache", - "/npm-profile/cacache", - "/npm-registry-fetch/cacache", - "/tar" + "#USER", + "/" ], - "_resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", - "_spec": "1.0.1", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "_shasum": "54726b8b8fff4df053c42187e801fb4412df1494", + "_spec": "chownr@1.1.1", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -39,11 +31,13 @@ "bugs": { "url": "https://github.com/isaacs/chownr/issues" }, + "bundleDependencies": false, + "deprecated": false, "description": "like `chown -R`", "devDependencies": { "mkdirp": "0.3", "rimraf": "", - "tap": "^1.2.0" + "tap": "^12.0.1" }, "files": [ "chownr.js" @@ -57,7 +51,10 @@ "url": "git://github.com/isaacs/chownr.git" }, "scripts": { - "test": "tap test/*.js" + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --cov" }, - "version": "1.0.1" + "version": "1.1.1" } diff --git a/deps/npm/node_modules/ci-info/CHANGELOG.md b/deps/npm/node_modules/ci-info/CHANGELOG.md index 859a0ad12a53b0..66b9cf0b28e48d 100644 --- a/deps/npm/node_modules/ci-info/CHANGELOG.md +++ b/deps/npm/node_modules/ci-info/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## v2.0.0 + +Breaking changes: + +* Drop support for Node.js end-of-life versions: 0.10, 0.12, 4, 5, 7, + and 9 +* Team Foundation Server will now be detected as Azure Pipelines. The + constant `ci.TFS` no longer exists - use `ci.AZURE_PIPELINES` instead +* Remove deprecated `ci.TDDIUM` constant - use `ci.SOLANDO` instead + +New features: + +* feat: support Azure Pipelines ([#23](https://github.com/watson/ci-info/pull/23)) +* feat: support Netlify CI ([#26](https://github.com/watson/ci-info/pull/26)) +* feat: support Bitbucket pipelines PR detection ([#27](https://github.com/watson/ci-info/pull/27)) + ## v1.6.0 * feat: add Sail CI support diff --git a/deps/npm/node_modules/ci-info/README.md b/deps/npm/node_modules/ci-info/README.md index c88be8f82d5df9..12c4f6217502c3 100644 --- a/deps/npm/node_modules/ci-info/README.md +++ b/deps/npm/node_modules/ci-info/README.md @@ -32,41 +32,42 @@ if (ci.isCI) { Officially supported CI servers: -| Name | Constant | -|------|----------| -| [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | -| [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | -| [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | -| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | -| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | -| [Buddy](https://buddy.works/) | `ci.BUDDY` | -| [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | -| [CircleCI](http://circleci.com) | `ci.CIRCLE` | -| [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | -| [Codeship](https://codeship.com) | `ci.CODESHIP` | -| [Drone](https://drone.io) | `ci.DRONE` | -| [dsari](https://github.com/rfinnie/dsari) | `ci.DSARI` | -| [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | -| [GoCD](https://www.go.cd/) | `ci.GOCD` | -| [Hudson](http://hudson-ci.org) | `ci.HUDSON` | -| [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | -| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | -| [Sail CI](https://sail.ci/) | `ci.SAIL` | -| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | -| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | -| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | -| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | -| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | -| [Team Foundation Server](https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx) by Microsoft | `ci.TFS` | -| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | -| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` | +| Name | Constant | isPR | +|------|----------|------| +| [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | 🚫 | +| [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | ✅ | +| [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) | `ci.AZURE_PIPELINES` | ✅ | +| [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | 🚫 | +| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | ✅ | +| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | ✅ | +| [Buddy](https://buddy.works/) | `ci.BUDDY` | ✅ | +| [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | ✅ | +| [CircleCI](http://circleci.com) | `ci.CIRCLE` | ✅ | +| [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | ✅ | +| [Codeship](https://codeship.com) | `ci.CODESHIP` | 🚫 | +| [Drone](https://drone.io) | `ci.DRONE` | ✅ | +| [dsari](https://github.com/rfinnie/dsari) | `ci.DSARI` | 🚫 | +| [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | 🚫 | +| [GoCD](https://www.go.cd/) | `ci.GOCD` | 🚫 | +| [Hudson](http://hudson-ci.org) | `ci.HUDSON` | 🚫 | +| [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | ✅ | +| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | 🚫 | +| [Netlify CI](https://www.netlify.com/) | `ci.NETLIFY` | ✅ | +| [Sail CI](https://sail.ci/) | `ci.SAIL` | ✅ | +| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | ✅ | +| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | ✅ | +| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | ✅ | +| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | 🚫 | +| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | 🚫 | +| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | 🚫 | +| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` | ✅ | ## API ### `ci.name` -A string. Will contain the name of the CI server the code is running on. -If not CI server is detected, it will be `null`. +Returns a string containing name of the CI server the code is running on. +If CI server is not detected, it returns `null`. Don't depend on the value of this string not to change for a specific vendor. If you find your self writing `ci.name === 'Travis CI'`, you @@ -74,8 +75,8 @@ most likely want to use `ci.TRAVIS` instead. ### `ci.isCI` -A boolean. Will be `true` if the code is running on a CI server. -Otherwise `false`. +Returns a boolean. Will be `true` if the code is running on a CI server, +otherwise `false`. Some CI servers not listed here might still trigger the `ci.isCI` boolean to be set to `true` if they use certain vendor neutral @@ -84,15 +85,15 @@ vendor specific boolean will be set to `true`. ### `ci.isPR` -A boolean if PR detection is supported for the current CI server. Will -be `true` if a PR is being tested. Otherwise `false`. If PR detection is +Returns a boolean if PR detection is supported for the current CI server. Will +be `true` if a PR is being tested, otherwise `false`. If PR detection is not supported for the current CI server, the value will be `null`. ### `ci.` -A vendor specific boolean constants is exposed for each support CI +A vendor specific boolean constant is exposed for each support CI vendor. A constant will be `true` if the code is determined to run on -the given CI server. Otherwise `false`. +the given CI server, otherwise `false`. Examples of vendor constants are `ci.TRAVIS` or `ci.APPVEYOR`. For a complete list, see the support table above. diff --git a/deps/npm/node_modules/ci-info/index.js b/deps/npm/node_modules/ci-info/index.js index 27794d49b3f21e..9928fee9d34c18 100644 --- a/deps/npm/node_modules/ci-info/index.js +++ b/deps/npm/node_modules/ci-info/index.js @@ -4,7 +4,7 @@ var vendors = require('./vendors.json') var env = process.env -// Used for testinging only +// Used for testing only Object.defineProperty(exports, '_vendors', { value: vendors.map(function (v) { return v.constant }) }) diff --git a/deps/npm/node_modules/ci-info/package.json b/deps/npm/node_modules/ci-info/package.json index ac37a5fcc85554..16e90c59a86037 100644 --- a/deps/npm/node_modules/ci-info/package.json +++ b/deps/npm/node_modules/ci-info/package.json @@ -1,29 +1,28 @@ { - "_from": "ci-info@1.6.0", - "_id": "ci-info@1.6.0", + "_from": "ci-info@2.0.0", + "_id": "ci-info@2.0.0", "_inBundle": false, - "_integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", + "_integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "_location": "/ci-info", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "ci-info@1.6.0", + "raw": "ci-info@2.0.0", "name": "ci-info", "escapedName": "ci-info", - "rawSpec": "1.6.0", + "rawSpec": "2.0.0", "saveSpec": null, - "fetchSpec": "1.6.0" + "fetchSpec": "2.0.0" }, "_requiredBy": [ "#USER", - "/", - "/is-ci" + "/" ], - "_resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", - "_shasum": "2ca20dbb9ceb32d4524a683303313f0304b1e497", - "_spec": "ci-info@1.6.0", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "_shasum": "67a9e964be31a51e15e5010d58e6f12834002f46", + "_spec": "ci-info@2.0.0", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Thomas Watson Steen", "email": "w@tson.dk", @@ -34,8 +33,8 @@ }, "bundleDependencies": false, "coordinates": [ - 55.778271, - 12.593091 + 55.778231, + 12.593179 ], "dependencies": {}, "deprecated": false, @@ -63,5 +62,5 @@ "scripts": { "test": "standard && node test.js" }, - "version": "1.6.0" + "version": "2.0.0" } diff --git a/deps/npm/node_modules/ci-info/vendors.json b/deps/npm/node_modules/ci-info/vendors.json index a157b78cea4af3..266a724ab2464e 100644 --- a/deps/npm/node_modules/ci-info/vendors.json +++ b/deps/npm/node_modules/ci-info/vendors.json @@ -5,6 +5,12 @@ "env": "APPVEYOR", "pr": "APPVEYOR_PULL_REQUEST_NUMBER" }, + { + "name": "Azure Pipelines", + "constant": "AZURE_PIPELINES", + "env": "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI", + "pr": "SYSTEM_PULLREQUEST_PULLREQUESTID" + }, { "name": "Bamboo", "constant": "BAMBOO", @@ -13,7 +19,8 @@ { "name": "Bitbucket Pipelines", "constant": "BITBUCKET", - "env": "BITBUCKET_COMMIT" + "env": "BITBUCKET_COMMIT", + "pr": "BITBUCKET_PR_ID" }, { "name": "Bitrise", @@ -92,6 +99,12 @@ "constant": "MAGNUM", "env": "MAGNUM" }, + { + "name": "Netlify CI", + "constant": "NETLIFY", + "env": "NETLIFY_BUILD_BASE", + "pr": { "env": "PULL_REQUEST", "ne": "false" } + }, { "name": "Sail CI", "constant": "SAIL", @@ -126,23 +139,11 @@ "constant": "TASKCLUSTER", "env": ["TASK_ID", "RUN_ID"] }, - { - "name": "Solano CI", - "constant": "TDDIUM", - "env": "TDDIUM", - "pr": "TDDIUM_PR_ID", - "deprecated": true - }, { "name": "TeamCity", "constant": "TEAMCITY", "env": "TEAMCITY_VERSION" }, - { - "name": "Team Foundation Server", - "constant": "TFS", - "env": "TF_BUILD" - }, { "name": "Travis CI", "constant": "TRAVIS", diff --git a/deps/npm/node_modules/cidr-regex/index.js b/deps/npm/node_modules/cidr-regex/index.js index 190cefa7bf7ca7..f141ce14ad0ddb 100644 --- a/deps/npm/node_modules/cidr-regex/index.js +++ b/deps/npm/node_modules/cidr-regex/index.js @@ -5,9 +5,9 @@ const ipRegex = require("ip-regex"); const v4 = ipRegex.v4().source + "\\/(3[0-2]|[12]?[0-9])"; const v6 = ipRegex.v6().source + "\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])"; -const ip = module.exports = opts => opts && opts.exact ? +const cidr = module.exports = opts => opts && opts.exact ? new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) : new RegExp(`(?:${v4})|(?:${v6})`, "g"); -ip.v4 = opts => opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, "g"); -ip.v6 = opts => opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, "g"); +cidr.v4 = opts => opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, "g"); +cidr.v6 = opts => opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, "g"); diff --git a/deps/npm/node_modules/cidr-regex/package.json b/deps/npm/node_modules/cidr-regex/package.json index 3aa8b4032c534f..4dd1196c17dc0f 100644 --- a/deps/npm/node_modules/cidr-regex/package.json +++ b/deps/npm/node_modules/cidr-regex/package.json @@ -1,32 +1,27 @@ { - "_args": [ - [ - "cidr-regex@2.0.9", - "/Users/rebecca/code/npm" - ] - ], - "_from": "cidr-regex@2.0.9", - "_id": "cidr-regex@2.0.9", + "_from": "cidr-regex@^2.0.10", + "_id": "cidr-regex@2.0.10", "_inBundle": false, - "_integrity": "sha512-F7/fBRUU45FnvSPjXdpIrc++WRSBdCiSTlyq4ZNhLKOlHFNWgtzZ0Fd+zrqI/J1j0wmlx/f5ZQDmD2GcbrNcmw==", + "_integrity": "sha512-sB3ogMQXWvreNPbJUZMRApxuRYd+KoIo4RGQ81VatjmMW6WJPo+IJZ2846FGItr9VzKo5w7DXzijPLGtSd0N3Q==", "_location": "/cidr-regex", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "range", "registry": true, - "raw": "cidr-regex@2.0.9", + "raw": "cidr-regex@^2.0.10", "name": "cidr-regex", "escapedName": "cidr-regex", - "rawSpec": "2.0.9", + "rawSpec": "^2.0.10", "saveSpec": null, - "fetchSpec": "2.0.9" + "fetchSpec": "^2.0.10" }, "_requiredBy": [ "/is-cidr" ], - "_resolved": "https://registry.npmjs.org/cidr-regex/-/cidr-regex-2.0.9.tgz", - "_spec": "2.0.9", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/cidr-regex/-/cidr-regex-2.0.10.tgz", + "_shasum": "af13878bd4ad704de77d6dc800799358b3afa70d", + "_spec": "cidr-regex@^2.0.10", + "_where": "/Users/aeschright/code/cli/node_modules/is-cidr", "author": { "name": "silverwind", "email": "me@silverwind.io" @@ -34,6 +29,7 @@ "bugs": { "url": "https://github.com/silverwind/cidr-regex/issues" }, + "bundleDependencies": false, "contributors": [ { "name": "Felipe Apostol", @@ -44,12 +40,13 @@ "dependencies": { "ip-regex": "^2.1.0" }, + "deprecated": false, "description": "Regular expression for matching IP addresses in CIDR notation", "devDependencies": { - "ava": "^0.25.0", - "eslint": "^4.19.1", - "eslint-config-silverwind": "^1.0.42", - "updates": "^3.0.0" + "eslint": "^5.6.0", + "eslint-config-silverwind": "^2.0.9", + "updates": "^4.3.0", + "ver": "^2.0.1" }, "engines": { "node": ">=4" @@ -77,5 +74,5 @@ "scripts": { "test": "make test" }, - "version": "2.0.9" + "version": "2.0.10" } diff --git a/deps/npm/node_modules/cli-table3/CHANGELOG.md b/deps/npm/node_modules/cli-table3/CHANGELOG.md index 62eb485bdf93da..3f6ba35f8393e3 100644 --- a/deps/npm/node_modules/cli-table3/CHANGELOG.md +++ b/deps/npm/node_modules/cli-table3/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## v0.5.1 (2018-07-19) + +#### :rocket: Enhancement +* [#21](https://github.com/cli-table/cli-table3/pull/21) Import type definition from `@types/cli-table2` ([@Turbo87](https://github.com/Turbo87)) + +#### Committers: 1 +- Tobias Bieniek ([Turbo87](https://github.com/Turbo87)) + + ## v0.5.0 (2018-06-11) #### :boom: Breaking Change @@ -18,10 +27,9 @@ * [#3](https://github.com/cli-table/cli-table3/pull/3) Add `yarn.lock` file. ([@Turbo87](https://github.com/Turbo87)) * [#1](https://github.com/cli-table/cli-table3/pull/1) Skip broken test. ([@Turbo87](https://github.com/Turbo87)) -#### Committers: 3 +#### Committers: 2 - Daniel Ruf ([DanielRuf](https://github.com/DanielRuf)) - Tobias Bieniek ([Turbo87](https://github.com/Turbo87)) -- [dependabot[bot]](https://github.com/apps/dependabot) ## v0.4.0 (2018-06-10) diff --git a/deps/npm/node_modules/cli-table3/index.d.ts b/deps/npm/node_modules/cli-table3/index.d.ts new file mode 100644 index 00000000000000..bdf17e270ea847 --- /dev/null +++ b/deps/npm/node_modules/cli-table3/index.d.ts @@ -0,0 +1,95 @@ +declare namespace CliTable3 { + type CharName = + "top" | + "top-mid" | + "top-left" | + "top-right" | + "bottom" | + "bottom-mid" | + "bottom-left" | + "bottom-right" | + "left" | + "left-mid" | + "mid" | + "mid-mid" | + "right" | + "right-mid" | + "middle"; + + type HorizontalAlignment = "left" | "center" | "right"; + type VerticalAlignment = "top" | "center" | "bottom"; + + interface TableOptions { + truncate: string; + colWidths: Array; + rowHeights: Array; + colAligns: HorizontalAlignment[]; + rowAligns: VerticalAlignment[]; + head: string[]; + wordWrap: boolean; + } + + interface TableInstanceOptions extends TableOptions { + chars: Record; + style: { + "padding-left": number; + "padding-right": number; + head: string[]; + border: string[]; + compact: boolean; + }; + } + + interface TableConstructorOptions extends Partial { + chars?: Partial>; + style?: Partial; + } + + type CellValue = boolean | number | string | null | undefined; + + interface CellOptions { + content: CellValue; + chars?: Partial>; + truncate?: string; + colSpan?: number; + rowSpan?: number; + hAlign?: HorizontalAlignment; + vAlign?: VerticalAlignment; + style?: { + "padding-left"?: number; + "padding-right"?: number; + head?: string[]; + border?: string[]; + }; + } + + interface GenericTable extends Array { + options: TableInstanceOptions; + readonly width: number; + } + + type Table = HorizontalTable | VerticalTable | CrossTable; + type Cell = CellValue | CellOptions; + + type HorizontalTable = GenericTable; + type HorizontalTableRow = Cell[]; + + type VerticalTable = GenericTable; + interface VerticalTableRow { + [name: string]: Cell; + } + + type CrossTable = GenericTable; + interface CrossTableRow { + [name: string]: Cell[]; + } +} + +interface CliTable3 { + new (options?: CliTable3.TableConstructorOptions): CliTable3.Table; + readonly prototype: CliTable3.Table; +} + +declare const CliTable3: CliTable3; + +export = CliTable3; diff --git a/deps/npm/node_modules/cli-table3/package.json b/deps/npm/node_modules/cli-table3/package.json index d0545c93f7df68..6ee81dc3f1b780 100644 --- a/deps/npm/node_modules/cli-table3/package.json +++ b/deps/npm/node_modules/cli-table3/package.json @@ -1,28 +1,29 @@ { - "_from": "cli-table3", - "_id": "cli-table3@0.5.0", + "_from": "cli-table3@0.5.1", + "_id": "cli-table3@0.5.1", "_inBundle": false, - "_integrity": "sha512-c7YHpUyO1SaKaO7kYtxd5NZ8FjAmSK3LpKkuzdwn+2CwpFxBpdoQLm+OAnnCfoEl7onKhN9PKQi1lsHuAIUqGQ==", + "_integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", "_location": "/cli-table3", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "cli-table3", + "raw": "cli-table3@0.5.1", "name": "cli-table3", "escapedName": "cli-table3", - "rawSpec": "", + "rawSpec": "0.5.1", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "0.5.1" }, "_requiredBy": [ "#USER", - "/" + "/", + "/npm-audit-report" ], - "_resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.0.tgz", - "_shasum": "adb2f025715f4466e67629783c8d73e9030eb4bd", - "_spec": "cli-table3", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", + "_shasum": "0252372d94dfc40dbd8df06005f48f31f656f202", + "_spec": "cli-table3@0.5.1", + "_where": "/Users/aeschright/code/cli", "author": { "name": "James Talmage" }, @@ -54,8 +55,8 @@ "eslint-plugin-prettier": "^2.6.0", "jest": "^23.1.0", "jest-runner-eslint": "^0.6.0", - "lerna-changelog": "^0.7.0", - "prettier": "1.13.5" + "lerna-changelog": "^0.8.0", + "prettier": "1.13.7" }, "directories": { "test": "test" @@ -65,6 +66,7 @@ }, "files": [ "src/", + "index.d.ts", "index.js" ], "homepage": "https://github.com/cli-table/cli-table3", @@ -124,5 +126,6 @@ "test": "jest --color", "test:watch": "jest --color --watchAll --notify" }, - "version": "0.5.0" + "types": "index.d.ts", + "version": "0.5.1" } diff --git a/deps/npm/node_modules/colors/LICENSE b/deps/npm/node_modules/colors/LICENSE index 3de4e33b482421..17880ff02972b2 100644 --- a/deps/npm/node_modules/colors/LICENSE +++ b/deps/npm/node_modules/colors/LICENSE @@ -1,3 +1,5 @@ +MIT License + Original Library - Copyright (c) Marak Squires @@ -20,4 +22,4 @@ 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 +THE SOFTWARE. diff --git a/deps/npm/node_modules/colors/README.md b/deps/npm/node_modules/colors/README.md index 7f128596365954..c0550bdd522ec4 100644 --- a/deps/npm/node_modules/colors/README.md +++ b/deps/npm/node_modules/colors/README.md @@ -1,4 +1,10 @@ -# colors.js [![Build Status](https://travis-ci.org/Marak/colors.js.svg?branch=master)](https://travis-ci.org/Marak/colors.js) +# colors.js +[![Build Status](https://travis-ci.org/Marak/colors.js.svg?branch=master)](https://travis-ci.org/Marak/colors.js) +[![version](https://img.shields.io/npm/v/colors.svg)](https://www.npmjs.org/package/colors) +[![dependencies](https://david-dm.org/Marak/colors.js.svg)](https://david-dm.org/Marak/colors.js) +[![devDependencies](https://david-dm.org/Marak/colors.js/dev-status.svg)](https://david-dm.org/Marak/colors.js#info=devDependencies) + +Please check out the [roadmap](ROADMAP.md) for upcoming features and releases. Please open Issues to provide feedback, and check the `develop` branch for the latest bleeding-edge updates. ## get color and style in your node.js console @@ -163,7 +169,7 @@ console.log(colors.warn("this is a warning")); ``` -You can also combine them: +### Combining Colors ```javascript var colors = require('colors'); diff --git a/deps/npm/node_modules/colors/examples/normal-usage.js b/deps/npm/node_modules/colors/examples/normal-usage.js index 2818741e1f9771..cc8d05ff4f23a4 100644 --- a/deps/npm/node_modules/colors/examples/normal-usage.js +++ b/deps/npm/node_modules/colors/examples/normal-usage.js @@ -1,34 +1,36 @@ var colors = require('../lib/index'); -console.log("First some yellow text".yellow); +console.log('First some yellow text'.yellow); -console.log("Underline that text".yellow.underline); +console.log('Underline that text'.yellow.underline); -console.log("Make it bold and red".red.bold); +console.log('Make it bold and red'.red.bold); -console.log(("Double Raindows All Day Long").rainbow) +console.log(('Double Raindows All Day Long').rainbow); -console.log("Drop the bass".trap) +console.log('Drop the bass'.trap); -console.log("DROP THE RAINBOW BASS".trap.rainbow) +console.log('DROP THE RAINBOW BASS'.trap.rainbow); +// styles not widely supported +console.log('Chains are also cool.'.bold.italic.underline.red); -console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported - -console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse + ' styles! '.yellow.bold); // styles not widely supported -console.log("Zebras are so fun!".zebra); +// styles not widely supported +console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse + + ' styles! '.yellow.bold); +console.log('Zebras are so fun!'.zebra); // // Remark: .strikethrough may not work with Mac OS Terminal App // -console.log("This is " + "not".strikethrough + " fun."); +console.log('This is ' + 'not'.strikethrough + ' fun.'); -console.log('Background color attack!'.black.bgWhite) -console.log('Use random styles on everything!'.random) -console.log('America, Heck Yeah!'.america) +console.log('Background color attack!'.black.bgWhite); +console.log('Use random styles on everything!'.random); +console.log('America, Heck Yeah!'.america); -console.log('Setting themes is useful') +console.log('Setting themes is useful'); // // Custom themes @@ -45,30 +47,35 @@ colors.setTheme({ help: 'cyan', warn: 'yellow', debug: 'blue', - error: 'red' + error: 'red', }); // outputs red text -console.log("this is an error".error); +console.log('this is an error'.error); // outputs yellow text -console.log("this is a warning".warn); +console.log('this is a warning'.warn); // outputs grey text -console.log("this is an input".input); +console.log('this is an input'.input); console.log('Generic logging theme as file'.green.bold.underline); // Load a theme from file -colors.setTheme(__dirname + '/../themes/generic-logging.js'); +try { + colors.setTheme(require(__dirname + '/../themes/generic-logging.js')); +} catch (err) { + console.log(err); +} // outputs red text -console.log("this is an error".error); +console.log('this is an error'.error); // outputs yellow text -console.log("this is a warning".warn); +console.log('this is a warning'.warn); // outputs grey text -console.log("this is an input".input); +console.log('this is an input'.input); + +// console.log("Don't summon".zalgo) -//console.log("Don't summon".zalgo) \ No newline at end of file diff --git a/deps/npm/node_modules/colors/examples/safe-string.js b/deps/npm/node_modules/colors/examples/safe-string.js index 47e5633afec5fd..bd22f2ff4ffc3b 100644 --- a/deps/npm/node_modules/colors/examples/safe-string.js +++ b/deps/npm/node_modules/colors/examples/safe-string.js @@ -1,41 +1,43 @@ var colors = require('../safe'); -console.log(colors.yellow("First some yellow text")); +console.log(colors.yellow('First some yellow text')); -console.log(colors.yellow.underline("Underline that text")); +console.log(colors.yellow.underline('Underline that text')); -console.log(colors.red.bold("Make it bold and red")); +console.log(colors.red.bold('Make it bold and red')); -console.log(colors.rainbow("Double Raindows All Day Long")) +console.log(colors.rainbow('Double Raindows All Day Long')); -console.log(colors.trap("Drop the bass")) +console.log(colors.trap('Drop the bass')); -console.log(colors.rainbow(colors.trap("DROP THE RAINBOW BASS"))); +console.log(colors.rainbow(colors.trap('DROP THE RAINBOW BASS'))); -console.log(colors.bold.italic.underline.red('Chains are also cool.')); // styles not widely supported +// styles not widely supported +console.log(colors.bold.italic.underline.red('Chains are also cool.')); +// styles not widely supported +console.log(colors.green('So ') + colors.underline('are') + ' ' + + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); -console.log(colors.green('So ') + colors.underline('are') + ' ' + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); // styles not widely supported +console.log(colors.zebra('Zebras are so fun!')); -console.log(colors.zebra("Zebras are so fun!")); - -console.log("This is " + colors.strikethrough("not") + " fun."); +console.log('This is ' + colors.strikethrough('not') + ' fun.'); console.log(colors.black.bgWhite('Background color attack!')); -console.log(colors.random('Use random styles on everything!')) +console.log(colors.random('Use random styles on everything!')); console.log(colors.america('America, Heck Yeah!')); -console.log('Setting themes is useful') +console.log('Setting themes is useful'); // // Custom themes // -//console.log('Generic logging theme as JSON'.green.bold.underline); +// console.log('Generic logging theme as JSON'.green.bold.underline); // Load theme with JSON literal colors.setTheme({ silly: 'rainbow', - input: 'grey', + input: 'blue', verbose: 'cyan', prompt: 'grey', info: 'green', @@ -43,31 +45,31 @@ colors.setTheme({ help: 'cyan', warn: 'yellow', debug: 'blue', - error: 'red' + error: 'red', }); // outputs red text -console.log(colors.error("this is an error")); +console.log(colors.error('this is an error')); // outputs yellow text -console.log(colors.warn("this is a warning")); +console.log(colors.warn('this is a warning')); -// outputs grey text -console.log(colors.input("this is an input")); +// outputs blue text +console.log(colors.input('this is an input')); // console.log('Generic logging theme as file'.green.bold.underline); // Load a theme from file -colors.setTheme(__dirname + '/../themes/generic-logging.js'); +colors.setTheme(require(__dirname + '/../themes/generic-logging.js')); // outputs red text -console.log(colors.error("this is an error")); +console.log(colors.error('this is an error')); // outputs yellow text -console.log(colors.warn("this is a warning")); +console.log(colors.warn('this is a warning')); // outputs grey text -console.log(colors.input("this is an input")); +console.log(colors.input('this is an input')); // console.log(colors.zalgo("Don't summon him")) diff --git a/deps/npm/node_modules/colors/index.d.ts b/deps/npm/node_modules/colors/index.d.ts new file mode 100644 index 00000000000000..baa70686535a78 --- /dev/null +++ b/deps/npm/node_modules/colors/index.d.ts @@ -0,0 +1,136 @@ +// Type definitions for Colors.js 1.2 +// Project: https://github.com/Marak/colors.js +// Definitions by: Bart van der Schoor , Staffan Eketorp +// Definitions: https://github.com/Marak/colors.js + +export interface Color { + (text: string): string; + + strip: Color; + stripColors: Color; + + black: Color; + red: Color; + green: Color; + yellow: Color; + blue: Color; + magenta: Color; + cyan: Color; + white: Color; + gray: Color; + grey: Color; + + bgBlack: Color; + bgRed: Color; + bgGreen: Color; + bgYellow: Color; + bgBlue: Color; + bgMagenta: Color; + bgCyan: Color; + bgWhite: Color; + + reset: Color; + bold: Color; + dim: Color; + italic: Color; + underline: Color; + inverse: Color; + hidden: Color; + strikethrough: Color; + + rainbow: Color; + zebra: Color; + america: Color; + trap: Color; + random: Color; + zalgo: Color; +} + +export function enable(): void; +export function disable(): void; +export function setTheme(theme: any): void; + +export let enabled: boolean; + +export const strip: Color; +export const stripColors: Color; + +export const black: Color; +export const red: Color; +export const green: Color; +export const yellow: Color; +export const blue: Color; +export const magenta: Color; +export const cyan: Color; +export const white: Color; +export const gray: Color; +export const grey: Color; + +export const bgBlack: Color; +export const bgRed: Color; +export const bgGreen: Color; +export const bgYellow: Color; +export const bgBlue: Color; +export const bgMagenta: Color; +export const bgCyan: Color; +export const bgWhite: Color; + +export const reset: Color; +export const bold: Color; +export const dim: Color; +export const italic: Color; +export const underline: Color; +export const inverse: Color; +export const hidden: Color; +export const strikethrough: Color; + +export const rainbow: Color; +export const zebra: Color; +export const america: Color; +export const trap: Color; +export const random: Color; +export const zalgo: Color; + +declare global { + interface String { + strip: string; + stripColors: string; + + black: string; + red: string; + green: string; + yellow: string; + blue: string; + magenta: string; + cyan: string; + white: string; + gray: string; + grey: string; + + bgBlack: string; + bgRed: string; + bgGreen: string; + bgYellow: string; + bgBlue: string; + bgMagenta: string; + bgCyan: string; + bgWhite: string; + + reset: string; + // @ts-ignore + bold: string; + dim: string; + italic: string; + underline: string; + inverse: string; + hidden: string; + strikethrough: string; + + rainbow: string; + zebra: string; + america: string; + trap: string; + random: string; + zalgo: string; + } +} diff --git a/deps/npm/node_modules/colors/lib/colors.js b/deps/npm/node_modules/colors/lib/colors.js index 823e3ddd0dd473..7ca90fa9036164 100644 --- a/deps/npm/node_modules/colors/lib/colors.js +++ b/deps/npm/node_modules/colors/lib/colors.js @@ -33,35 +33,45 @@ module['exports'] = colors; colors.themes = {}; +var util = require('util'); var ansiStyles = colors.styles = require('./styles'); var defineProps = Object.defineProperties; +var newLineRegex = new RegExp(/[\r\n]+/g); -colors.supportsColor = require('./system/supports-colors'); +colors.supportsColor = require('./system/supports-colors').supportsColor; -if (typeof colors.enabled === "undefined") { - colors.enabled = colors.supportsColor; +if (typeof colors.enabled === 'undefined') { + colors.enabled = colors.supportsColor() !== false; } -colors.stripColors = colors.strip = function(str){ - return ("" + str).replace(/\x1B\[\d+m/g, ''); +colors.enable = function() { + colors.enabled = true; }; +colors.disable = function() { + colors.enabled = false; +}; + +colors.stripColors = colors.strip = function(str) { + return ('' + str).replace(/\x1B\[\d+m/g, ''); +}; -var stylize = colors.stylize = function stylize (str, style) { +// eslint-disable-next-line no-unused-vars +var stylize = colors.stylize = function stylize(str, style) { if (!colors.enabled) { return str+''; } return ansiStyles[style].open + str + ansiStyles[style].close; -} +}; var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; -var escapeStringRegexp = function (str) { +var escapeStringRegexp = function(str) { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } - return str.replace(matchOperatorsRe, '\\$&'); -} + return str.replace(matchOperatorsRe, '\\$&'); +}; function build(_styles) { var builder = function builder() { @@ -74,15 +84,16 @@ function build(_styles) { return builder; } -var styles = (function () { +var styles = (function() { var ret = {}; ansiStyles.grey = ansiStyles.gray; - Object.keys(ansiStyles).forEach(function (key) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + Object.keys(ansiStyles).forEach(function(key) { + ansiStyles[key].closeRe = + new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); ret[key] = { - get: function () { + get: function() { return build(this._styles.concat(key)); - } + }, }; }); return ret; @@ -91,78 +102,81 @@ var styles = (function () { var proto = defineProps(function colors() {}, styles); function applyStyle() { - var args = arguments; - var argsLen = args.length; - var str = argsLen !== 0 && String(arguments[0]); - if (argsLen > 1) { - for (var a = 1; a < argsLen; a++) { - str += ' ' + args[a]; + var args = Array.prototype.slice.call(arguments); + + var str = args.map(function(arg) { + if (arg !== undefined && arg.constructor === String) { + return arg; + } else { + return util.inspect(arg); } - } + }).join(' '); if (!colors.enabled || !str) { return str; } + var newLinesPresent = str.indexOf('\n') != -1; + var nestedStyles = this._styles; var i = nestedStyles.length; while (i--) { var code = ansiStyles[nestedStyles[i]]; str = code.open + str.replace(code.closeRe, code.open) + code.close; + if (newLinesPresent) { + str = str.replace(newLineRegex, function(match) { + return code.close + match + code.open; + }); + } } return str; } -function applyTheme (theme) { +colors.setTheme = function(theme) { + if (typeof theme === 'string') { + console.log('colors.setTheme now only accepts an object, not a string. ' + + 'If you are trying to set a theme from a file, it is now your (the ' + + 'caller\'s) responsibility to require the file. The old syntax ' + + 'looked like colors.setTheme(__dirname + ' + + '\'/../themes/generic-logging.js\'); The new syntax looks like '+ + 'colors.setTheme(require(__dirname + ' + + '\'/../themes/generic-logging.js\'));'); + return; + } for (var style in theme) { - (function(style){ - colors[style] = function(str){ - if (typeof theme[style] === 'object'){ + (function(style) { + colors[style] = function(str) { + if (typeof theme[style] === 'object') { var out = str; - for (var i in theme[style]){ + for (var i in theme[style]) { out = colors[theme[style][i]](out); } return out; } return colors[theme[style]](str); }; - })(style) - } -} - -colors.setTheme = function (theme) { - if (typeof theme === 'string') { - try { - colors.themes[theme] = require(theme); - applyTheme(colors.themes[theme]); - return colors.themes[theme]; - } catch (err) { - console.log(err); - return err; - } - } else { - applyTheme(theme); + })(style); } }; function init() { var ret = {}; - Object.keys(styles).forEach(function (name) { + Object.keys(styles).forEach(function(name) { ret[name] = { - get: function () { + get: function() { return build([name]); - } + }, }; }); return ret; } -var sequencer = function sequencer (map, str) { - var exploded = str.split(""), i = 0; +var sequencer = function sequencer(map, str) { + var exploded = str.split(''); exploded = exploded.map(map); - return exploded.join(""); + return exploded.join(''); }; // custom formatter methods @@ -171,17 +185,17 @@ colors.zalgo = require('./custom/zalgo'); // maps colors.maps = {}; -colors.maps.america = require('./maps/america'); -colors.maps.zebra = require('./maps/zebra'); -colors.maps.rainbow = require('./maps/rainbow'); -colors.maps.random = require('./maps/random') +colors.maps.america = require('./maps/america')(colors); +colors.maps.zebra = require('./maps/zebra')(colors); +colors.maps.rainbow = require('./maps/rainbow')(colors); +colors.maps.random = require('./maps/random')(colors); for (var map in colors.maps) { - (function(map){ - colors[map] = function (str) { + (function(map) { + colors[map] = function(str) { return sequencer(colors.maps[map], str); - } - })(map) + }; + })(map); } -defineProps(colors, init()); \ No newline at end of file +defineProps(colors, init()); diff --git a/deps/npm/node_modules/colors/lib/custom/trap.js b/deps/npm/node_modules/colors/lib/custom/trap.js index 3f0914373817f8..fbccf88dede0b8 100644 --- a/deps/npm/node_modules/colors/lib/custom/trap.js +++ b/deps/npm/node_modules/colors/lib/custom/trap.js @@ -1,45 +1,46 @@ -module['exports'] = function runTheTrap (text, options) { - var result = ""; - text = text || "Run the trap, drop the bass"; +module['exports'] = function runTheTrap(text, options) { + var result = ''; + text = text || 'Run the trap, drop the bass'; text = text.split(''); var trap = { - a: ["\u0040", "\u0104", "\u023a", "\u0245", "\u0394", "\u039b", "\u0414"], - b: ["\u00df", "\u0181", "\u0243", "\u026e", "\u03b2", "\u0e3f"], - c: ["\u00a9", "\u023b", "\u03fe"], - d: ["\u00d0", "\u018a", "\u0500" , "\u0501" ,"\u0502", "\u0503"], - e: ["\u00cb", "\u0115", "\u018e", "\u0258", "\u03a3", "\u03be", "\u04bc", "\u0a6c"], - f: ["\u04fa"], - g: ["\u0262"], - h: ["\u0126", "\u0195", "\u04a2", "\u04ba", "\u04c7", "\u050a"], - i: ["\u0f0f"], - j: ["\u0134"], - k: ["\u0138", "\u04a0", "\u04c3", "\u051e"], - l: ["\u0139"], - m: ["\u028d", "\u04cd", "\u04ce", "\u0520", "\u0521", "\u0d69"], - n: ["\u00d1", "\u014b", "\u019d", "\u0376", "\u03a0", "\u048a"], - o: ["\u00d8", "\u00f5", "\u00f8", "\u01fe", "\u0298", "\u047a", "\u05dd", "\u06dd", "\u0e4f"], - p: ["\u01f7", "\u048e"], - q: ["\u09cd"], - r: ["\u00ae", "\u01a6", "\u0210", "\u024c", "\u0280", "\u042f"], - s: ["\u00a7", "\u03de", "\u03df", "\u03e8"], - t: ["\u0141", "\u0166", "\u0373"], - u: ["\u01b1", "\u054d"], - v: ["\u05d8"], - w: ["\u0428", "\u0460", "\u047c", "\u0d70"], - x: ["\u04b2", "\u04fe", "\u04fc", "\u04fd"], - y: ["\u00a5", "\u04b0", "\u04cb"], - z: ["\u01b5", "\u0240"] - } - text.forEach(function(c){ + a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'], + b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'], + c: ['\u00a9', '\u023b', '\u03fe'], + d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'], + e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc', + '\u0a6c'], + f: ['\u04fa'], + g: ['\u0262'], + h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'], + i: ['\u0f0f'], + j: ['\u0134'], + k: ['\u0138', '\u04a0', '\u04c3', '\u051e'], + l: ['\u0139'], + m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'], + n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'], + o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd', + '\u06dd', '\u0e4f'], + p: ['\u01f7', '\u048e'], + q: ['\u09cd'], + r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'], + s: ['\u00a7', '\u03de', '\u03df', '\u03e8'], + t: ['\u0141', '\u0166', '\u0373'], + u: ['\u01b1', '\u054d'], + v: ['\u05d8'], + w: ['\u0428', '\u0460', '\u047c', '\u0d70'], + x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'], + y: ['\u00a5', '\u04b0', '\u04cb'], + z: ['\u01b5', '\u0240'], + }; + text.forEach(function(c) { c = c.toLowerCase(); - var chars = trap[c] || [" "]; + var chars = trap[c] || [' ']; var rand = Math.floor(Math.random() * chars.length); - if (typeof trap[c] !== "undefined") { + if (typeof trap[c] !== 'undefined') { result += trap[c][rand]; } else { result += c; } }); return result; - -} +}; diff --git a/deps/npm/node_modules/colors/lib/custom/zalgo.js b/deps/npm/node_modules/colors/lib/custom/zalgo.js index 45c89a8d3027bf..01bdd2b802f626 100644 --- a/deps/npm/node_modules/colors/lib/custom/zalgo.js +++ b/deps/npm/node_modules/colors/lib/custom/zalgo.js @@ -1,8 +1,8 @@ // please no module['exports'] = function zalgo(text, options) { - text = text || " he is here "; + text = text || ' he is here '; var soul = { - "up" : [ + 'up': [ '̍', '̎', '̄', '̅', '̿', '̑', '̆', '̐', '͒', '͗', '͑', '̇', @@ -15,9 +15,9 @@ module['exports'] = function zalgo(text, options) { 'ͦ', 'ͧ', 'ͨ', 'ͩ', 'ͪ', 'ͫ', 'ͬ', 'ͭ', 'ͮ', 'ͯ', '̾', '͛', - '͆', '̚' + '͆', '̚', ], - "down" : [ + 'down': [ '̖', '̗', '̘', '̙', '̜', '̝', '̞', '̟', '̠', '̤', '̥', '̦', @@ -27,28 +27,27 @@ module['exports'] = function zalgo(text, options) { '̺', '̻', '̼', 'ͅ', '͇', '͈', '͉', '͍', '͎', '͓', '͔', '͕', - '͖', '͙', '͚', '̣' + '͖', '͙', '͚', '̣', ], - "mid" : [ + 'mid': [ '̕', '̛', '̀', '́', '͘', '̡', '̢', '̧', '̨', '̴', '̵', '̶', '͜', '͝', '͞', '͟', '͠', '͢', '̸', - '̷', '͡', ' ҉' - ] - }, - all = [].concat(soul.up, soul.down, soul.mid), - zalgo = {}; + '̷', '͡', ' ҉', + ], + }; + var all = [].concat(soul.up, soul.down, soul.mid); function randomNumber(range) { var r = Math.floor(Math.random() * range); return r; } - function is_char(character) { + function isChar(character) { var bool = false; - all.filter(function (i) { + all.filter(function(i) { bool = (i === character); }); return bool; @@ -56,41 +55,47 @@ module['exports'] = function zalgo(text, options) { function heComes(text, options) { - var result = '', counts, l; + var result = ''; + var counts; + var l; options = options || {}; - options["up"] = typeof options["up"] !== 'undefined' ? options["up"] : true; - options["mid"] = typeof options["mid"] !== 'undefined' ? options["mid"] : true; - options["down"] = typeof options["down"] !== 'undefined' ? options["down"] : true; - options["size"] = typeof options["size"] !== 'undefined' ? options["size"] : "maxi"; + options['up'] = + typeof options['up'] !== 'undefined' ? options['up'] : true; + options['mid'] = + typeof options['mid'] !== 'undefined' ? options['mid'] : true; + options['down'] = + typeof options['down'] !== 'undefined' ? options['down'] : true; + options['size'] = + typeof options['size'] !== 'undefined' ? options['size'] : 'maxi'; text = text.split(''); for (l in text) { - if (is_char(l)) { + if (isChar(l)) { continue; } result = result + text[l]; - counts = {"up" : 0, "down" : 0, "mid" : 0}; + counts = {'up': 0, 'down': 0, 'mid': 0}; switch (options.size) { - case 'mini': - counts.up = randomNumber(8); - counts.mid = randomNumber(2); - counts.down = randomNumber(8); - break; - case 'maxi': - counts.up = randomNumber(16) + 3; - counts.mid = randomNumber(4) + 1; - counts.down = randomNumber(64) + 3; - break; - default: - counts.up = randomNumber(8) + 1; - counts.mid = randomNumber(6) / 2; - counts.down = randomNumber(8) + 1; - break; + case 'mini': + counts.up = randomNumber(8); + counts.mid = randomNumber(2); + counts.down = randomNumber(8); + break; + case 'maxi': + counts.up = randomNumber(16) + 3; + counts.mid = randomNumber(4) + 1; + counts.down = randomNumber(64) + 3; + break; + default: + counts.up = randomNumber(8) + 1; + counts.mid = randomNumber(6) / 2; + counts.down = randomNumber(8) + 1; + break; } - var arr = ["up", "mid", "down"]; + var arr = ['up', 'mid', 'down']; for (var d in arr) { var index = arr[d]; - for (var i = 0 ; i <= counts[index]; i++) { + for (var i = 0; i <= counts[index]; i++) { if (options[index]) { result = result + soul[index][randomNumber(soul[index].length)]; } @@ -101,4 +106,4 @@ module['exports'] = function zalgo(text, options) { } // don't summon him return heComes(text, options); -} +}; diff --git a/deps/npm/node_modules/colors/lib/extendStringPrototype.js b/deps/npm/node_modules/colors/lib/extendStringPrototype.js index 67374a1c22d101..46fd386a915a67 100644 --- a/deps/npm/node_modules/colors/lib/extendStringPrototype.js +++ b/deps/npm/node_modules/colors/lib/extendStringPrototype.js @@ -1,51 +1,42 @@ var colors = require('./colors'); -module['exports'] = function () { - +module['exports'] = function() { // // Extends prototype of native string object to allow for "foo".red syntax // - var addProperty = function (color, func) { + var addProperty = function(color, func) { String.prototype.__defineGetter__(color, func); }; - var sequencer = function sequencer (map, str) { - return function () { - var exploded = this.split(""), i = 0; - exploded = exploded.map(map); - return exploded.join(""); - } - }; - - addProperty('strip', function () { + addProperty('strip', function() { return colors.strip(this); }); - addProperty('stripColors', function () { + addProperty('stripColors', function() { return colors.strip(this); }); - addProperty("trap", function(){ + addProperty('trap', function() { return colors.trap(this); }); - addProperty("zalgo", function(){ + addProperty('zalgo', function() { return colors.zalgo(this); }); - addProperty("zebra", function(){ + addProperty('zebra', function() { return colors.zebra(this); }); - addProperty("rainbow", function(){ + addProperty('rainbow', function() { return colors.rainbow(this); }); - addProperty("random", function(){ + addProperty('random', function() { return colors.random(this); }); - addProperty("america", function(){ + addProperty('america', function() { return colors.america(this); }); @@ -53,8 +44,8 @@ module['exports'] = function () { // Iterate through all default styles and colors // var x = Object.keys(colors.styles); - x.forEach(function (style) { - addProperty(style, function () { + x.forEach(function(style) { + addProperty(style, function() { return colors.stylize(this, style); }); }); @@ -65,49 +56,55 @@ module['exports'] = function () { // on String that you should not overwrite. // var stringPrototypeBlacklist = [ - '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor', - 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt', - 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring', - 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight' + '__defineGetter__', '__defineSetter__', '__lookupGetter__', + '__lookupSetter__', 'charAt', 'constructor', 'hasOwnProperty', + 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', + 'valueOf', 'charCodeAt', 'indexOf', 'lastIndexOf', 'length', + 'localeCompare', 'match', 'repeat', 'replace', 'search', 'slice', + 'split', 'substring', 'toLocaleLowerCase', 'toLocaleUpperCase', + 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', ]; - Object.keys(theme).forEach(function (prop) { + Object.keys(theme).forEach(function(prop) { if (stringPrototypeBlacklist.indexOf(prop) !== -1) { - console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name'); - } - else { + console.log('warn: '.red + ('String.prototype' + prop).magenta + + ' is probably something you don\'t want to override. ' + + 'Ignoring style name'); + } else { if (typeof(theme[prop]) === 'string') { colors[prop] = colors[theme[prop]]; - addProperty(prop, function () { - return colors[theme[prop]](this); + addProperty(prop, function() { + return colors[prop](this); }); - } - else { - addProperty(prop, function () { - var ret = this; + } else { + var themePropApplicator = function(str) { + var ret = str || this; for (var t = 0; t < theme[prop].length; t++) { ret = colors[theme[prop][t]](ret); } return ret; - }); + }; + addProperty(prop, themePropApplicator); + colors[prop] = function(str) { + return themePropApplicator(str); + }; } } }); } - colors.setTheme = function (theme) { + colors.setTheme = function(theme) { if (typeof theme === 'string') { - try { - colors.themes[theme] = require(theme); - applyTheme(colors.themes[theme]); - return colors.themes[theme]; - } catch (err) { - console.log(err); - return err; - } + console.log('colors.setTheme now only accepts an object, not a string. ' + + 'If you are trying to set a theme from a file, it is now your (the ' + + 'caller\'s) responsibility to require the file. The old syntax ' + + 'looked like colors.setTheme(__dirname + ' + + '\'/../themes/generic-logging.js\'); The new syntax looks like '+ + 'colors.setTheme(require(__dirname + ' + + '\'/../themes/generic-logging.js\'));'); + return; } else { applyTheme(theme); } }; - -}; \ No newline at end of file +}; diff --git a/deps/npm/node_modules/colors/lib/index.js b/deps/npm/node_modules/colors/lib/index.js index fd0956d03adb6f..9df5ab7df30770 100644 --- a/deps/npm/node_modules/colors/lib/index.js +++ b/deps/npm/node_modules/colors/lib/index.js @@ -1,12 +1,13 @@ var colors = require('./colors'); module['exports'] = colors; -// Remark: By default, colors will add style properties to String.prototype +// Remark: By default, colors will add style properties to String.prototype. // -// If you don't wish to extend String.prototype you can do this instead and native String will not be touched +// If you don't wish to extend String.prototype, you can do this instead and +// native String will not be touched: // // var colors = require('colors/safe); // colors.red("foo") // // -require('./extendStringPrototype')(); \ No newline at end of file +require('./extendStringPrototype')(); diff --git a/deps/npm/node_modules/colors/lib/maps/america.js b/deps/npm/node_modules/colors/lib/maps/america.js index a07d8327ff2f49..dc96903328989f 100644 --- a/deps/npm/node_modules/colors/lib/maps/america.js +++ b/deps/npm/node_modules/colors/lib/maps/america.js @@ -1,12 +1,10 @@ -var colors = require('../colors'); - -module['exports'] = (function() { - return function (letter, i, exploded) { - if(letter === " ") return letter; - switch(i%3) { +module['exports'] = function(colors) { + return function(letter, i, exploded) { + if (letter === ' ') return letter; + switch (i%3) { case 0: return colors.red(letter); - case 1: return colors.white(letter) - case 2: return colors.blue(letter) + case 1: return colors.white(letter); + case 2: return colors.blue(letter); } - } -})(); \ No newline at end of file + }; +}; diff --git a/deps/npm/node_modules/colors/lib/maps/rainbow.js b/deps/npm/node_modules/colors/lib/maps/rainbow.js index 54427443695248..874508da8ed17e 100644 --- a/deps/npm/node_modules/colors/lib/maps/rainbow.js +++ b/deps/npm/node_modules/colors/lib/maps/rainbow.js @@ -1,12 +1,11 @@ -var colors = require('../colors'); - -module['exports'] = (function () { - var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV - return function (letter, i, exploded) { - if (letter === " ") { +module['exports'] = function(colors) { + // RoY G BiV + var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; + return function(letter, i, exploded) { + if (letter === ' ') { return letter; } else { return colors[rainbowColors[i++ % rainbowColors.length]](letter); } }; -})(); +}; diff --git a/deps/npm/node_modules/colors/lib/maps/random.js b/deps/npm/node_modules/colors/lib/maps/random.js index 5cd101fae2b3dc..6f8f2f8e1e416b 100644 --- a/deps/npm/node_modules/colors/lib/maps/random.js +++ b/deps/npm/node_modules/colors/lib/maps/random.js @@ -1,8 +1,10 @@ -var colors = require('../colors'); - -module['exports'] = (function () { - var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; +module['exports'] = function(colors) { + var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', + 'blue', 'white', 'cyan', 'magenta']; return function(letter, i, exploded) { - return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 1))]](letter); + return letter === ' ' ? letter : + colors[ + available[Math.round(Math.random() * (available.length - 2))] + ](letter); }; -})(); \ No newline at end of file +}; diff --git a/deps/npm/node_modules/colors/lib/maps/zebra.js b/deps/npm/node_modules/colors/lib/maps/zebra.js index bf7dcdead07221..fa73623544a82c 100644 --- a/deps/npm/node_modules/colors/lib/maps/zebra.js +++ b/deps/npm/node_modules/colors/lib/maps/zebra.js @@ -1,5 +1,5 @@ -var colors = require('../colors'); - -module['exports'] = function (letter, i, exploded) { - return i % 2 === 0 ? letter : colors.inverse(letter); -}; \ No newline at end of file +module['exports'] = function(colors) { + return function(letter, i, exploded) { + return i % 2 === 0 ? letter : colors.inverse(letter); + }; +}; diff --git a/deps/npm/node_modules/colors/lib/styles.js b/deps/npm/node_modules/colors/lib/styles.js index 067d59070c2a23..02db9acf7c7dbd 100644 --- a/deps/npm/node_modules/colors/lib/styles.js +++ b/deps/npm/node_modules/colors/lib/styles.js @@ -65,13 +65,13 @@ var codes = { blueBG: [44, 49], magentaBG: [45, 49], cyanBG: [46, 49], - whiteBG: [47, 49] + whiteBG: [47, 49], }; -Object.keys(codes).forEach(function (key) { +Object.keys(codes).forEach(function(key) { var val = codes[key]; var style = styles[key] = []; style.open = '\u001b[' + val[0] + 'm'; style.close = '\u001b[' + val[1] + 'm'; -}); \ No newline at end of file +}); diff --git a/deps/npm/node_modules/colors/lib/system/has-flag.js b/deps/npm/node_modules/colors/lib/system/has-flag.js new file mode 100644 index 00000000000000..a347dd4d7a697e --- /dev/null +++ b/deps/npm/node_modules/colors/lib/system/has-flag.js @@ -0,0 +1,35 @@ +/* +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +'use strict'; + +module.exports = function(flag, argv) { + argv = argv || process.argv; + + var terminatorPos = argv.indexOf('--'); + var prefix = /^-{1,2}/.test(flag) ? '' : '--'; + var pos = argv.indexOf(prefix + flag); + + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; diff --git a/deps/npm/node_modules/colors/lib/system/supports-colors.js b/deps/npm/node_modules/colors/lib/system/supports-colors.js index 3e008aa93a6a6e..f1f9c8ff3da284 100644 --- a/deps/npm/node_modules/colors/lib/system/supports-colors.js +++ b/deps/npm/node_modules/colors/lib/system/supports-colors.js @@ -23,39 +23,129 @@ THE SOFTWARE. */ -var argv = process.argv; +'use strict'; -module.exports = (function () { - if (argv.indexOf('--no-color') !== -1 || - argv.indexOf('--color=false') !== -1) { +var os = require('os'); +var hasFlag = require('./has-flag.js'); + +var env = process.env; + +var forceColor = void 0; +if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) { + forceColor = false; +} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') + || hasFlag('color=always')) { + forceColor = true; +} +if ('FORCE_COLOR' in env) { + forceColor = env.FORCE_COLOR.length === 0 + || parseInt(env.FORCE_COLOR, 10) !== 0; +} + +function translateLevel(level) { + if (level === 0) { return false; } - if (argv.indexOf('--color') !== -1 || - argv.indexOf('--color=true') !== -1 || - argv.indexOf('--color=always') !== -1) { - return true; + return { + level: level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3, + }; +} + +function supportsColor(stream) { + if (forceColor === false) { + return 0; } - if (process.stdout && !process.stdout.isTTY) { - return false; + if (hasFlag('color=16m') || hasFlag('color=full') + || hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (stream && !stream.isTTY && forceColor !== true) { + return 0; } + var min = forceColor ? 1 : 0; + if (process.platform === 'win32') { - return true; + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first + // Windows release that supports 256 colors. Windows 10 build 14931 is the + // first release that supports 16m/TrueColor. + var osRelease = os.release().split('.'); + if (Number(process.versions.node.split('.')[0]) >= 8 + && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) { + return sign in env; + }) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; } - if ('COLORTERM' in process.env) { - return true; + if ('TEAMCITY_VERSION' in env) { + return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0 + ); } - if (process.env.TERM === 'dumb') { - return false; + if ('TERM_PROGRAM' in env) { + var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Hyper': + return 3; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; } - if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { - return true; + if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; } - return false; -})(); \ No newline at end of file + if ('COLORTERM' in env) { + return 1; + } + + if (env.TERM === 'dumb') { + return min; + } + + return min; +} + +function getSupportLevel(stream) { + var level = supportsColor(stream); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr), +}; diff --git a/deps/npm/node_modules/colors/package.json b/deps/npm/node_modules/colors/package.json index 554cbd22e19dc3..712ab466de4eb1 100644 --- a/deps/npm/node_modules/colors/package.json +++ b/deps/npm/node_modules/colors/package.json @@ -1,40 +1,46 @@ { - "_args": [ - [ - "colors@1.1.2", - "/Users/rebecca/code/npm" - ] - ], - "_from": "colors@1.1.2", - "_id": "colors@1.1.2", + "_from": "colors@^1.1.2", + "_id": "colors@1.3.3", "_inBundle": false, - "_integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "_integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", "_location": "/colors", - "_optional": true, "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "range", "registry": true, - "raw": "colors@1.1.2", + "raw": "colors@^1.1.2", "name": "colors", "escapedName": "colors", - "rawSpec": "1.1.2", + "rawSpec": "^1.1.2", "saveSpec": null, - "fetchSpec": "1.1.2" + "fetchSpec": "^1.1.2" }, "_requiredBy": [ "/cli-table3" ], - "_resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "_spec": "1.1.2", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", + "_shasum": "39e005d546afe01e01f9c4ca8fa50f686a01205d", + "_spec": "colors@^1.1.2", + "_where": "/Users/aeschright/code/cli/node_modules/cli-table3", "author": { "name": "Marak Squires" }, "bugs": { "url": "https://github.com/Marak/colors.js/issues" }, + "bundleDependencies": false, + "contributors": [ + { + "name": "DABH", + "url": "https://github.com/DABH" + } + ], + "deprecated": false, "description": "get colors in your node.js console", + "devDependencies": { + "eslint": "^5.2.0", + "eslint-config-google": "^0.11.0" + }, "engines": { "node": ">=0.1.90" }, @@ -43,7 +49,9 @@ "lib", "LICENSE", "safe.js", - "themes" + "themes", + "index.d.ts", + "safe.d.ts" ], "homepage": "https://github.com/Marak/colors.js", "keywords": [ @@ -52,14 +60,15 @@ "colors" ], "license": "MIT", - "main": "lib", + "main": "lib/index.js", "name": "colors", "repository": { "type": "git", "url": "git+ssh://git@github.com/Marak/colors.js.git" }, "scripts": { + "lint": "eslint . --fix", "test": "node tests/basic-test.js && node tests/safe-test.js" }, - "version": "1.1.2" + "version": "1.3.3" } diff --git a/deps/npm/node_modules/colors/safe.d.ts b/deps/npm/node_modules/colors/safe.d.ts new file mode 100644 index 00000000000000..2bafc27984e0ea --- /dev/null +++ b/deps/npm/node_modules/colors/safe.d.ts @@ -0,0 +1,48 @@ +// Type definitions for Colors.js 1.2 +// Project: https://github.com/Marak/colors.js +// Definitions by: Bart van der Schoor , Staffan Eketorp +// Definitions: https://github.com/Marak/colors.js + +export const enabled: boolean; +export function enable(): void; +export function disable(): void; +export function setTheme(theme: any): void; + +export function strip(str: string): string; +export function stripColors(str: string): string; + +export function black(str: string): string; +export function red(str: string): string; +export function green(str: string): string; +export function yellow(str: string): string; +export function blue(str: string): string; +export function magenta(str: string): string; +export function cyan(str: string): string; +export function white(str: string): string; +export function gray(str: string): string; +export function grey(str: string): string; + +export function bgBlack(str: string): string; +export function bgRed(str: string): string; +export function bgGreen(str: string): string; +export function bgYellow(str: string): string; +export function bgBlue(str: string): string; +export function bgMagenta(str: string): string; +export function bgCyan(str: string): string; +export function bgWhite(str: string): string; + +export function reset(str: string): string; +export function bold(str: string): string; +export function dim(str: string): string; +export function italic(str: string): string; +export function underline(str: string): string; +export function inverse(str: string): string; +export function hidden(str: string): string; +export function strikethrough(str: string): string; + +export function rainbow(str: string): string; +export function zebra(str: string): string; +export function america(str: string): string; +export function trap(str: string): string; +export function random(str: string): string; +export function zalgo(str: string): string; diff --git a/deps/npm/node_modules/colors/safe.js b/deps/npm/node_modules/colors/safe.js index a6a1f3ab47f063..a013d542464854 100644 --- a/deps/npm/node_modules/colors/safe.js +++ b/deps/npm/node_modules/colors/safe.js @@ -1,9 +1,10 @@ // -// Remark: Requiring this file will use the "safe" colors API which will not touch String.prototype +// Remark: Requiring this file will use the "safe" colors API, +// which will not touch String.prototype. // -// var colors = require('colors/safe); +// var colors = require('colors/safe'); // colors.red("foo") // // var colors = require('./lib/colors'); -module['exports'] = colors; \ No newline at end of file +module['exports'] = colors; diff --git a/deps/npm/node_modules/colors/themes/generic-logging.js b/deps/npm/node_modules/colors/themes/generic-logging.js index 571972c1baa821..63adfe4ac31f9a 100644 --- a/deps/npm/node_modules/colors/themes/generic-logging.js +++ b/deps/npm/node_modules/colors/themes/generic-logging.js @@ -8,5 +8,5 @@ module['exports'] = { help: 'cyan', warn: 'yellow', debug: 'blue', - error: 'red' -}; \ No newline at end of file + error: 'red', +}; diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000000000..40992555bf5cc0 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/.travis.yml @@ -0,0 +1,55 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/CONTRIBUTING.md b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 00000000000000..f478d58dca85b2 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a 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. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 00000000000000..16ffb93f24bece --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/README.md b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/README.md new file mode 100644 index 00000000000000..23fe3f3e3009a2 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/README.md @@ -0,0 +1,58 @@ +# readable-stream + +***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). + +If 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, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000000000..c141a99c26c638 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/duplex-browser.js new file mode 100644 index 00000000000000..f8b2db83dbe733 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/duplex-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000000000..46924cbfdf5387 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000000000..a1ca813e5acbd8 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,131 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000000000..a9c835884828d8 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,47 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000000000..bf34ac65e1108f --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1019 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000000000..5d1f8b876d98c7 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,214 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000000000..b3f4e85a2f6e35 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,687 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 00000000000000..aefc68bd90b9c2 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,79 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = require('safe-buffer').Buffer; +var util = require('util'); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} \ No newline at end of file diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 00000000000000..5a0a0d88cec6f3 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,74 @@ +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; \ No newline at end of file diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 00000000000000..9332a3fdae7060 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 00000000000000..ce2ad5b6ee57f4 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/package.json b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..9f2a5ca7ca993f --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/package.json @@ -0,0 +1,81 @@ +{ + "_from": "readable-stream@^2.2.2", + "_id": "readable-stream@2.3.6", + "_inBundle": false, + "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "_location": "/concat-stream/readable-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "readable-stream@^2.2.2", + "name": "readable-stream", + "escapedName": "readable-stream", + "rawSpec": "^2.2.2", + "saveSpec": null, + "fetchSpec": "^2.2.2" + }, + "_requiredBy": [ + "/concat-stream" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", + "_spec": "readable-stream@^2.2.2", + "_where": "/Users/aeschright/code/cli/node_modules/concat-stream", + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "deprecated": false, + "description": "Streams3, a user-land copy of the stream library from Node.js", + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "license": "MIT", + "main": "readable.js", + "name": "readable-stream", + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov", + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" + }, + "version": "2.3.6" +} diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000000000..ffd791d7ff275a --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/readable-browser.js new file mode 100644 index 00000000000000..e50372592ee6c6 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/readable.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/readable.js new file mode 100644 index 00000000000000..ec89ec53306497 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/transform.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/transform.js new file mode 100644 index 00000000000000..b1baba26da03dc --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/writable-browser.js new file mode 100644 index 00000000000000..ebdde6a85dcb19 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/writable-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/concat-stream/node_modules/readable-stream/writable.js b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/writable.js new file mode 100644 index 00000000000000..3211a6f80d1abc --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/readable-stream/writable.js @@ -0,0 +1,8 @@ +var Stream = require("stream") +var Writable = require("./lib/_stream_writable.js") + +if (process.env.READABLE_STREAM === 'disable') { + module.exports = Stream && Stream.Writable || Writable +} else { + module.exports = Writable +} diff --git a/deps/npm/node_modules/concat-stream/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/concat-stream/node_modules/string_decoder/.travis.yml new file mode 100644 index 00000000000000..3347a725465058 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/string_decoder/.travis.yml @@ -0,0 +1,50 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test diff --git a/deps/npm/node_modules/concat-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/concat-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/string_decoder/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/concat-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/concat-stream/node_modules/string_decoder/README.md new file mode 100644 index 00000000000000..5fd58315ed5880 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/string_decoder/README.md @@ -0,0 +1,47 @@ +# string_decoder + +***Node-core v8.9.4 string_decoder for userland*** + + +[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) +[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) + + +```bash +npm install --save string_decoder +``` + +***Node-core string_decoder for userland*** + +This package is a mirror of the string_decoder implementation in Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). + +As of version 1.0.0 **string_decoder** uses semantic versioning. + +## Previous versions + +Previous version 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. + +## Update + +The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. + +## Streams Working Group + +`string_decoder` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + +See [readable-stream](https://github.com/nodejs/readable-stream) for +more details. diff --git a/deps/npm/node_modules/concat-stream/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/concat-stream/node_modules/string_decoder/lib/string_decoder.js new file mode 100644 index 00000000000000..2e89e63f7933e4 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/string_decoder/lib/string_decoder.js @@ -0,0 +1,296 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} \ No newline at end of file diff --git a/deps/npm/node_modules/concat-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/concat-stream/node_modules/string_decoder/package.json new file mode 100644 index 00000000000000..fcc3a4bdf3b027 --- /dev/null +++ b/deps/npm/node_modules/concat-stream/node_modules/string_decoder/package.json @@ -0,0 +1,59 @@ +{ + "_from": "string_decoder@~1.1.1", + "_id": "string_decoder@1.1.1", + "_inBundle": false, + "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "_location": "/concat-stream/string_decoder", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "string_decoder@~1.1.1", + "name": "string_decoder", + "escapedName": "string_decoder", + "rawSpec": "~1.1.1", + "saveSpec": null, + "fetchSpec": "~1.1.1" + }, + "_requiredBy": [ + "/concat-stream/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", + "_spec": "string_decoder@~1.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/concat-stream/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/nodejs/string_decoder/issues" + }, + "bundleDependencies": false, + "dependencies": { + "safe-buffer": "~5.1.0" + }, + "deprecated": false, + "description": "The string_decoder module from Node core", + "devDependencies": { + "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", + "tap": "~0.4.8" + }, + "homepage": "https://github.com/nodejs/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "main": "lib/string_decoder.js", + "name": "string_decoder", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "test": "tap test/parallel/*.js && node test/verify-dependencies" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/copy-concurrently/node_modules/aproba/LICENSE b/deps/npm/node_modules/copy-concurrently/node_modules/aproba/LICENSE new file mode 100644 index 00000000000000..2a4982dc40cb69 --- /dev/null +++ b/deps/npm/node_modules/copy-concurrently/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/copy-concurrently/node_modules/aproba/README.md b/deps/npm/node_modules/copy-concurrently/node_modules/aproba/README.md new file mode 100644 index 00000000000000..e94799201ce046 --- /dev/null +++ b/deps/npm/node_modules/copy-concurrently/node_modules/aproba/README.md @@ -0,0 +1,93 @@ +aproba +====== + +A ridiculously 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 | `Array.isArray` 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` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### 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/copy-concurrently/node_modules/aproba/index.js b/deps/npm/node_modules/copy-concurrently/node_modules/aproba/index.js new file mode 100644 index 00000000000000..6f3f797c09a750 --- /dev/null +++ b/deps/npm/node_modules/copy-concurrently/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +var types = { + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} + +function addSchema (schema, arity) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} + + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +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, expectedTypes, value) { + var valueType + Object.keys(types).forEach(function (typeCode) { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + var e = new Error(msg) + e.code = code + if (Error.captureStackTrace) Error.captureStackTrace(e, validate) + return e +} diff --git a/deps/npm/node_modules/copy-concurrently/node_modules/aproba/package.json b/deps/npm/node_modules/copy-concurrently/node_modules/aproba/package.json new file mode 100644 index 00000000000000..e16eea157f345b --- /dev/null +++ b/deps/npm/node_modules/copy-concurrently/node_modules/aproba/package.json @@ -0,0 +1,62 @@ +{ + "_from": "aproba@^1.1.1", + "_id": "aproba@1.2.0", + "_inBundle": false, + "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "_location": "/copy-concurrently/aproba", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aproba@^1.1.1", + "name": "aproba", + "escapedName": "aproba", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/copy-concurrently" + ], + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", + "_spec": "aproba@^1.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/copy-concurrently", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "devDependencies": { + "standard": "^10.0.3", + "tap": "^10.0.2" + }, + "directories": { + "test": "test" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "name": "aproba", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "test": "standard && tap -j3 test/*.js" + }, + "version": "1.2.0" +} diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/duplexify/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000000000..40992555bf5cc0 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/.travis.yml @@ -0,0 +1,55 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/CONTRIBUTING.md b/deps/npm/node_modules/duplexify/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 00000000000000..f478d58dca85b2 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a 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. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/duplexify/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 00000000000000..16ffb93f24bece --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/duplexify/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/README.md b/deps/npm/node_modules/duplexify/node_modules/readable-stream/README.md new file mode 100644 index 00000000000000..23fe3f3e3009a2 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/README.md @@ -0,0 +1,58 @@ +# readable-stream + +***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). + +If 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, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/duplexify/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000000000..c141a99c26c638 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/duplex-browser.js new file mode 100644 index 00000000000000..f8b2db83dbe733 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/duplex-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000000000..46924cbfdf5387 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000000000..a1ca813e5acbd8 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,131 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000000000..a9c835884828d8 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,47 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000000000..bf34ac65e1108f --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1019 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000000000..5d1f8b876d98c7 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,214 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000000000..b3f4e85a2f6e35 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,687 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 00000000000000..aefc68bd90b9c2 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,79 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = require('safe-buffer').Buffer; +var util = require('util'); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} \ No newline at end of file diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 00000000000000..5a0a0d88cec6f3 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,74 @@ +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; \ No newline at end of file diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 00000000000000..9332a3fdae7060 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 00000000000000..ce2ad5b6ee57f4 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/package.json b/deps/npm/node_modules/duplexify/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..e0a80537228c98 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/package.json @@ -0,0 +1,81 @@ +{ + "_from": "readable-stream@^2.0.0", + "_id": "readable-stream@2.3.6", + "_inBundle": false, + "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "_location": "/duplexify/readable-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "readable-stream@^2.0.0", + "name": "readable-stream", + "escapedName": "readable-stream", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/duplexify" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", + "_spec": "readable-stream@^2.0.0", + "_where": "/Users/aeschright/code/cli/node_modules/duplexify", + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "deprecated": false, + "description": "Streams3, a user-land copy of the stream library from Node.js", + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "license": "MIT", + "main": "readable.js", + "name": "readable-stream", + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov", + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" + }, + "version": "2.3.6" +} diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000000000..ffd791d7ff275a --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/readable-browser.js new file mode 100644 index 00000000000000..e50372592ee6c6 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/readable.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/readable.js new file mode 100644 index 00000000000000..ec89ec53306497 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/transform.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/transform.js new file mode 100644 index 00000000000000..b1baba26da03dc --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/writable-browser.js new file mode 100644 index 00000000000000..ebdde6a85dcb19 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/writable-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/duplexify/node_modules/readable-stream/writable.js b/deps/npm/node_modules/duplexify/node_modules/readable-stream/writable.js new file mode 100644 index 00000000000000..3211a6f80d1abc --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/readable-stream/writable.js @@ -0,0 +1,8 @@ +var Stream = require("stream") +var Writable = require("./lib/_stream_writable.js") + +if (process.env.READABLE_STREAM === 'disable') { + module.exports = Stream && Stream.Writable || Writable +} else { + module.exports = Writable +} diff --git a/deps/npm/node_modules/duplexify/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/duplexify/node_modules/string_decoder/.travis.yml new file mode 100644 index 00000000000000..3347a725465058 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/string_decoder/.travis.yml @@ -0,0 +1,50 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test diff --git a/deps/npm/node_modules/duplexify/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/duplexify/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/string_decoder/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/duplexify/node_modules/string_decoder/README.md b/deps/npm/node_modules/duplexify/node_modules/string_decoder/README.md new file mode 100644 index 00000000000000..5fd58315ed5880 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/string_decoder/README.md @@ -0,0 +1,47 @@ +# string_decoder + +***Node-core v8.9.4 string_decoder for userland*** + + +[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) +[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) + + +```bash +npm install --save string_decoder +``` + +***Node-core string_decoder for userland*** + +This package is a mirror of the string_decoder implementation in Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). + +As of version 1.0.0 **string_decoder** uses semantic versioning. + +## Previous versions + +Previous version 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. + +## Update + +The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. + +## Streams Working Group + +`string_decoder` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + +See [readable-stream](https://github.com/nodejs/readable-stream) for +more details. diff --git a/deps/npm/node_modules/duplexify/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/duplexify/node_modules/string_decoder/lib/string_decoder.js new file mode 100644 index 00000000000000..2e89e63f7933e4 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/string_decoder/lib/string_decoder.js @@ -0,0 +1,296 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} \ No newline at end of file diff --git a/deps/npm/node_modules/duplexify/node_modules/string_decoder/package.json b/deps/npm/node_modules/duplexify/node_modules/string_decoder/package.json new file mode 100644 index 00000000000000..cccb055a2fa292 --- /dev/null +++ b/deps/npm/node_modules/duplexify/node_modules/string_decoder/package.json @@ -0,0 +1,59 @@ +{ + "_from": "string_decoder@~1.1.1", + "_id": "string_decoder@1.1.1", + "_inBundle": false, + "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "_location": "/duplexify/string_decoder", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "string_decoder@~1.1.1", + "name": "string_decoder", + "escapedName": "string_decoder", + "rawSpec": "~1.1.1", + "saveSpec": null, + "fetchSpec": "~1.1.1" + }, + "_requiredBy": [ + "/duplexify/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", + "_spec": "string_decoder@~1.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/duplexify/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/nodejs/string_decoder/issues" + }, + "bundleDependencies": false, + "dependencies": { + "safe-buffer": "~5.1.0" + }, + "deprecated": false, + "description": "The string_decoder module from Node core", + "devDependencies": { + "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", + "tap": "~0.4.8" + }, + "homepage": "https://github.com/nodejs/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "main": "lib/string_decoder.js", + "name": "string_decoder", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "test": "tap test/parallel/*.js && node test/verify-dependencies" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/execa/node_modules/get-stream/buffer-stream.js b/deps/npm/node_modules/execa/node_modules/get-stream/buffer-stream.js new file mode 100644 index 00000000000000..ae45d3d9e74179 --- /dev/null +++ b/deps/npm/node_modules/execa/node_modules/get-stream/buffer-stream.js @@ -0,0 +1,51 @@ +'use strict'; +const PassThrough = require('stream').PassThrough; + +module.exports = opts => { + opts = Object.assign({}, opts); + + const array = opts.array; + let encoding = opts.encoding; + const buffer = encoding === 'buffer'; + let objectMode = false; + + if (array) { + objectMode = !(encoding || buffer); + } else { + encoding = encoding || 'utf8'; + } + + if (buffer) { + encoding = null; + } + + let len = 0; + const ret = []; + const stream = new PassThrough({objectMode}); + + if (encoding) { + stream.setEncoding(encoding); + } + + stream.on('data', chunk => { + ret.push(chunk); + + if (objectMode) { + len = ret.length; + } else { + len += chunk.length; + } + }); + + stream.getBufferedValue = () => { + if (array) { + return ret; + } + + return buffer ? Buffer.concat(ret, len) : ret.join(''); + }; + + stream.getBufferedLength = () => len; + + return stream; +}; diff --git a/deps/npm/node_modules/execa/node_modules/get-stream/index.js b/deps/npm/node_modules/execa/node_modules/get-stream/index.js new file mode 100644 index 00000000000000..2dc5ee96af2d95 --- /dev/null +++ b/deps/npm/node_modules/execa/node_modules/get-stream/index.js @@ -0,0 +1,51 @@ +'use strict'; +const bufferStream = require('./buffer-stream'); + +function getStream(inputStream, opts) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } + + opts = Object.assign({maxBuffer: Infinity}, opts); + + const maxBuffer = opts.maxBuffer; + let stream; + let clean; + + const p = new Promise((resolve, reject) => { + const error = err => { + if (err) { // null check + err.bufferedData = stream.getBufferedValue(); + } + + reject(err); + }; + + stream = bufferStream(opts); + inputStream.once('error', error); + inputStream.pipe(stream); + + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + reject(new Error('maxBuffer exceeded')); + } + }); + stream.once('error', error); + stream.on('end', resolve); + + clean = () => { + // some streams doesn't implement the `stream.Readable` interface correctly + if (inputStream.unpipe) { + inputStream.unpipe(stream); + } + }; + }); + + p.then(clean, clean); + + return p.then(() => stream.getBufferedValue()); +} + +module.exports = getStream; +module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); +module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/pump/LICENSE b/deps/npm/node_modules/execa/node_modules/get-stream/license similarity index 92% rename from deps/npm/node_modules/npm-registry-fetch/node_modules/pump/LICENSE rename to deps/npm/node_modules/execa/node_modules/get-stream/license index 757562ec59276b..654d0bfe943437 100644 --- a/deps/npm/node_modules/npm-registry-fetch/node_modules/pump/LICENSE +++ b/deps/npm/node_modules/execa/node_modules/get-stream/license @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Mathias Buus +Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ 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 +THE SOFTWARE. diff --git a/deps/npm/node_modules/execa/node_modules/get-stream/package.json b/deps/npm/node_modules/execa/node_modules/get-stream/package.json new file mode 100644 index 00000000000000..987588836554a7 --- /dev/null +++ b/deps/npm/node_modules/execa/node_modules/get-stream/package.json @@ -0,0 +1,80 @@ +{ + "_from": "get-stream@^3.0.0", + "_id": "get-stream@3.0.0", + "_inBundle": false, + "_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "_location": "/execa/get-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-stream@^3.0.0", + "name": "get-stream", + "escapedName": "get-stream", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/execa" + ], + "_resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "_shasum": "8e943d1358dc37555054ecbe2edb05aa174ede14", + "_spec": "get-stream@^3.0.0", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/execa", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/get-stream/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get a stream as a string, buffer, or array", + "devDependencies": { + "ava": "*", + "into-stream": "^3.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "buffer-stream.js" + ], + "homepage": "https://github.com/sindresorhus/get-stream#readme", + "keywords": [ + "get", + "stream", + "promise", + "concat", + "string", + "str", + "text", + "buffer", + "read", + "data", + "consume", + "readable", + "readablestream", + "array", + "object", + "obj" + ], + "license": "MIT", + "name": "get-stream", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/get-stream.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0", + "xo": { + "esnext": true + } +} diff --git a/deps/npm/node_modules/execa/node_modules/get-stream/readme.md b/deps/npm/node_modules/execa/node_modules/get-stream/readme.md new file mode 100644 index 00000000000000..73b188fb420f2a --- /dev/null +++ b/deps/npm/node_modules/execa/node_modules/get-stream/readme.md @@ -0,0 +1,117 @@ +# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) + +> Get a stream as a string, buffer, or array + + +## Install + +``` +$ npm install --save get-stream +``` + + +## Usage + +```js +const fs = require('fs'); +const getStream = require('get-stream'); +const stream = fs.createReadStream('unicorn.txt'); + +getStream(stream).then(str => { + console.log(str); + /* + ,,))))))));, + __)))))))))))))), + \|/ -\(((((''''((((((((. + -*-==//////(('' . `)))))), + /|\ ))| o ;-. '((((( ,(, + ( `| / ) ;))))' ,_))^;(~ + | | | ,))((((_ _____------~~~-. %,;(;(>';'~ + o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ + ; ''''```` `: `:::|\,__,%% );`'; ~ + | _ ) / `:|`----' `-' + ______/\/~ | / / + /~;;.____/;;' / ___--,-( `;;;/ + / // _;______;'------~~~~~ /;;/\ / + // | | / ; \;;,\ + (<_ | ; /',/-----' _> + \_| ||_ //~;~~~~~~~~~ + `\_| (,~~ + \~\ + ~~ + */ +}); +``` + + +## API + +The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. + +### getStream(stream, [options]) + +Get the `stream` as a string. + +#### options + +##### encoding + +Type: `string`
        +Default: `utf8` + +[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. + +##### maxBuffer + +Type: `number`
        +Default: `Infinity` + +Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected. + +### getStream.buffer(stream, [options]) + +Get the `stream` as a buffer. + +It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. + +### getStream.array(stream, [options]) + +Get the `stream` as an array of values. + +It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: + +- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). + +- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. + +- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. + + +## Errors + +If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. + +```js +getStream(streamThatErrorsAtTheEnd('unicorn')) + .catch(err => { + console.log(err.bufferedData); + //=> 'unicorn' + }); +``` + + +## FAQ + +### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? + +This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. + + +## Related + +- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/figgy-pudding/package.json b/deps/npm/node_modules/figgy-pudding/package.json index 00fc27248205fe..4f268f6ff01eaf 100644 --- a/deps/npm/node_modules/figgy-pudding/package.json +++ b/deps/npm/node_modules/figgy-pudding/package.json @@ -20,7 +20,10 @@ "/", "/cacache", "/libnpmhook", - "/libnpmhook/npm-registry-fetch" + "/libnpmorg", + "/libnpmteam", + "/npm-registry-fetch", + "/pacote" ], "_resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", "_shasum": "862470112901c727a0e495a80744bd5baa1d6790", diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000000000..40992555bf5cc0 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/.travis.yml @@ -0,0 +1,55 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/CONTRIBUTING.md b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 00000000000000..f478d58dca85b2 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a 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. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 00000000000000..16ffb93f24bece --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/README.md b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/README.md new file mode 100644 index 00000000000000..23fe3f3e3009a2 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/README.md @@ -0,0 +1,58 @@ +# readable-stream + +***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). + +If 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, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000000000..c141a99c26c638 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex-browser.js new file mode 100644 index 00000000000000..f8b2db83dbe733 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000000000..46924cbfdf5387 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000000000..a1ca813e5acbd8 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,131 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000000000..a9c835884828d8 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,47 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000000000..bf34ac65e1108f --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1019 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000000000..5d1f8b876d98c7 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,214 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000000000..b3f4e85a2f6e35 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,687 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 00000000000000..aefc68bd90b9c2 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,79 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = require('safe-buffer').Buffer; +var util = require('util'); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 00000000000000..5a0a0d88cec6f3 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,74 @@ +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 00000000000000..9332a3fdae7060 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 00000000000000..ce2ad5b6ee57f4 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/package.json b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..d6f84bde6b982b --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/package.json @@ -0,0 +1,81 @@ +{ + "_from": "readable-stream@^2.0.4", + "_id": "readable-stream@2.3.6", + "_inBundle": false, + "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "_location": "/flush-write-stream/readable-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "readable-stream@^2.0.4", + "name": "readable-stream", + "escapedName": "readable-stream", + "rawSpec": "^2.0.4", + "saveSpec": null, + "fetchSpec": "^2.0.4" + }, + "_requiredBy": [ + "/flush-write-stream" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", + "_spec": "readable-stream@^2.0.4", + "_where": "/Users/aeschright/code/cli/node_modules/flush-write-stream", + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "deprecated": false, + "description": "Streams3, a user-land copy of the stream library from Node.js", + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "license": "MIT", + "main": "readable.js", + "name": "readable-stream", + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov", + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" + }, + "version": "2.3.6" +} diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000000000..ffd791d7ff275a --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable-browser.js new file mode 100644 index 00000000000000..e50372592ee6c6 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable.js new file mode 100644 index 00000000000000..ec89ec53306497 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/transform.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/transform.js new file mode 100644 index 00000000000000..b1baba26da03dc --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable-browser.js new file mode 100644 index 00000000000000..ebdde6a85dcb19 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable.js new file mode 100644 index 00000000000000..3211a6f80d1abc --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable.js @@ -0,0 +1,8 @@ +var Stream = require("stream") +var Writable = require("./lib/_stream_writable.js") + +if (process.env.READABLE_STREAM === 'disable') { + module.exports = Stream && Stream.Writable || Writable +} else { + module.exports = Writable +} diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/.travis.yml new file mode 100644 index 00000000000000..3347a725465058 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/.travis.yml @@ -0,0 +1,50 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/README.md new file mode 100644 index 00000000000000..5fd58315ed5880 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/README.md @@ -0,0 +1,47 @@ +# string_decoder + +***Node-core v8.9.4 string_decoder for userland*** + + +[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) +[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) + + +```bash +npm install --save string_decoder +``` + +***Node-core string_decoder for userland*** + +This package is a mirror of the string_decoder implementation in Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). + +As of version 1.0.0 **string_decoder** uses semantic versioning. + +## Previous versions + +Previous version 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. + +## Update + +The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. + +## Streams Working Group + +`string_decoder` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + +See [readable-stream](https://github.com/nodejs/readable-stream) for +more details. diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/lib/string_decoder.js new file mode 100644 index 00000000000000..2e89e63f7933e4 --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/lib/string_decoder.js @@ -0,0 +1,296 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/package.json new file mode 100644 index 00000000000000..56012b0108109e --- /dev/null +++ b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/package.json @@ -0,0 +1,59 @@ +{ + "_from": "string_decoder@~1.1.1", + "_id": "string_decoder@1.1.1", + "_inBundle": false, + "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "_location": "/flush-write-stream/string_decoder", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "string_decoder@~1.1.1", + "name": "string_decoder", + "escapedName": "string_decoder", + "rawSpec": "~1.1.1", + "saveSpec": null, + "fetchSpec": "~1.1.1" + }, + "_requiredBy": [ + "/flush-write-stream/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", + "_spec": "string_decoder@~1.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/flush-write-stream/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/nodejs/string_decoder/issues" + }, + "bundleDependencies": false, + "dependencies": { + "safe-buffer": "~5.1.0" + }, + "deprecated": false, + "description": "The string_decoder module from Node core", + "devDependencies": { + "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", + "tap": "~0.4.8" + }, + "homepage": "https://github.com/nodejs/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "main": "lib/string_decoder.js", + "name": "string_decoder", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "test": "tap test/parallel/*.js && node test/verify-dependencies" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/from2/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000000000..40992555bf5cc0 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/.travis.yml @@ -0,0 +1,55 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/CONTRIBUTING.md b/deps/npm/node_modules/from2/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 00000000000000..f478d58dca85b2 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a 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. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/from2/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 00000000000000..16ffb93f24bece --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/from2/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/README.md b/deps/npm/node_modules/from2/node_modules/readable-stream/README.md new file mode 100644 index 00000000000000..23fe3f3e3009a2 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/README.md @@ -0,0 +1,58 @@ +# readable-stream + +***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). + +If 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, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/from2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000000000..c141a99c26c638 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/from2/node_modules/readable-stream/duplex-browser.js new file mode 100644 index 00000000000000..f8b2db83dbe733 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/duplex-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/from2/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000000000..46924cbfdf5387 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000000000..a1ca813e5acbd8 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,131 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000000000..a9c835884828d8 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,47 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000000000..bf34ac65e1108f --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1019 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000000000..5d1f8b876d98c7 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,214 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000000000..b3f4e85a2f6e35 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,687 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 00000000000000..aefc68bd90b9c2 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,79 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = require('safe-buffer').Buffer; +var util = require('util'); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 00000000000000..5a0a0d88cec6f3 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,74 @@ +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 00000000000000..9332a3fdae7060 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 00000000000000..ce2ad5b6ee57f4 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/package.json b/deps/npm/node_modules/from2/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..699ff7e6743065 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/package.json @@ -0,0 +1,81 @@ +{ + "_from": "readable-stream@^2.0.0", + "_id": "readable-stream@2.3.6", + "_inBundle": false, + "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "_location": "/from2/readable-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "readable-stream@^2.0.0", + "name": "readable-stream", + "escapedName": "readable-stream", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/from2" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", + "_spec": "readable-stream@^2.0.0", + "_where": "/Users/aeschright/code/cli/node_modules/from2", + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "deprecated": false, + "description": "Streams3, a user-land copy of the stream library from Node.js", + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "license": "MIT", + "main": "readable.js", + "name": "readable-stream", + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov", + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" + }, + "version": "2.3.6" +} diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/from2/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000000000..ffd791d7ff275a --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/from2/node_modules/readable-stream/readable-browser.js new file mode 100644 index 00000000000000..e50372592ee6c6 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/readable.js b/deps/npm/node_modules/from2/node_modules/readable-stream/readable.js new file mode 100644 index 00000000000000..ec89ec53306497 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/transform.js b/deps/npm/node_modules/from2/node_modules/readable-stream/transform.js new file mode 100644 index 00000000000000..b1baba26da03dc --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/from2/node_modules/readable-stream/writable-browser.js new file mode 100644 index 00000000000000..ebdde6a85dcb19 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/writable-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/writable.js b/deps/npm/node_modules/from2/node_modules/readable-stream/writable.js new file mode 100644 index 00000000000000..3211a6f80d1abc --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/readable-stream/writable.js @@ -0,0 +1,8 @@ +var Stream = require("stream") +var Writable = require("./lib/_stream_writable.js") + +if (process.env.READABLE_STREAM === 'disable') { + module.exports = Stream && Stream.Writable || Writable +} else { + module.exports = Writable +} diff --git a/deps/npm/node_modules/from2/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/from2/node_modules/string_decoder/.travis.yml new file mode 100644 index 00000000000000..3347a725465058 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/string_decoder/.travis.yml @@ -0,0 +1,50 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test diff --git a/deps/npm/node_modules/from2/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/from2/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/string_decoder/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/from2/node_modules/string_decoder/README.md b/deps/npm/node_modules/from2/node_modules/string_decoder/README.md new file mode 100644 index 00000000000000..5fd58315ed5880 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/string_decoder/README.md @@ -0,0 +1,47 @@ +# string_decoder + +***Node-core v8.9.4 string_decoder for userland*** + + +[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) +[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) + + +```bash +npm install --save string_decoder +``` + +***Node-core string_decoder for userland*** + +This package is a mirror of the string_decoder implementation in Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). + +As of version 1.0.0 **string_decoder** uses semantic versioning. + +## Previous versions + +Previous version 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. + +## Update + +The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. + +## Streams Working Group + +`string_decoder` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + +See [readable-stream](https://github.com/nodejs/readable-stream) for +more details. diff --git a/deps/npm/node_modules/from2/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/from2/node_modules/string_decoder/lib/string_decoder.js new file mode 100644 index 00000000000000..2e89e63f7933e4 --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/string_decoder/lib/string_decoder.js @@ -0,0 +1,296 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/string_decoder/package.json b/deps/npm/node_modules/from2/node_modules/string_decoder/package.json new file mode 100644 index 00000000000000..feec8efa23be6c --- /dev/null +++ b/deps/npm/node_modules/from2/node_modules/string_decoder/package.json @@ -0,0 +1,59 @@ +{ + "_from": "string_decoder@~1.1.1", + "_id": "string_decoder@1.1.1", + "_inBundle": false, + "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "_location": "/from2/string_decoder", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "string_decoder@~1.1.1", + "name": "string_decoder", + "escapedName": "string_decoder", + "rawSpec": "~1.1.1", + "saveSpec": null, + "fetchSpec": "~1.1.1" + }, + "_requiredBy": [ + "/from2/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", + "_spec": "string_decoder@~1.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/from2/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/nodejs/string_decoder/issues" + }, + "bundleDependencies": false, + "dependencies": { + "safe-buffer": "~5.1.0" + }, + "deprecated": false, + "description": "The string_decoder module from Node core", + "devDependencies": { + "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", + "tap": "~0.4.8" + }, + "homepage": "https://github.com/nodejs/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "main": "lib/string_decoder.js", + "name": "string_decoder", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "test": "tap test/parallel/*.js && node test/verify-dependencies" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000000000..40992555bf5cc0 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/.travis.yml @@ -0,0 +1,55 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/CONTRIBUTING.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 00000000000000..f478d58dca85b2 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a 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. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 00000000000000..16ffb93f24bece --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/README.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/README.md new file mode 100644 index 00000000000000..23fe3f3e3009a2 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/README.md @@ -0,0 +1,58 @@ +# readable-stream + +***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). + +If 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, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000000000..c141a99c26c638 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex-browser.js new file mode 100644 index 00000000000000..f8b2db83dbe733 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000000000..46924cbfdf5387 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000000000..a1ca813e5acbd8 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,131 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000000000..a9c835884828d8 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,47 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000000000..bf34ac65e1108f --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1019 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000000000..5d1f8b876d98c7 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,214 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000000000..b3f4e85a2f6e35 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,687 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 00000000000000..aefc68bd90b9c2 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,79 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = require('safe-buffer').Buffer; +var util = require('util'); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 00000000000000..5a0a0d88cec6f3 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,74 @@ +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 00000000000000..9332a3fdae7060 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 00000000000000..ce2ad5b6ee57f4 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/package.json b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..6ef1cd32a9de4e --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/package.json @@ -0,0 +1,81 @@ +{ + "_from": "readable-stream@1 || 2", + "_id": "readable-stream@2.3.6", + "_inBundle": false, + "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "_location": "/fs-write-stream-atomic/readable-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "readable-stream@1 || 2", + "name": "readable-stream", + "escapedName": "readable-stream", + "rawSpec": "1 || 2", + "saveSpec": null, + "fetchSpec": "1 || 2" + }, + "_requiredBy": [ + "/fs-write-stream-atomic" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", + "_spec": "readable-stream@1 || 2", + "_where": "/Users/aeschright/code/cli/node_modules/fs-write-stream-atomic", + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "deprecated": false, + "description": "Streams3, a user-land copy of the stream library from Node.js", + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "license": "MIT", + "main": "readable.js", + "name": "readable-stream", + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov", + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" + }, + "version": "2.3.6" +} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000000000..ffd791d7ff275a --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable-browser.js new file mode 100644 index 00000000000000..e50372592ee6c6 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable.js new file mode 100644 index 00000000000000..ec89ec53306497 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/transform.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/transform.js new file mode 100644 index 00000000000000..b1baba26da03dc --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable-browser.js new file mode 100644 index 00000000000000..ebdde6a85dcb19 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable.js new file mode 100644 index 00000000000000..3211a6f80d1abc --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable.js @@ -0,0 +1,8 @@ +var Stream = require("stream") +var Writable = require("./lib/_stream_writable.js") + +if (process.env.READABLE_STREAM === 'disable') { + module.exports = Stream && Stream.Writable || Writable +} else { + module.exports = Writable +} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/.travis.yml new file mode 100644 index 00000000000000..3347a725465058 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/.travis.yml @@ -0,0 +1,50 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000000000..2873b3b2e59507 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/README.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/README.md new file mode 100644 index 00000000000000..5fd58315ed5880 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/README.md @@ -0,0 +1,47 @@ +# string_decoder + +***Node-core v8.9.4 string_decoder for userland*** + + +[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) +[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) + + +```bash +npm install --save string_decoder +``` + +***Node-core string_decoder for userland*** + +This package is a mirror of the string_decoder implementation in Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). + +As of version 1.0.0 **string_decoder** uses semantic versioning. + +## Previous versions + +Previous version 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. + +## Update + +The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. + +## Streams Working Group + +`string_decoder` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + +See [readable-stream](https://github.com/nodejs/readable-stream) for +more details. diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/lib/string_decoder.js new file mode 100644 index 00000000000000..2e89e63f7933e4 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/lib/string_decoder.js @@ -0,0 +1,296 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/package.json b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/package.json new file mode 100644 index 00000000000000..65d08e2cac18f1 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/package.json @@ -0,0 +1,59 @@ +{ + "_from": "string_decoder@~1.1.1", + "_id": "string_decoder@1.1.1", + "_inBundle": false, + "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "_location": "/fs-write-stream-atomic/string_decoder", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "string_decoder@~1.1.1", + "name": "string_decoder", + "escapedName": "string_decoder", + "rawSpec": "~1.1.1", + "saveSpec": null, + "fetchSpec": "~1.1.1" + }, + "_requiredBy": [ + "/fs-write-stream-atomic/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", + "_spec": "string_decoder@~1.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/fs-write-stream-atomic/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/nodejs/string_decoder/issues" + }, + "bundleDependencies": false, + "dependencies": { + "safe-buffer": "~5.1.0" + }, + "deprecated": false, + "description": "The string_decoder module from Node core", + "devDependencies": { + "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", + "tap": "~0.4.8" + }, + "homepage": "https://github.com/nodejs/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "main": "lib/string_decoder.js", + "name": "string_decoder", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "test": "tap test/parallel/*.js && node test/verify-dependencies" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/gauge/node_modules/aproba/LICENSE b/deps/npm/node_modules/gauge/node_modules/aproba/LICENSE new file mode 100644 index 00000000000000..2a4982dc40cb69 --- /dev/null +++ b/deps/npm/node_modules/gauge/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/gauge/node_modules/aproba/README.md b/deps/npm/node_modules/gauge/node_modules/aproba/README.md new file mode 100644 index 00000000000000..e94799201ce046 --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/aproba/README.md @@ -0,0 +1,93 @@ +aproba +====== + +A ridiculously 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 | `Array.isArray` 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` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### 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/gauge/node_modules/aproba/index.js b/deps/npm/node_modules/gauge/node_modules/aproba/index.js new file mode 100644 index 00000000000000..6f3f797c09a750 --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +var types = { + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} + +function addSchema (schema, arity) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} + + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +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, expectedTypes, value) { + var valueType + Object.keys(types).forEach(function (typeCode) { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + var e = new Error(msg) + e.code = code + if (Error.captureStackTrace) Error.captureStackTrace(e, validate) + return e +} diff --git a/deps/npm/node_modules/gauge/node_modules/aproba/package.json b/deps/npm/node_modules/gauge/node_modules/aproba/package.json new file mode 100644 index 00000000000000..f654576f8eda8e --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/aproba/package.json @@ -0,0 +1,62 @@ +{ + "_from": "aproba@^1.0.3", + "_id": "aproba@1.2.0", + "_inBundle": false, + "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "_location": "/gauge/aproba", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aproba@^1.0.3", + "name": "aproba", + "escapedName": "aproba", + "rawSpec": "^1.0.3", + "saveSpec": null, + "fetchSpec": "^1.0.3" + }, + "_requiredBy": [ + "/gauge" + ], + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", + "_spec": "aproba@^1.0.3", + "_where": "/Users/aeschright/code/cli/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "devDependencies": { + "standard": "^10.0.3", + "tap": "^10.0.2" + }, + "directories": { + "test": "test" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "name": "aproba", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "test": "standard && tap -j3 test/*.js" + }, + "version": "1.2.0" +} diff --git a/deps/npm/node_modules/genfun/CHANGELOG.md b/deps/npm/node_modules/genfun/CHANGELOG.md index c72d719ea385af..461e22fc596261 100644 --- a/deps/npm/node_modules/genfun/CHANGELOG.md +++ b/deps/npm/node_modules/genfun/CHANGELOG.md @@ -2,6 +2,23 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +# [5.0.0](https://github.com/zkat/genfun/compare/v4.0.1...v5.0.0) (2017-12-12) + + +### Bug Fixes + +* **license:** relicense to MIT ([857e720](https://github.com/zkat/genfun/commit/857e720)) +* **platforms:** drop support for node 4 and 7 ([2cdbe32](https://github.com/zkat/genfun/commit/2cdbe32)) + + +### BREAKING CHANGES + +* **platforms:** node 4 and node 7 are no longer officially supported +* **license:** license changed from CC0-1.0 to MIT + + + ## [4.0.1](https://github.com/zkat/genfun/compare/v4.0.0...v4.0.1) (2017-04-16) diff --git a/deps/npm/node_modules/genfun/LICENSE b/deps/npm/node_modules/genfun/LICENSE new file mode 100644 index 00000000000000..1e0a1d6f8df2f3 --- /dev/null +++ b/deps/npm/node_modules/genfun/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) +Copyright (c) 2017 Kat Marchán + +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/genfun/lib/method.js b/deps/npm/node_modules/genfun/lib/method.js index 5a9d9f788ed883..eddb7d325370ea 100644 --- a/deps/npm/node_modules/genfun/lib/method.js +++ b/deps/npm/node_modules/genfun/lib/method.js @@ -46,13 +46,9 @@ function Method (genfun, selector, func) { } else { method.minimalSelector++ if (!Object.hasOwnProperty.call(object, Role.roleKeyName)) { - if (Object.defineProperty) { - // Object.defineProperty is JS 1.8.0+ - Object.defineProperty( - object, Role.roleKeyName, {value: [], enumerable: false}) - } else { - object[Role.roleKeyName] = [] - } + // Object.defineProperty is JS 1.8.0+ + Object.defineProperty( + object, Role.roleKeyName, {value: [], enumerable: false}) } // XXX HACK - no method replacement now, so we just shove // it in a place where it'll always show up first. This diff --git a/deps/npm/node_modules/genfun/package.json b/deps/npm/node_modules/genfun/package.json index 60295ade5dd319..4a557eb45a3f9d 100644 --- a/deps/npm/node_modules/genfun/package.json +++ b/deps/npm/node_modules/genfun/package.json @@ -1,27 +1,27 @@ { - "_from": "genfun@^4.0.1", - "_id": "genfun@4.0.1", + "_from": "genfun@^5.0.0", + "_id": "genfun@5.0.0", "_inBundle": false, - "_integrity": "sha1-7RAEHy5KfxsKOEZtF6XD4n3x38E=", + "_integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==", "_location": "/genfun", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "genfun@^4.0.1", + "raw": "genfun@^5.0.0", "name": "genfun", "escapedName": "genfun", - "rawSpec": "^4.0.1", + "rawSpec": "^5.0.0", "saveSpec": null, - "fetchSpec": "^4.0.1" + "fetchSpec": "^5.0.0" }, "_requiredBy": [ "/protoduck" ], - "_resolved": "https://registry.npmjs.org/genfun/-/genfun-4.0.1.tgz", - "_shasum": "ed10041f2e4a7f1b0a38466d17a5c3e27df1dfc1", - "_spec": "genfun@^4.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/protoduck", + "_resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", + "_shasum": "9dd9710a06900a5c4a5bf57aca5da4e52fe76537", + "_spec": "genfun@^5.0.0", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/protoduck", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -59,7 +59,7 @@ "polymorphic", "protocols" ], - "license": "CC0-1.0", + "license": "MIT", "main": "lib/genfun.js", "name": "genfun", "repository": { @@ -75,5 +75,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "4.0.1" + "version": "5.0.0" } diff --git a/deps/npm/node_modules/gentle-fs/node_modules/aproba/LICENSE b/deps/npm/node_modules/gentle-fs/node_modules/aproba/LICENSE new file mode 100644 index 00000000000000..2a4982dc40cb69 --- /dev/null +++ b/deps/npm/node_modules/gentle-fs/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/gentle-fs/node_modules/aproba/README.md b/deps/npm/node_modules/gentle-fs/node_modules/aproba/README.md new file mode 100644 index 00000000000000..e94799201ce046 --- /dev/null +++ b/deps/npm/node_modules/gentle-fs/node_modules/aproba/README.md @@ -0,0 +1,93 @@ +aproba +====== + +A ridiculously 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 | `Array.isArray` 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` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### 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/gentle-fs/node_modules/aproba/index.js b/deps/npm/node_modules/gentle-fs/node_modules/aproba/index.js new file mode 100644 index 00000000000000..6f3f797c09a750 --- /dev/null +++ b/deps/npm/node_modules/gentle-fs/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +var types = { + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} + +function addSchema (schema, arity) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} + + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +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, expectedTypes, value) { + var valueType + Object.keys(types).forEach(function (typeCode) { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + var e = new Error(msg) + e.code = code + if (Error.captureStackTrace) Error.captureStackTrace(e, validate) + return e +} diff --git a/deps/npm/node_modules/gentle-fs/node_modules/aproba/package.json b/deps/npm/node_modules/gentle-fs/node_modules/aproba/package.json new file mode 100644 index 00000000000000..34b51a0df22ae2 --- /dev/null +++ b/deps/npm/node_modules/gentle-fs/node_modules/aproba/package.json @@ -0,0 +1,62 @@ +{ + "_from": "aproba@^1.1.2", + "_id": "aproba@1.2.0", + "_inBundle": false, + "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "_location": "/gentle-fs/aproba", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aproba@^1.1.2", + "name": "aproba", + "escapedName": "aproba", + "rawSpec": "^1.1.2", + "saveSpec": null, + "fetchSpec": "^1.1.2" + }, + "_requiredBy": [ + "/gentle-fs" + ], + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", + "_spec": "aproba@^1.1.2", + "_where": "/Users/aeschright/code/cli/node_modules/gentle-fs", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "devDependencies": { + "standard": "^10.0.3", + "tap": "^10.0.2" + }, + "directories": { + "test": "test" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "name": "aproba", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "test": "standard && tap -j3 test/*.js" + }, + "version": "1.2.0" +} diff --git a/deps/npm/node_modules/get-stream/buffer-stream.js b/deps/npm/node_modules/get-stream/buffer-stream.js index ae45d3d9e74179..4121c8e56f9a37 100644 --- a/deps/npm/node_modules/get-stream/buffer-stream.js +++ b/deps/npm/node_modules/get-stream/buffer-stream.js @@ -1,11 +1,11 @@ 'use strict'; -const PassThrough = require('stream').PassThrough; +const {PassThrough} = require('stream'); -module.exports = opts => { - opts = Object.assign({}, opts); +module.exports = options => { + options = Object.assign({}, options); - const array = opts.array; - let encoding = opts.encoding; + const {array} = options; + let {encoding} = options; const buffer = encoding === 'buffer'; let objectMode = false; diff --git a/deps/npm/node_modules/get-stream/index.js b/deps/npm/node_modules/get-stream/index.js index 2dc5ee96af2d95..7e5584a63df07f 100644 --- a/deps/npm/node_modules/get-stream/index.js +++ b/deps/npm/node_modules/get-stream/index.js @@ -1,51 +1,50 @@ 'use strict'; +const pump = require('pump'); const bufferStream = require('./buffer-stream'); -function getStream(inputStream, opts) { +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } +} + +function getStream(inputStream, options) { if (!inputStream) { return Promise.reject(new Error('Expected a stream')); } - opts = Object.assign({maxBuffer: Infinity}, opts); + options = Object.assign({maxBuffer: Infinity}, options); - const maxBuffer = opts.maxBuffer; - let stream; - let clean; + const {maxBuffer} = options; - const p = new Promise((resolve, reject) => { - const error = err => { - if (err) { // null check - err.bufferedData = stream.getBufferedValue(); + let stream; + return new Promise((resolve, reject) => { + const rejectPromise = error => { + if (error) { // A null check + error.bufferedData = stream.getBufferedValue(); } - - reject(err); + reject(error); }; - stream = bufferStream(opts); - inputStream.once('error', error); - inputStream.pipe(stream); + stream = pump(inputStream, bufferStream(options), error => { + if (error) { + rejectPromise(error); + return; + } + + resolve(); + }); stream.on('data', () => { if (stream.getBufferedLength() > maxBuffer) { - reject(new Error('maxBuffer exceeded')); + rejectPromise(new MaxBufferError()); } }); - stream.once('error', error); - stream.on('end', resolve); - - clean = () => { - // some streams doesn't implement the `stream.Readable` interface correctly - if (inputStream.unpipe) { - inputStream.unpipe(stream); - } - }; - }); - - p.then(clean, clean); - - return p.then(() => stream.getBufferedValue()); + }).then(() => stream.getBufferedValue()); } module.exports = getStream; -module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); -module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); +module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'})); +module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true})); +module.exports.MaxBufferError = MaxBufferError; diff --git a/deps/npm/node_modules/get-stream/license b/deps/npm/node_modules/get-stream/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/deps/npm/node_modules/get-stream/license +++ b/deps/npm/node_modules/get-stream/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +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 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. +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/get-stream/package.json b/deps/npm/node_modules/get-stream/package.json index 3042176e149329..a34aa1daf0bfdc 100644 --- a/deps/npm/node_modules/get-stream/package.json +++ b/deps/npm/node_modules/get-stream/package.json @@ -1,29 +1,35 @@ { - "_from": "get-stream@^3.0.0", - "_id": "get-stream@3.0.0", + "_from": "get-stream@", + "_id": "get-stream@4.1.0", "_inBundle": false, - "_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "_integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "_location": "/get-stream", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "tag", "registry": true, - "raw": "get-stream@^3.0.0", + "raw": "get-stream@", "name": "get-stream", "escapedName": "get-stream", - "rawSpec": "^3.0.0", + "rawSpec": "", "saveSpec": null, - "fetchSpec": "^3.0.0" + "fetchSpec": "latest" }, "_requiredBy": [ - "/execa", - "/got", + "#DEV:/", + "#USER", + "/libnpm/libnpmhook", + "/libnpmaccess", + "/libnpmorg", + "/libnpmpublish", + "/libnpmsearch", + "/libnpmteam", "/pacote" ], - "_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "_shasum": "8e943d1358dc37555054ecbe2edb05aa174ede14", - "_spec": "get-stream@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/pacote", + "_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "_shasum": "c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5", + "_spec": "get-stream@", + "_where": "/Users/zkat/Documents/code/work/npm", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -33,6 +39,9 @@ "url": "https://github.com/sindresorhus/get-stream/issues" }, "bundleDependencies": false, + "dependencies": { + "pump": "^3.0.0" + }, "deprecated": false, "description": "Get a stream as a string, buffer, or array", "devDependencies": { @@ -41,7 +50,7 @@ "xo": "*" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ "index.js", @@ -54,7 +63,6 @@ "promise", "concat", "string", - "str", "text", "buffer", "read", @@ -63,8 +71,7 @@ "readable", "readablestream", "array", - "object", - "obj" + "object" ], "license": "MIT", "name": "get-stream", @@ -75,8 +82,5 @@ "scripts": { "test": "xo && ava" }, - "version": "3.0.0", - "xo": { - "esnext": true - } + "version": "4.1.0" } diff --git a/deps/npm/node_modules/get-stream/readme.md b/deps/npm/node_modules/get-stream/readme.md index 73b188fb420f2a..b87a4d37ce5b3e 100644 --- a/deps/npm/node_modules/get-stream/readme.md +++ b/deps/npm/node_modules/get-stream/readme.md @@ -6,7 +6,7 @@ ## Install ``` -$ npm install --save get-stream +$ npm install get-stream ``` @@ -15,10 +15,11 @@ $ npm install --save get-stream ```js const fs = require('fs'); const getStream = require('get-stream'); -const stream = fs.createReadStream('unicorn.txt'); -getStream(stream).then(str => { - console.log(str); +(async () => { + const stream = fs.createReadStream('unicorn.txt'); + + console.log(await getStream(stream)); /* ,,))))))));, __)))))))))))))), @@ -40,7 +41,7 @@ getStream(stream).then(str => { \~\ ~~ */ -}); +})(); ``` @@ -54,6 +55,8 @@ Get the `stream` as a string. #### options +Type: `Object` + ##### encoding Type: `string`
        @@ -66,7 +69,7 @@ Default: `utf8` Type: `number`
        Default: `Infinity` -Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected. +Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `getStream.MaxBufferError` error. ### getStream.buffer(stream, [options]) @@ -92,11 +95,14 @@ It honors both the `maxBuffer` and `encoding` options. The behavior changes slig If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. ```js -getStream(streamThatErrorsAtTheEnd('unicorn')) - .catch(err => { - console.log(err.bufferedData); +(async () => { + try { + await getStream(streamThatErrorsAtTheEnd('unicorn')); + } catch (error) { + console.log(error.bufferedData); //=> 'unicorn' - }); + } +})() ``` diff --git a/deps/npm/node_modules/got/node_modules/get-stream/buffer-stream.js b/deps/npm/node_modules/got/node_modules/get-stream/buffer-stream.js new file mode 100644 index 00000000000000..ae45d3d9e74179 --- /dev/null +++ b/deps/npm/node_modules/got/node_modules/get-stream/buffer-stream.js @@ -0,0 +1,51 @@ +'use strict'; +const PassThrough = require('stream').PassThrough; + +module.exports = opts => { + opts = Object.assign({}, opts); + + const array = opts.array; + let encoding = opts.encoding; + const buffer = encoding === 'buffer'; + let objectMode = false; + + if (array) { + objectMode = !(encoding || buffer); + } else { + encoding = encoding || 'utf8'; + } + + if (buffer) { + encoding = null; + } + + let len = 0; + const ret = []; + const stream = new PassThrough({objectMode}); + + if (encoding) { + stream.setEncoding(encoding); + } + + stream.on('data', chunk => { + ret.push(chunk); + + if (objectMode) { + len = ret.length; + } else { + len += chunk.length; + } + }); + + stream.getBufferedValue = () => { + if (array) { + return ret; + } + + return buffer ? Buffer.concat(ret, len) : ret.join(''); + }; + + stream.getBufferedLength = () => len; + + return stream; +}; diff --git a/deps/npm/node_modules/got/node_modules/get-stream/index.js b/deps/npm/node_modules/got/node_modules/get-stream/index.js new file mode 100644 index 00000000000000..2dc5ee96af2d95 --- /dev/null +++ b/deps/npm/node_modules/got/node_modules/get-stream/index.js @@ -0,0 +1,51 @@ +'use strict'; +const bufferStream = require('./buffer-stream'); + +function getStream(inputStream, opts) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } + + opts = Object.assign({maxBuffer: Infinity}, opts); + + const maxBuffer = opts.maxBuffer; + let stream; + let clean; + + const p = new Promise((resolve, reject) => { + const error = err => { + if (err) { // null check + err.bufferedData = stream.getBufferedValue(); + } + + reject(err); + }; + + stream = bufferStream(opts); + inputStream.once('error', error); + inputStream.pipe(stream); + + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + reject(new Error('maxBuffer exceeded')); + } + }); + stream.once('error', error); + stream.on('end', resolve); + + clean = () => { + // some streams doesn't implement the `stream.Readable` interface correctly + if (inputStream.unpipe) { + inputStream.unpipe(stream); + } + }; + }); + + p.then(clean, clean); + + return p.then(() => stream.getBufferedValue()); +} + +module.exports = getStream; +module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); +module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); diff --git a/deps/npm/node_modules/got/node_modules/get-stream/license b/deps/npm/node_modules/got/node_modules/get-stream/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/got/node_modules/get-stream/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/got/node_modules/get-stream/package.json b/deps/npm/node_modules/got/node_modules/get-stream/package.json new file mode 100644 index 00000000000000..e8eb498409e004 --- /dev/null +++ b/deps/npm/node_modules/got/node_modules/get-stream/package.json @@ -0,0 +1,80 @@ +{ + "_from": "get-stream@^3.0.0", + "_id": "get-stream@3.0.0", + "_inBundle": false, + "_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "_location": "/got/get-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-stream@^3.0.0", + "name": "get-stream", + "escapedName": "get-stream", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/got" + ], + "_resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "_shasum": "8e943d1358dc37555054ecbe2edb05aa174ede14", + "_spec": "get-stream@^3.0.0", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/got", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/get-stream/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get a stream as a string, buffer, or array", + "devDependencies": { + "ava": "*", + "into-stream": "^3.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "buffer-stream.js" + ], + "homepage": "https://github.com/sindresorhus/get-stream#readme", + "keywords": [ + "get", + "stream", + "promise", + "concat", + "string", + "str", + "text", + "buffer", + "read", + "data", + "consume", + "readable", + "readablestream", + "array", + "object", + "obj" + ], + "license": "MIT", + "name": "get-stream", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/get-stream.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0", + "xo": { + "esnext": true + } +} diff --git a/deps/npm/node_modules/got/node_modules/get-stream/readme.md b/deps/npm/node_modules/got/node_modules/get-stream/readme.md new file mode 100644 index 00000000000000..73b188fb420f2a --- /dev/null +++ b/deps/npm/node_modules/got/node_modules/get-stream/readme.md @@ -0,0 +1,117 @@ +# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) + +> Get a stream as a string, buffer, or array + + +## Install + +``` +$ npm install --save get-stream +``` + + +## Usage + +```js +const fs = require('fs'); +const getStream = require('get-stream'); +const stream = fs.createReadStream('unicorn.txt'); + +getStream(stream).then(str => { + console.log(str); + /* + ,,))))))));, + __)))))))))))))), + \|/ -\(((((''''((((((((. + -*-==//////(('' . `)))))), + /|\ ))| o ;-. '((((( ,(, + ( `| / ) ;))))' ,_))^;(~ + | | | ,))((((_ _____------~~~-. %,;(;(>';'~ + o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ + ; ''''```` `: `:::|\,__,%% );`'; ~ + | _ ) / `:|`----' `-' + ______/\/~ | / / + /~;;.____/;;' / ___--,-( `;;;/ + / // _;______;'------~~~~~ /;;/\ / + // | | / ; \;;,\ + (<_ | ; /',/-----' _> + \_| ||_ //~;~~~~~~~~~ + `\_| (,~~ + \~\ + ~~ + */ +}); +``` + + +## API + +The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. + +### getStream(stream, [options]) + +Get the `stream` as a string. + +#### options + +##### encoding + +Type: `string`
        +Default: `utf8` + +[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. + +##### maxBuffer + +Type: `number`
        +Default: `Infinity` + +Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected. + +### getStream.buffer(stream, [options]) + +Get the `stream` as a buffer. + +It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. + +### getStream.array(stream, [options]) + +Get the `stream` as an array of values. + +It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: + +- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). + +- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. + +- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. + + +## Errors + +If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. + +```js +getStream(streamThatErrorsAtTheEnd('unicorn')) + .catch(err => { + console.log(err.bufferedData); + //=> 'unicorn' + }); +``` + + +## FAQ + +### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? + +This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. + + +## Related + +- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/CHANGELOG.md b/deps/npm/node_modules/is-ci/node_modules/ci-info/CHANGELOG.md new file mode 100644 index 00000000000000..859a0ad12a53b0 --- /dev/null +++ b/deps/npm/node_modules/is-ci/node_modules/ci-info/CHANGELOG.md @@ -0,0 +1,62 @@ +# Changelog + +## v1.6.0 + +* feat: add Sail CI support +* feat: add Buddy support +* feat: add Bitrise support +* feat: detect Jenkins PRs +* feat: detect Drone PRs + +## v1.5.1 + +* fix: use full path to vendors.json + +## v1.5.0 + +* feat: add dsari detection ([#15](https://github.com/watson/ci-info/pull/15)) +* feat: add ci.isPR ([#16](https://github.com/watson/ci-info/pull/16)) + +## v1.4.0 + +* feat: add Cirrus CI detection ([#13](https://github.com/watson/ci-info/pull/13)) +* feat: add Shippable CI detection ([#14](https://github.com/watson/ci-info/pull/14)) + +## v1.3.1 + +* chore: reduce npm package size by not including `.github` folder content ([#11](https://github.com/watson/ci-info/pull/11)) + +## v1.3.0 + +* feat: add support for Strider CD +* chore: deprecate vendor constant `TDDIUM` in favor of `SOLANO` +* docs: add missing vendor constant to docs + +## v1.2.0 + +* feat: detect solano-ci ([#9](https://github.com/watson/ci-info/pull/9)) + +## v1.1.3 + +* fix: fix spelling of Hunson in `ci.name` + +## v1.1.2 + +* fix: no more false positive matches for Jenkins + +## v1.1.1 + +* docs: sort lists of CI servers in README.md +* docs: add missing AWS CodeBuild to the docs + +## v1.1.0 + +* feat: add AWS CodeBuild to CI detection ([#2](https://github.com/watson/ci-info/pull/2)) + +## v1.0.1 + +* chore: reduce npm package size by using an `.npmignore` file ([#3](https://github.com/watson/ci-info/pull/3)) + +## v1.0.0 + +* Initial release diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/LICENSE b/deps/npm/node_modules/is-ci/node_modules/ci-info/LICENSE new file mode 100644 index 00000000000000..67846832ecc306 --- /dev/null +++ b/deps/npm/node_modules/is-ci/node_modules/ci-info/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016-2018 Thomas Watson Steen + +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/is-ci/node_modules/ci-info/README.md b/deps/npm/node_modules/is-ci/node_modules/ci-info/README.md new file mode 100644 index 00000000000000..c88be8f82d5df9 --- /dev/null +++ b/deps/npm/node_modules/is-ci/node_modules/ci-info/README.md @@ -0,0 +1,107 @@ +# ci-info + +Get details about the current Continuous Integration environment. + +Please [open an +issue](https://github.com/watson/ci-info/issues/new?template=ci-server-not-detected.md) +if your CI server isn't properly detected :) + +[![npm](https://img.shields.io/npm/v/ci-info.svg)](https://www.npmjs.com/package/ci-info) +[![Build status](https://travis-ci.org/watson/ci-info.svg?branch=master)](https://travis-ci.org/watson/ci-info) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) + +## Installation + +```bash +npm install ci-info --save +``` + +## Usage + +```js +var ci = require('ci-info') + +if (ci.isCI) { + console.log('The name of the CI server is:', ci.name) +} else { + console.log('This program is not running on a CI server') +} +``` + +## Supported CI tools + +Officially supported CI servers: + +| Name | Constant | +|------|----------| +| [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | +| [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | +| [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | +| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | +| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | +| [Buddy](https://buddy.works/) | `ci.BUDDY` | +| [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | +| [CircleCI](http://circleci.com) | `ci.CIRCLE` | +| [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | +| [Codeship](https://codeship.com) | `ci.CODESHIP` | +| [Drone](https://drone.io) | `ci.DRONE` | +| [dsari](https://github.com/rfinnie/dsari) | `ci.DSARI` | +| [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | +| [GoCD](https://www.go.cd/) | `ci.GOCD` | +| [Hudson](http://hudson-ci.org) | `ci.HUDSON` | +| [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | +| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | +| [Sail CI](https://sail.ci/) | `ci.SAIL` | +| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | +| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | +| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | +| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | +| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | +| [Team Foundation Server](https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx) by Microsoft | `ci.TFS` | +| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | +| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` | + +## API + +### `ci.name` + +A string. Will contain the name of the CI server the code is running on. +If not CI server is detected, it will be `null`. + +Don't depend on the value of this string not to change for a specific +vendor. If you find your self writing `ci.name === 'Travis CI'`, you +most likely want to use `ci.TRAVIS` instead. + +### `ci.isCI` + +A boolean. Will be `true` if the code is running on a CI server. +Otherwise `false`. + +Some CI servers not listed here might still trigger the `ci.isCI` +boolean to be set to `true` if they use certain vendor neutral +environment variables. In those cases `ci.name` will be `null` and no +vendor specific boolean will be set to `true`. + +### `ci.isPR` + +A boolean if PR detection is supported for the current CI server. Will +be `true` if a PR is being tested. Otherwise `false`. If PR detection is +not supported for the current CI server, the value will be `null`. + +### `ci.` + +A vendor specific boolean constants is exposed for each support CI +vendor. A constant will be `true` if the code is determined to run on +the given CI server. Otherwise `false`. + +Examples of vendor constants are `ci.TRAVIS` or `ci.APPVEYOR`. For a +complete list, see the support table above. + +Deprecated vendor constants that will be removed in the next major +release: + +- `ci.TDDIUM` (Solano CI) This have been renamed `ci.SOLANO` + +## License + +[MIT](LICENSE) diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/index.js b/deps/npm/node_modules/is-ci/node_modules/ci-info/index.js new file mode 100644 index 00000000000000..27794d49b3f21e --- /dev/null +++ b/deps/npm/node_modules/is-ci/node_modules/ci-info/index.js @@ -0,0 +1,66 @@ +'use strict' + +var vendors = require('./vendors.json') + +var env = process.env + +// Used for testinging only +Object.defineProperty(exports, '_vendors', { + value: vendors.map(function (v) { return v.constant }) +}) + +exports.name = null +exports.isPR = null + +vendors.forEach(function (vendor) { + var envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env] + var isCI = envs.every(function (obj) { + return checkEnv(obj) + }) + + exports[vendor.constant] = isCI + + if (isCI) { + exports.name = vendor.name + + switch (typeof vendor.pr) { + case 'string': + // "pr": "CIRRUS_PR" + exports.isPR = !!env[vendor.pr] + break + case 'object': + if ('env' in vendor.pr) { + // "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } + exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne + } else if ('any' in vendor.pr) { + // "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } + exports.isPR = vendor.pr.any.some(function (key) { + return !!env[key] + }) + } else { + // "pr": { "DRONE_BUILD_EVENT": "pull_request" } + exports.isPR = checkEnv(vendor.pr) + } + break + default: + // PR detection not supported for this vendor + exports.isPR = null + } + } +}) + +exports.isCI = !!( + env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari + env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI + env.BUILD_NUMBER || // Jenkins, TeamCity + env.RUN_ID || // TaskCluster, dsari + exports.name || + false +) + +function checkEnv (obj) { + if (typeof obj === 'string') return !!env[obj] + return Object.keys(obj).every(function (k) { + return env[k] === obj[k] + }) +} diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/package.json b/deps/npm/node_modules/is-ci/node_modules/ci-info/package.json new file mode 100644 index 00000000000000..3542df9d4100c5 --- /dev/null +++ b/deps/npm/node_modules/is-ci/node_modules/ci-info/package.json @@ -0,0 +1,65 @@ +{ + "_from": "ci-info@^1.0.0", + "_id": "ci-info@1.6.0", + "_inBundle": false, + "_integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", + "_location": "/is-ci/ci-info", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ci-info@^1.0.0", + "name": "ci-info", + "escapedName": "ci-info", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/is-ci" + ], + "_resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", + "_shasum": "2ca20dbb9ceb32d4524a683303313f0304b1e497", + "_spec": "ci-info@^1.0.0", + "_where": "/Users/aeschright/code/cli/node_modules/is-ci", + "author": { + "name": "Thomas Watson Steen", + "email": "w@tson.dk", + "url": "https://twitter.com/wa7son" + }, + "bugs": { + "url": "https://github.com/watson/ci-info/issues" + }, + "bundleDependencies": false, + "coordinates": [ + 55.778271, + 12.593091 + ], + "dependencies": {}, + "deprecated": false, + "description": "Get details about the current Continuous Integration environment", + "devDependencies": { + "clear-require": "^1.0.1", + "standard": "^12.0.1", + "tape": "^4.9.1" + }, + "homepage": "https://github.com/watson/ci-info", + "keywords": [ + "ci", + "continuous", + "integration", + "test", + "detect" + ], + "license": "MIT", + "main": "index.js", + "name": "ci-info", + "repository": { + "type": "git", + "url": "git+https://github.com/watson/ci-info.git" + }, + "scripts": { + "test": "standard && node test.js" + }, + "version": "1.6.0" +} diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/vendors.json b/deps/npm/node_modules/is-ci/node_modules/ci-info/vendors.json new file mode 100644 index 00000000000000..a157b78cea4af3 --- /dev/null +++ b/deps/npm/node_modules/is-ci/node_modules/ci-info/vendors.json @@ -0,0 +1,152 @@ +[ + { + "name": "AppVeyor", + "constant": "APPVEYOR", + "env": "APPVEYOR", + "pr": "APPVEYOR_PULL_REQUEST_NUMBER" + }, + { + "name": "Bamboo", + "constant": "BAMBOO", + "env": "bamboo_planKey" + }, + { + "name": "Bitbucket Pipelines", + "constant": "BITBUCKET", + "env": "BITBUCKET_COMMIT" + }, + { + "name": "Bitrise", + "constant": "BITRISE", + "env": "BITRISE_IO", + "pr": "BITRISE_PULL_REQUEST" + }, + { + "name": "Buddy", + "constant": "BUDDY", + "env": "BUDDY_WORKSPACE_ID", + "pr": "BUDDY_EXECUTION_PULL_REQUEST_ID" + }, + { + "name": "Buildkite", + "constant": "BUILDKITE", + "env": "BUILDKITE", + "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } + }, + { + "name": "CircleCI", + "constant": "CIRCLE", + "env": "CIRCLECI", + "pr": "CIRCLE_PULL_REQUEST" + }, + { + "name": "Cirrus CI", + "constant": "CIRRUS", + "env": "CIRRUS_CI", + "pr": "CIRRUS_PR" + }, + { + "name": "AWS CodeBuild", + "constant": "CODEBUILD", + "env": "CODEBUILD_BUILD_ARN" + }, + { + "name": "Codeship", + "constant": "CODESHIP", + "env": { "CI_NAME": "codeship" } + }, + { + "name": "Drone", + "constant": "DRONE", + "env": "DRONE", + "pr": { "DRONE_BUILD_EVENT": "pull_request" } + }, + { + "name": "dsari", + "constant": "DSARI", + "env": "DSARI" + }, + { + "name": "GitLab CI", + "constant": "GITLAB", + "env": "GITLAB_CI" + }, + { + "name": "GoCD", + "constant": "GOCD", + "env": "GO_PIPELINE_LABEL" + }, + { + "name": "Hudson", + "constant": "HUDSON", + "env": "HUDSON_URL" + }, + { + "name": "Jenkins", + "constant": "JENKINS", + "env": ["JENKINS_URL", "BUILD_ID"], + "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } + }, + { + "name": "Magnum CI", + "constant": "MAGNUM", + "env": "MAGNUM" + }, + { + "name": "Sail CI", + "constant": "SAIL", + "env": "SAILCI", + "pr": "SAIL_PULL_REQUEST_NUMBER" + }, + { + "name": "Semaphore", + "constant": "SEMAPHORE", + "env": "SEMAPHORE", + "pr": "PULL_REQUEST_NUMBER" + }, + { + "name": "Shippable", + "constant": "SHIPPABLE", + "env": "SHIPPABLE", + "pr": { "IS_PULL_REQUEST": "true" } + }, + { + "name": "Solano CI", + "constant": "SOLANO", + "env": "TDDIUM", + "pr": "TDDIUM_PR_ID" + }, + { + "name": "Strider CD", + "constant": "STRIDER", + "env": "STRIDER" + }, + { + "name": "TaskCluster", + "constant": "TASKCLUSTER", + "env": ["TASK_ID", "RUN_ID"] + }, + { + "name": "Solano CI", + "constant": "TDDIUM", + "env": "TDDIUM", + "pr": "TDDIUM_PR_ID", + "deprecated": true + }, + { + "name": "TeamCity", + "constant": "TEAMCITY", + "env": "TEAMCITY_VERSION" + }, + { + "name": "Team Foundation Server", + "constant": "TFS", + "env": "TF_BUILD" + }, + { + "name": "Travis CI", + "constant": "TRAVIS", + "env": "TRAVIS", + "pr": { "env": "TRAVIS_PULL_REQUEST", "ne": "false" } + } +] diff --git a/deps/npm/node_modules/is-cidr/README.md b/deps/npm/node_modules/is-cidr/README.md index cd7c8c9686ee23..1fa3ee9ede782b 100644 --- a/deps/npm/node_modules/is-cidr/README.md +++ b/deps/npm/node_modules/is-cidr/README.md @@ -7,7 +7,7 @@ ## Install ``` -$ npm install --save is-cidr +npm i is-cidr ``` @@ -16,14 +16,10 @@ $ npm install --save is-cidr ```js const isCidr = require('is-cidr'); -isCidr('192.168.0.1/24'); -//=> true - -isCidr('1:2:3:4:5:6:7:8/64'); -//=> true - -isCidr.v4('1:2:3:4:5:6:7:8/64'); -//=> false +isCidr('192.168.0.1/24'); //=> 4 +isCidr('1:2:3:4:5:6:7:8/64'); //=> 6 +isCidr('10.0.0.0'); //=> 0 +isCidr.v6('10.0.0.0/24'); //=> false ``` @@ -31,15 +27,15 @@ isCidr.v4('1:2:3:4:5:6:7:8/64'); ### isCidr(input) -Check if `input` is a IPv4 or IPv6 CIDR address. +Check if `input` is a IPv4 or IPv6 CIDR address. Returns either `4`, `6` (indicating the IP version) or `0` if the string is not a CIDR. ### isCidr.v4(input) -Check if `input` is a IPv4 CIDR address. +Check if `input` is a IPv4 CIDR address. Returns a boolean. ### isCidr.v6(input) -Check if `input` is a IPv6 CIDR address. +Check if `input` is a IPv6 CIDR address. Returns a boolean. ## Related diff --git a/deps/npm/node_modules/is-cidr/index.js b/deps/npm/node_modules/is-cidr/index.js index b5a5026439913e..3eaf906c3542e7 100644 --- a/deps/npm/node_modules/is-cidr/index.js +++ b/deps/npm/node_modules/is-cidr/index.js @@ -1,6 +1,13 @@ "use strict"; const cidrRegex = require("cidr-regex"); +const re4 = cidrRegex.v4({exact: true}); +const re6 = cidrRegex.v6({exact: true}); -const isCidr = module.exports = string => cidrRegex({exact: true}).test(string); -isCidr.v4 = string => cidrRegex.v4({exact: true}).test(string); -isCidr.v6 = string => cidrRegex.v6({exact: true}).test(string); +const isCidr = module.exports = str => { + if (re4.test(str)) return 4; + if (re6.test(str)) return 6; + return 0; +}; + +isCidr.v4 = str => re4.test(str); +isCidr.v6 = str => re6.test(str); diff --git a/deps/npm/node_modules/is-cidr/package.json b/deps/npm/node_modules/is-cidr/package.json index 6f735158abcb97..5737794e8c680c 100644 --- a/deps/npm/node_modules/is-cidr/package.json +++ b/deps/npm/node_modules/is-cidr/package.json @@ -1,28 +1,28 @@ { - "_from": "is-cidr@2.0.6", - "_id": "is-cidr@2.0.6", + "_from": "is-cidr@3.0.0", + "_id": "is-cidr@3.0.0", "_inBundle": false, - "_integrity": "sha512-A578p1dV22TgPXn6NCaDAPj6vJvYsBgAzUrAd28a4oldeXJjWqEUuSZOLIW3im51mazOKsoyVp8NU/OItlWacw==", + "_integrity": "sha512-8Xnnbjsb0x462VoYiGlhEi+drY8SFwrHiSYuzc/CEwco55vkehTaxAyIjEdpi3EMvLPPJAJi9FlzP+h+03gp0Q==", "_location": "/is-cidr", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "is-cidr@2.0.6", + "raw": "is-cidr@3.0.0", "name": "is-cidr", "escapedName": "is-cidr", - "rawSpec": "2.0.6", + "rawSpec": "3.0.0", "saveSpec": null, - "fetchSpec": "2.0.6" + "fetchSpec": "3.0.0" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-2.0.6.tgz", - "_shasum": "4b01c9693d8e18399dacd18a4f3d60ea5871ac60", - "_spec": "is-cidr@2.0.6", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-3.0.0.tgz", + "_shasum": "1acf35c9e881063cd5f696d48959b30fed3eed56", + "_spec": "is-cidr@3.0.0", + "_where": "/Users/aeschright/code/cli", "author": { "name": "silverwind", "email": "me@silverwind.io" @@ -39,18 +39,18 @@ } ], "dependencies": { - "cidr-regex": "^2.0.8" + "cidr-regex": "^2.0.10" }, "deprecated": false, "description": "Check if a string is an IP address in CIDR notation", "devDependencies": { - "ava": "^0.25.0", - "eslint": "^4.19.1", - "eslint-config-silverwind": "^1.0.42", - "updates": "^3.0.0" + "eslint": "^5.7.0", + "eslint-config-silverwind": "^2.0.9", + "updates": "^4.5.2", + "ver": "^3.0.0" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ "index.js" @@ -64,7 +64,8 @@ "prefix", "prefixes", "ip", - "ip address" + "ip address", + "network" ], "license": "BSD-2-Clause", "name": "is-cidr", @@ -75,5 +76,5 @@ "scripts": { "test": "make test" }, - "version": "2.0.6" + "version": "3.0.0" } diff --git a/deps/npm/node_modules/libcipm/CHANGELOG.md b/deps/npm/node_modules/libcipm/CHANGELOG.md index a1949b8565916f..5f9d4906e4ae7b 100644 --- a/deps/npm/node_modules/libcipm/CHANGELOG.md +++ b/deps/npm/node_modules/libcipm/CHANGELOG.md @@ -2,6 +2,51 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [3.0.3](https://github.com/zkat/cipm/compare/v3.0.2...v3.0.3) (2019-01-22) + + +### Bug Fixes + +* **scripts:** pass in opts.dir directly ([018df27](https://github.com/zkat/cipm/commit/018df27)) + + + + +## [3.0.2](https://github.com/zkat/cipm/compare/v3.0.1...v3.0.2) (2018-08-31) + + +### Bug Fixes + +* **worker:** missed a spot ([4371558](https://github.com/zkat/cipm/commit/4371558)) + + + + +## [3.0.1](https://github.com/zkat/cipm/compare/v3.0.0...v3.0.1) (2018-08-31) + + +### Bug Fixes + +* **workers:** disable workers for now ([64db490](https://github.com/zkat/cipm/commit/64db490)) + + + + +# [3.0.0](https://github.com/zkat/cipm/compare/v2.0.2...v3.0.0) (2018-08-31) + + +### Features + +* **config:** switch to modern, figgy-pudding configuration ([#57](https://github.com/zkat/cipm/issues/57)) ([161f6b2](https://github.com/zkat/cipm/commit/161f6b2)) + + +### BREAKING CHANGES + +* **config:** this updates cipm to use pacote@9, which consumes npm-style config objects, not pacoteOpts()-style objects. + + + ## [2.0.2](https://github.com/zkat/cipm/compare/v2.0.1...v2.0.2) (2018-08-10) diff --git a/deps/npm/node_modules/libcipm/index.js b/deps/npm/node_modules/libcipm/index.js index 9061ec4b18f023..7f4d13f74a34c1 100644 --- a/deps/npm/node_modules/libcipm/index.js +++ b/deps/npm/node_modules/libcipm/index.js @@ -5,6 +5,7 @@ const BB = require('bluebird') const binLink = require('bin-links') const buildLogicalTree = require('npm-logical-tree') const extract = require('./lib/extract.js') +const figgyPudding = require('figgy-pudding') const fs = require('graceful-fs') const getPrefix = require('find-npm-prefix') const lifecycle = require('npm-lifecycle') @@ -20,10 +21,45 @@ const statAsync = BB.promisify(fs.stat) const symlinkAsync = BB.promisify(fs.symlink) const writeFileAsync = BB.promisify(fs.writeFile) +const CipmOpts = figgyPudding({ + also: {}, + dev: 'development', + development: {}, + dirPacker: {}, + force: {}, + global: {}, + ignoreScripts: 'ignore-scripts', + 'ignore-scripts': {}, + log: {}, + loglevel: {}, + only: {}, + prefix: {}, + prod: 'production', + production: {}, + Promise: { default: () => BB }, + umask: {} +}) + +const LifecycleOpts = figgyPudding({ + config: {}, + 'script-shell': {}, + scriptShell: 'script-shell', + 'ignore-scripts': {}, + ignoreScripts: 'ignore-scripts', + 'ignore-prepublish': {}, + ignorePrepublish: 'ignore-prepublish', + 'scripts-prepend-node-path': {}, + scriptsPrependNodePath: 'scripts-prepend-node-path', + 'unsafe-perm': {}, + unsafePerm: 'unsafe-perm', + prefix: {}, + dir: 'prefix', + failOk: { default: false } +}, { other () { return true } }) + class Installer { constructor (opts) { - this.opts = opts - this.config = opts.config + this.opts = CipmOpts(opts) // Stats this.startTime = Date.now() @@ -80,17 +116,17 @@ class Installer { prepare () { this.log.info('prepare', 'initializing installer') - this.log.level = this.config.get('loglevel') + this.log.level = this.opts.loglevel this.log.verbose('prepare', 'starting workers') extract.startWorkers() return ( - this.config.get('prefix') && this.config.get('global') - ? BB.resolve(this.config.get('prefix')) + this.opts.prefix && this.opts.global + ? BB.resolve(this.opts.prefix) // There's some Special™ logic around the `--prefix` config when it // comes from a config file or env vs when it comes from the CLI : process.argv.some(arg => arg.match(/^\s*--prefix\s*/i)) - ? BB.resolve(this.config.get('prefix')) + ? BB.resolve(this.opts.prefix) : getPrefix(process.cwd()) ) .then(prefix => { @@ -203,7 +239,7 @@ class Installer { return next() } else { return BB.resolve(extract.child( - dep.name, dep, depPath, this.config, this.opts + dep.name, dep, depPath, this.opts )) .then(() => cg.completeWork(1)) .then(() => { this.pkgCount++ }) @@ -218,15 +254,15 @@ class Installer { checkDepEnv (dep) { const includeDev = ( // Covers --dev and --development (from npm config itself) - this.config.get('dev') || + this.opts.dev || ( - !/^prod(uction)?$/.test(this.config.get('only')) && - !this.config.get('production') + !/^prod(uction)?$/.test(this.opts.only) && + !this.opts.production ) || - /^dev(elopment)?$/.test(this.config.get('only')) || - /^dev(elopment)?$/.test(this.config.get('also')) + /^dev(elopment)?$/.test(this.opts.only) || + /^dev(elopment)?$/.test(this.opts.also) ) - const includeProd = !/^dev(elopment)?$/.test(this.config.get('only')) + const includeProd = !/^dev(elopment)?$/.test(this.opts.only) return (dep.dev && includeDev) || (!dep.dev && includeProd) } @@ -274,14 +310,14 @@ class Installer { } return readPkgJson(path.join(depPath, 'package.json')) .then(pkg => binLink(pkg, depPath, false, { - force: this.config.get('force'), - ignoreScripts: this.config.get('ignore-scripts'), + force: this.opts.force, + ignoreScripts: this.opts['ignore-scripts'], log: Object.assign({}, this.log, { info: () => {} }), name: pkg.name, pkgId: pkg.name + '@' + pkg.version, prefix: this.prefix, prefixes: [this.prefix], - umask: this.config.get('umask') + umask: this.opts.umask }), e => { this.log.verbose('buildTree', `error linking ${spec}: ${e.message} ${e.stack}`) }) @@ -346,18 +382,22 @@ class Installer { runScript (stage, pkg, pkgPath) { const start = Date.now() - if (!this.config.get('ignore-scripts')) { + if (!this.opts['ignore-scripts']) { // TODO(mikesherov): remove pkg._id when npm-lifecycle no longer relies on it pkg._id = pkg.name + '@' + pkg.version - const opts = this.config.toLifecycle() - return BB.resolve(lifecycle(pkg, stage, pkgPath, opts)) - .tap(() => { this.timings.scripts += Date.now() - start }) + return BB.resolve(lifecycle( + pkg, stage, pkgPath, LifecycleOpts(this.opts).concat({ + // TODO: can be removed once npm-lifecycle is updated to modern + // config practices. + config: this.opts, + dir: this.prefix + })) + ).tap(() => { this.timings.scripts += Date.now() - start }) } return BB.resolve() } } module.exports = Installer -module.exports.CipmConfig = require('./lib/config/npm-config.js').CipmConfig function mark (tree, failed) { const liveDeps = new Set() diff --git a/deps/npm/node_modules/libcipm/lib/config/lifecycle-opts.js b/deps/npm/node_modules/libcipm/lib/config/lifecycle-opts.js deleted file mode 100644 index 7d574597798e19..00000000000000 --- a/deps/npm/node_modules/libcipm/lib/config/lifecycle-opts.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict' - -const log = require('npmlog') - -module.exports = lifecycleOpts -function lifecycleOpts (opts) { - const objConfig = {} - for (const key of opts.keys()) { - const val = opts.get(key) - if (val != null) { - objConfig[key] = val - } - } - return { - config: objConfig, - scriptShell: opts.get('script-shell'), - force: opts.get('force'), - user: opts.get('user'), - group: opts.get('group'), - ignoreScripts: opts.get('ignore-scripts'), - ignorePrepublish: opts.get('ignore-prepublish'), - scriptsPrependNodePath: opts.get('scripts-prepend-node-path'), - unsafePerm: opts.get('unsafe-perm'), - log, - dir: opts.get('prefix'), - failOk: false, - production: opts.get('production') - } -} diff --git a/deps/npm/node_modules/libcipm/lib/config/npm-config.js b/deps/npm/node_modules/libcipm/lib/config/npm-config.js index 76b4054eef3c41..a0511906199255 100644 --- a/deps/npm/node_modules/libcipm/lib/config/npm-config.js +++ b/deps/npm/node_modules/libcipm/lib/config/npm-config.js @@ -1,40 +1,22 @@ 'use strict' const BB = require('bluebird') -const lifecycleOpts = require('./lifecycle-opts.js') -const pacoteOpts = require('./pacote-opts.js') -const protoduck = require('protoduck') -const spawn = require('child_process').spawn -class NpmConfig extends Map {} +const fs = require('fs') +const figgyPudding = require('figgy-pudding') +const ini = require('ini') +const path = require('path') +const spawn = require('child_process').spawn -const CipmConfig = protoduck.define({ - get: [], - set: [], - toPacote: [], - toLifecycle: [] -}, { - name: 'CipmConfig' -}) -module.exports.CipmConfig = CipmConfig +const readFileAsync = BB.promisify(fs.readFile) -CipmConfig.impl(NpmConfig, { - get: Map.prototype.get, - set: Map.prototype.set, - toPacote (opts) { - return pacoteOpts(this, opts) - }, - toLifecycle () { - return lifecycleOpts(this) - } +const NpmConfig = figgyPudding({ + cache: { default: '' }, + then: {}, + userconfig: {} }) -module.exports.fromObject = fromObj -function fromObj (obj) { - const map = new NpmConfig() - Object.keys(obj).forEach(k => map.set(k, obj[k])) - return map -} +module.exports = NpmConfig module.exports.fromNpm = getNpmConfig function getNpmConfig (argv) { @@ -62,11 +44,41 @@ function getNpmConfig (argv) { reject(new Error('`npm` command not found. Please ensure you have npm@5.4.0 or later installed.')) } else { try { - resolve(fromObj(JSON.parse(stdout))) + resolve(JSON.parse(stdout)) } catch (e) { reject(new Error('`npm config ls --json` failed to output json. Please ensure you have npm@5.4.0 or later installed.')) } } }) + }).then(opts => { + return BB.all( + process.cwd().split(path.sep).reduce((acc, next) => { + acc.path = path.join(acc.path, next) + acc.promises.push(maybeReadIni(path.join(acc.path, '.npmrc'))) + acc.promises.push(maybeReadIni(path.join(acc.path, 'npmrc'))) + return acc + }, { + path: '', + promises: [] + }).promises.concat( + opts.userconfig ? maybeReadIni(opts.userconfig) : {} + ) + ).then(configs => NpmConfig(...configs, opts)) + }).then(opts => { + if (opts.cache) { + return opts.concat({ cache: path.join(opts.cache, '_cacache') }) + } else { + return opts + } }) } + +function maybeReadIni (f) { + return readFileAsync(f, 'utf8').catch(err => { + if (err.code === 'ENOENT') { + return '' + } else { + throw err + } + }).then(ini.parse) +} diff --git a/deps/npm/node_modules/libcipm/lib/config/pacote-opts.js b/deps/npm/node_modules/libcipm/lib/config/pacote-opts.js deleted file mode 100644 index 234ed1352a353c..00000000000000 --- a/deps/npm/node_modules/libcipm/lib/config/pacote-opts.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict' - -const Buffer = require('safe-buffer').Buffer - -const crypto = require('crypto') -const path = require('path') - -let effectiveOwner - -const npmSession = crypto.randomBytes(8).toString('hex') - -module.exports = pacoteOpts -function pacoteOpts (npmOpts, moreOpts) { - const ownerStats = calculateOwner() - const opts = { - cache: path.join(npmOpts.get('cache'), '_cacache'), - ca: npmOpts.get('ca'), - cert: npmOpts.get('cert'), - git: npmOpts.get('git'), - key: npmOpts.get('key'), - localAddress: npmOpts.get('local-address'), - loglevel: npmOpts.get('loglevel'), - maxSockets: +(npmOpts.get('maxsockets') || 15), - npmSession: npmSession, - offline: npmOpts.get('offline'), - projectScope: moreOpts.rootPkg && getProjectScope(moreOpts.rootPkg.name), - proxy: npmOpts.get('https-proxy') || npmOpts.get('proxy'), - refer: 'cipm', - registry: npmOpts.get('registry'), - retry: { - retries: npmOpts.get('fetch-retries'), - factor: npmOpts.get('fetch-retry-factor'), - minTimeout: npmOpts.get('fetch-retry-mintimeout'), - maxTimeout: npmOpts.get('fetch-retry-maxtimeout') - }, - strictSSL: npmOpts.get('strict-ssl'), - userAgent: npmOpts.get('user-agent'), - - dmode: parseInt('0777', 8) & (~npmOpts.get('umask')), - fmode: parseInt('0666', 8) & (~npmOpts.get('umask')), - umask: npmOpts.get('umask') - } - - if (ownerStats.uid != null || ownerStats.gid != null) { - Object.assign(opts, ownerStats) - } - - (npmOpts.forEach ? Array.from(npmOpts.keys()) : npmOpts.keys).forEach(k => { - const authMatchGlobal = k.match( - /^(_authToken|username|_password|password|email|always-auth|_auth)$/ - ) - const authMatchScoped = k[0] === '/' && k.match( - /(.*):(_authToken|username|_password|password|email|always-auth|_auth)$/ - ) - - // if it matches scoped it will also match global - if (authMatchGlobal || authMatchScoped) { - let nerfDart = null - let key = null - let val = null - - if (!opts.auth) { opts.auth = {} } - - if (authMatchScoped) { - nerfDart = authMatchScoped[1] - key = authMatchScoped[2] - val = npmOpts.get(k) - if (!opts.auth[nerfDart]) { - opts.auth[nerfDart] = { - alwaysAuth: !!npmOpts.get('always-auth') - } - } - } else { - key = authMatchGlobal[1] - val = npmOpts.get(k) - opts.auth.alwaysAuth = !!npmOpts.get('always-auth') - } - - const auth = authMatchScoped ? opts.auth[nerfDart] : opts.auth - if (key === '_authToken') { - auth.token = val - } else if (key.match(/password$/i)) { - auth.password = - // the config file stores password auth already-encoded. pacote expects - // the actual username/password pair. - Buffer.from(val, 'base64').toString('utf8') - } else if (key === 'always-auth') { - auth.alwaysAuth = val === 'false' ? false : !!val - } else { - auth[key] = val - } - } - - if (k[0] === '@') { - if (!opts.scopeTargets) { opts.scopeTargets = {} } - opts.scopeTargets[k.replace(/:registry$/, '')] = npmOpts.get(k) - } - }) - - Object.keys(moreOpts || {}).forEach((k) => { - opts[k] = moreOpts[k] - }) - - return opts -} - -function calculateOwner () { - if (!effectiveOwner) { - effectiveOwner = { uid: 0, gid: 0 } - - // Pretty much only on windows - if (!process.getuid) { - return effectiveOwner - } - - effectiveOwner.uid = +process.getuid() - effectiveOwner.gid = +process.getgid() - - if (effectiveOwner.uid === 0) { - if (process.env.SUDO_UID) effectiveOwner.uid = +process.env.SUDO_UID - if (process.env.SUDO_GID) effectiveOwner.gid = +process.env.SUDO_GID - } - } - - return effectiveOwner -} - -function getProjectScope (pkgName) { - const sep = pkgName.indexOf('/') - if (sep === -1) { - return '' - } else { - return pkgName.slice(0, sep) - } -} diff --git a/deps/npm/node_modules/libcipm/lib/extract.js b/deps/npm/node_modules/libcipm/lib/extract.js index 9166ebc058d019..5681d1ce8cacd1 100644 --- a/deps/npm/node_modules/libcipm/lib/extract.js +++ b/deps/npm/node_modules/libcipm/lib/extract.js @@ -2,45 +2,56 @@ const BB = require('bluebird') -const npa = require('npm-package-arg') -const workerFarm = require('worker-farm') - const extractionWorker = require('./worker.js') +const figgyPudding = require('figgy-pudding') +const npa = require('npm-package-arg') const WORKER_PATH = require.resolve('./worker.js') +let workerFarm + +// Broken for now, cause too many issues on some systems. +const ENABLE_WORKERS = false + +const ExtractOpts = figgyPudding({ + log: {} +}) module.exports = { startWorkers () { - this._workers = workerFarm({ - maxConcurrentCallsPerWorker: 20, - maxRetries: 1 - }, WORKER_PATH) + if (ENABLE_WORKERS) { + if (!workerFarm) { workerFarm = require('worker-farm') } + this._workers = workerFarm({ + maxConcurrentCallsPerWorker: 20, + maxRetries: 1 + }, WORKER_PATH) + } }, stopWorkers () { - workerFarm.end(this._workers) + if (ENABLE_WORKERS) { + if (!workerFarm) { workerFarm = require('worker-farm') } + workerFarm.end(this._workers) + } }, - child (name, child, childPath, config, opts) { + child (name, child, childPath, opts) { + opts = ExtractOpts(opts) const spec = npa.resolve(name, child.version) - const additionalToPacoteOpts = {} - if (typeof opts.dirPacker !== 'undefined') { - additionalToPacoteOpts.dirPacker = opts.dirPacker - } - const childOpts = config.toPacote(Object.assign({ + let childOpts = opts.concat({ integrity: child.integrity, resolved: child.resolved - }, additionalToPacoteOpts)) + }) const args = [spec, childPath, childOpts] return BB.fromNode((cb) => { let launcher = extractionWorker let msg = args const spec = typeof args[0] === 'string' ? npa(args[0]) : args[0] - childOpts.loglevel = opts.log.level - if (spec.registry || spec.type === 'remote') { + if (ENABLE_WORKERS && (spec.registry || spec.type === 'remote')) { + if (!workerFarm) { workerFarm = require('worker-farm') } // We can't serialize these options - childOpts.config = null - childOpts.log = null - childOpts.dirPacker = null + childOpts = childOpts.concat({ + log: null, + dirPacker: null + }) // workers will run things in parallel! launcher = this._workers try { diff --git a/deps/npm/node_modules/libcipm/lib/worker.js b/deps/npm/node_modules/libcipm/lib/worker.js index ac61b06236b633..bab607e5278796 100644 --- a/deps/npm/node_modules/libcipm/lib/worker.js +++ b/deps/npm/node_modules/libcipm/lib/worker.js @@ -2,7 +2,7 @@ const BB = require('bluebird') -const log = require('npmlog') +// const log = require('npmlog') const pacote = require('pacote') module.exports = (args, cb) => { @@ -10,7 +10,7 @@ module.exports = (args, cb) => { const spec = parsed[0] const extractTo = parsed[1] const opts = parsed[2] - opts.log = log - log.level = opts.loglevel + // opts.log = log + // log.level = opts.loglevel return BB.resolve(pacote.extract(spec, extractTo, opts)).nodeify(cb) } diff --git a/deps/npm/node_modules/libcipm/package.json b/deps/npm/node_modules/libcipm/package.json index a934f18df5d359..153dc1acbaadaa 100644 --- a/deps/npm/node_modules/libcipm/package.json +++ b/deps/npm/node_modules/libcipm/package.json @@ -1,27 +1,27 @@ { - "_from": "libcipm@2.0.2", - "_id": "libcipm@2.0.2", + "_from": "libcipm@latest", + "_id": "libcipm@3.0.3", "_inBundle": false, - "_integrity": "sha512-9uZ6/LAflVEijksTRq/RX0e+pGA4mr8tND9Cmk2JMg7j2fFUBrs8PpFX2DOAJR/XoxPzz+5h8bkWmtIYLunKAg==", + "_integrity": "sha512-71V5CpTI+zFydTc5IjJ/tx8JHbXEJvmYF2zaSVW1V3X1rRnRjXqh44iuiyry1xgi3ProUQ1vX1uwFiWs00+2og==", "_location": "/libcipm", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "tag", "registry": true, - "raw": "libcipm@2.0.2", + "raw": "libcipm@latest", "name": "libcipm", "escapedName": "libcipm", - "rawSpec": "2.0.2", + "rawSpec": "latest", "saveSpec": null, - "fetchSpec": "2.0.2" + "fetchSpec": "latest" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/libcipm/-/libcipm-2.0.2.tgz", - "_shasum": "4f38c2b37acf2ec156936cef1cbf74636568fc7b", - "_spec": "libcipm@2.0.2", + "_resolved": "https://registry.npmjs.org/libcipm/-/libcipm-3.0.3.tgz", + "_shasum": "2e764effe0b90d458790dab3165794c804075ed3", + "_spec": "libcipm@latest", "_where": "/Users/zkat/Documents/code/work/npm", "author": { "name": "Kat Marchán", @@ -42,15 +42,16 @@ "dependencies": { "bin-links": "^1.1.2", "bluebird": "^3.5.1", + "figgy-pudding": "^3.5.1", "find-npm-prefix": "^1.0.2", "graceful-fs": "^4.1.11", + "ini": "^1.3.5", "lock-verify": "^2.0.2", "mkdirp": "^0.5.1", "npm-lifecycle": "^2.0.3", "npm-logical-tree": "^1.2.1", "npm-package-arg": "^6.1.0", - "pacote": "^8.1.6", - "protoduck": "^5.0.0", + "pacote": "^9.1.0", "read-package-json": "^2.0.13", "rimraf": "^2.6.2", "worker-farm": "^1.6.0" @@ -95,5 +96,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "2.0.2" + "version": "3.0.3" } diff --git a/deps/npm/node_modules/libnpm/CHANGELOG.md b/deps/npm/node_modules/libnpm/CHANGELOG.md new file mode 100644 index 00000000000000..e9712f7d445539 --- /dev/null +++ b/deps/npm/node_modules/libnpm/CHANGELOG.md @@ -0,0 +1,95 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [2.0.1](https://github.com/npm/libnpm/compare/v2.0.0...v2.0.1) (2018-12-05) + + +### Bug Fixes + +* **read-json:** use bluebird for promisification ([8dddde6](https://github.com/npm/libnpm/commit/8dddde6)) + + + + +# [2.0.0](https://github.com/npm/libnpm/compare/v1.5.0...v2.0.0) (2018-11-27) + + +### deps + +* bump all libs ([83ae929](https://github.com/npm/libnpm/commit/83ae929)) + + +### BREAKING CHANGES + +* This includes a breaking libnpmaccess patch + + + + +# [1.5.0](https://github.com/npm/libnpm/compare/v1.4.0...v1.5.0) (2018-11-26) + + +### Features + +* **pacote:** minimal requires for pacote-related APIs ([e19ce11](https://github.com/npm/libnpm/commit/e19ce11)) + + + + +# [1.4.0](https://github.com/npm/libnpm/compare/v1.3.0...v1.4.0) (2018-11-13) + + +### Features + +* **libnpm:** add support for partial requires ([7ba10a7](https://github.com/npm/libnpm/commit/7ba10a7)) + + + + +# [1.3.0](https://github.com/npm/libnpm/compare/v1.2.0...v1.3.0) (2018-11-07) + + +### Features + +* **bin:** add binLinks lib ([2f4d551](https://github.com/npm/libnpm/commit/2f4d551)) + + + + +# [1.2.0](https://github.com/npm/libnpm/compare/v1.1.0...v1.2.0) (2018-11-07) + + +### Features + +* **log:** add npmlog to the bundle ([c20abd1](https://github.com/npm/libnpm/commit/c20abd1)) + + + + +# [1.1.0](https://github.com/npm/libnpm/compare/v1.0.0...v1.1.0) (2018-11-07) + + +### Features + +* **config:** add libnpmconfig ([6a44725](https://github.com/npm/libnpm/commit/6a44725)) +* **json+tree:** add read-package-json and npm-logical-tree ([0198a91](https://github.com/npm/libnpm/commit/0198a91)) +* **lock+prefix:** add lock-verify and find-npm-prefix ([00750c9](https://github.com/npm/libnpm/commit/00750c9)) +* **parseArg:** add npm-package-arg ([5712614](https://github.com/npm/libnpm/commit/5712614)) +* **stringify:** add stringify-package ([0ec5bba](https://github.com/npm/libnpm/commit/0ec5bba)) + + + + +# [1.0.0](https://github.com/npm/libnpm/compare/v0.0.1...v1.0.0) (2018-08-31) + + +### Features + +* **api:** document and export libnpm api ([f85f8f8](https://github.com/npm/libnpm/commit/f85f8f8)) + + + + +## 0.0.1 (2018-04-04) diff --git a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/LICENSE.md b/deps/npm/node_modules/libnpm/LICENSE.md similarity index 100% rename from deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/LICENSE.md rename to deps/npm/node_modules/libnpm/LICENSE.md diff --git a/deps/npm/node_modules/libnpm/README.md b/deps/npm/node_modules/libnpm/README.md new file mode 100644 index 00000000000000..ce35f5da1995d9 --- /dev/null +++ b/deps/npm/node_modules/libnpm/README.md @@ -0,0 +1,57 @@ +# libnpm + +[`libnpm`](https://github.com/npm/libnpm) is the programmatic API for npm. + +For bug reports and support, please head over to [npm.community](https://npm.community). + + +## Install + +`$ npm install libnpm` + +## Table of Contents + +* [Example](#example) +* [Features](#features) +* [API](#api) + * Fetching Packages and Their Info + * [`manifest`](https://www.npmjs.com/package/pacote#manifest) + * [`packument`](https://www.npmjs.com/package/pacote#packument) + * [`tarball`](https://www.npmjs.com/package/pacote#tarball) + * [`extract`](https://www.npmjs.com/package/pacote#extract) + * [`search`](https://npm.im/libnpmsearch) + * Package-related Registry APIs + * [`publish`]() + * [`unpublish`](#unpublish) + * [`access`](https://npm.im/libnpmaccess) + * Account-related Registry APIs + * [`login`](https://www.npmjs.com/package/npm-profile#login) + * [`adduser`](https://www.npmjs.com/package/npm-profile#adduser) + * [`profile`](https://npm.im/npm-profile) + * [`hook`](https://npm.im/libnpmhook) + * [`team`](https://npm.im/libnpmteam) + * [`org`](https://npm.im/libnpmorg) + * Miscellaneous + * [`parseArg`](https://npm.im/npm-package-arg) + * [`config`](https://npm.im/libnpmconfig) + * [`readJSON`](https://npm.im/read-package-json) + * [`verifyLock`](https://npm.im/lock-verify) + * [`getPrefix`](https://npm.im/find-npm-prefix) + * [`logicalTree`](https://npm.im/npm-logical-tree) + * [`stringifyPackage`](https://npm.im/stringify-package) + * [`runScript`](https://www.npmjs.com/package/npm-lifecycle) + * [`log`](https://npm.im/npmlog) + * [`fetch`](https://npm.im/npm-registry-fetch) (plain ol' client for registry interaction) + * [`linkBin`](https://npm.im/bin-links) + +### Example + +```javascript +await libnpm.manifest('libnpm') // => Manifest { name: 'libnpm', ... } +``` + +### API + +This package re-exports the APIs from other packages for convenience. Refer to +the [table of contents](#table-of-contents) for detailed documentation on each +individual exported API. diff --git a/deps/npm/node_modules/libnpm/access.js b/deps/npm/node_modules/libnpm/access.js new file mode 100644 index 00000000000000..4b164226a31f6a --- /dev/null +++ b/deps/npm/node_modules/libnpm/access.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('libnpmaccess') diff --git a/deps/npm/node_modules/libnpm/adduser.js b/deps/npm/node_modules/libnpm/adduser.js new file mode 100644 index 00000000000000..e57dbeaf9baf2e --- /dev/null +++ b/deps/npm/node_modules/libnpm/adduser.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('npm-profile').adduser diff --git a/deps/npm/node_modules/libnpm/config.js b/deps/npm/node_modules/libnpm/config.js new file mode 100644 index 00000000000000..51ff1edee8b7c3 --- /dev/null +++ b/deps/npm/node_modules/libnpm/config.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('libnpmconfig') diff --git a/deps/npm/node_modules/libnpm/extract.js b/deps/npm/node_modules/libnpm/extract.js new file mode 100644 index 00000000000000..4f3aa3d7065c40 --- /dev/null +++ b/deps/npm/node_modules/libnpm/extract.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('pacote/extract') diff --git a/deps/npm/node_modules/libnpm/fetch.js b/deps/npm/node_modules/libnpm/fetch.js new file mode 100644 index 00000000000000..0e5ccd8804297c --- /dev/null +++ b/deps/npm/node_modules/libnpm/fetch.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('npm-registry-fetch') diff --git a/deps/npm/node_modules/libnpm/get-prefix.js b/deps/npm/node_modules/libnpm/get-prefix.js new file mode 100644 index 00000000000000..86bf85862c734a --- /dev/null +++ b/deps/npm/node_modules/libnpm/get-prefix.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('find-npm-prefix') diff --git a/deps/npm/node_modules/libnpm/hook.js b/deps/npm/node_modules/libnpm/hook.js new file mode 100644 index 00000000000000..a45644beeaa6cd --- /dev/null +++ b/deps/npm/node_modules/libnpm/hook.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('libnpmhook') diff --git a/deps/npm/node_modules/libnpm/index.js b/deps/npm/node_modules/libnpm/index.js new file mode 100644 index 00000000000000..19c0419e8917ff --- /dev/null +++ b/deps/npm/node_modules/libnpm/index.js @@ -0,0 +1,29 @@ +'use strict' + +module.exports = { + config: require('./config.js'), + parseArg: require('./parse-arg.js'), + readJSON: require('./read-json.js'), + logicalTree: require('./logical-tree.js'), + getPrefix: require('./get-prefix.js'), + verifyLock: require('./verify-lock.js'), + stringifyPackage: require('./stringify-package.js'), + manifest: require('./manifest.js'), + tarball: require('./tarball.js'), + extract: require('./extract.js'), + packument: require('./packument.js'), + hook: require('./hook.js'), + access: require('./access.js'), + search: require('./search.js'), + team: require('./team.js'), + org: require('./org.js'), + fetch: require('./fetch.js'), + login: require('./login.js'), + adduser: require('./adduser.js'), + profile: require('./profile.js'), + publish: require('./publish.js'), + unpublish: require('./unpublish.js'), + runScript: require('./run-script.js'), + log: require('./log.js'), + linkBin: require('./link-bin.js') +} diff --git a/deps/npm/node_modules/libnpm/link-bin.js b/deps/npm/node_modules/libnpm/link-bin.js new file mode 100644 index 00000000000000..4d7d35c7315f87 --- /dev/null +++ b/deps/npm/node_modules/libnpm/link-bin.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('bin-links') diff --git a/deps/npm/node_modules/libnpm/log.js b/deps/npm/node_modules/libnpm/log.js new file mode 100644 index 00000000000000..f935c6242dd74c --- /dev/null +++ b/deps/npm/node_modules/libnpm/log.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('npmlog') diff --git a/deps/npm/node_modules/libnpm/logical-tree.js b/deps/npm/node_modules/libnpm/logical-tree.js new file mode 100644 index 00000000000000..a08e7737a62ce9 --- /dev/null +++ b/deps/npm/node_modules/libnpm/logical-tree.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('npm-logical-tree') diff --git a/deps/npm/node_modules/libnpm/login.js b/deps/npm/node_modules/libnpm/login.js new file mode 100644 index 00000000000000..fbd61e9a2f8da5 --- /dev/null +++ b/deps/npm/node_modules/libnpm/login.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('npm-profile').login diff --git a/deps/npm/node_modules/libnpm/manifest.js b/deps/npm/node_modules/libnpm/manifest.js new file mode 100644 index 00000000000000..863b004e7f27d9 --- /dev/null +++ b/deps/npm/node_modules/libnpm/manifest.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('pacote/manifest') diff --git a/deps/npm/node_modules/libnpm/org.js b/deps/npm/node_modules/libnpm/org.js new file mode 100644 index 00000000000000..96b15aac0d815c --- /dev/null +++ b/deps/npm/node_modules/libnpm/org.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('libnpmorg') diff --git a/deps/npm/node_modules/libnpm/package.json b/deps/npm/node_modules/libnpm/package.json new file mode 100644 index 00000000000000..4c77e68097f387 --- /dev/null +++ b/deps/npm/node_modules/libnpm/package.json @@ -0,0 +1,94 @@ +{ + "_from": "libnpm@^2.0.1", + "_id": "libnpm@2.0.1", + "_inBundle": false, + "_integrity": "sha512-qTKoxyJvpBxHZQB6k0AhSLajyXq9ZE/lUsZzuHAplr2Bpv9G+k4YuYlExYdUCeVRRGqcJt8hvkPh4tBwKoV98w==", + "_location": "/libnpm", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "libnpm@^2.0.1", + "name": "libnpm", + "escapedName": "libnpm", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/libnpm/-/libnpm-2.0.1.tgz", + "_shasum": "a48fcdee3c25e13c77eb7c60a0efe561d7fb0d8f", + "_spec": "libnpm@^2.0.1", + "_where": "/Users/zkat/Documents/code/work/npm", + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech" + }, + "bugs": { + "url": "https://github.com/npm/libnpm/issues" + }, + "bundleDependencies": false, + "dependencies": { + "bin-links": "^1.1.2", + "bluebird": "^3.5.3", + "find-npm-prefix": "^1.0.2", + "libnpmaccess": "^3.0.1", + "libnpmconfig": "^1.2.1", + "libnpmhook": "^5.0.2", + "libnpmorg": "^1.0.0", + "libnpmpublish": "^1.1.0", + "libnpmsearch": "^2.0.0", + "libnpmteam": "^1.0.1", + "lock-verify": "^2.0.2", + "npm-lifecycle": "^2.1.0", + "npm-logical-tree": "^1.2.1", + "npm-package-arg": "^6.1.0", + "npm-profile": "^4.0.1", + "npm-registry-fetch": "^3.8.0", + "npmlog": "^4.1.2", + "pacote": "^9.2.3", + "read-package-json": "^2.0.13", + "stringify-package": "^1.0.0" + }, + "deprecated": false, + "description": "Collection of programmatic APIs for the npm CLI", + "devDependencies": { + "nock": "^9.2.3", + "standard": "^11.0.1", + "standard-version": "^4.3.0", + "tap": "^12.0.1", + "weallbehave": "^1.2.0", + "weallcontribute": "^1.0.8" + }, + "files": [ + "*.js", + "lib" + ], + "homepage": "https://github.com/npm/libnpm#readme", + "keywords": [ + "npm", + "api", + "package manager", + "lib" + ], + "license": "ISC", + "main": "index.js", + "name": "libnpm", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/libnpm.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --coverage test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "2.0.1" +} diff --git a/deps/npm/node_modules/libnpm/packument.js b/deps/npm/node_modules/libnpm/packument.js new file mode 100644 index 00000000000000..f852a3fe26b609 --- /dev/null +++ b/deps/npm/node_modules/libnpm/packument.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('pacote/packument') diff --git a/deps/npm/node_modules/libnpm/parse-arg.js b/deps/npm/node_modules/libnpm/parse-arg.js new file mode 100644 index 00000000000000..6db5201504f394 --- /dev/null +++ b/deps/npm/node_modules/libnpm/parse-arg.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('npm-package-arg') diff --git a/deps/npm/node_modules/libnpm/profile.js b/deps/npm/node_modules/libnpm/profile.js new file mode 100644 index 00000000000000..6df6b5e23abc97 --- /dev/null +++ b/deps/npm/node_modules/libnpm/profile.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('npm-profile') diff --git a/deps/npm/node_modules/libnpm/publish.js b/deps/npm/node_modules/libnpm/publish.js new file mode 100644 index 00000000000000..bcdbdeb2a8ebdd --- /dev/null +++ b/deps/npm/node_modules/libnpm/publish.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('libnpmpublish').publish diff --git a/deps/npm/node_modules/libnpm/read-json.js b/deps/npm/node_modules/libnpm/read-json.js new file mode 100644 index 00000000000000..b59eb9d45a0be1 --- /dev/null +++ b/deps/npm/node_modules/libnpm/read-json.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('bluebird').promisify(require('read-package-json')) diff --git a/deps/npm/node_modules/libnpm/run-script.js b/deps/npm/node_modules/libnpm/run-script.js new file mode 100644 index 00000000000000..11765d40ae5539 --- /dev/null +++ b/deps/npm/node_modules/libnpm/run-script.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('npm-lifecycle') diff --git a/deps/npm/node_modules/libnpm/search.js b/deps/npm/node_modules/libnpm/search.js new file mode 100644 index 00000000000000..172b10b7caf16b --- /dev/null +++ b/deps/npm/node_modules/libnpm/search.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('libnpmsearch') diff --git a/deps/npm/node_modules/libnpm/stringify-package.js b/deps/npm/node_modules/libnpm/stringify-package.js new file mode 100644 index 00000000000000..e7f3bfcbb719e1 --- /dev/null +++ b/deps/npm/node_modules/libnpm/stringify-package.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('stringify-package') diff --git a/deps/npm/node_modules/libnpm/tarball.js b/deps/npm/node_modules/libnpm/tarball.js new file mode 100644 index 00000000000000..cc1b2e54a49fb9 --- /dev/null +++ b/deps/npm/node_modules/libnpm/tarball.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('pacote/tarball') diff --git a/deps/npm/node_modules/libnpm/team.js b/deps/npm/node_modules/libnpm/team.js new file mode 100644 index 00000000000000..d407f796f4e44d --- /dev/null +++ b/deps/npm/node_modules/libnpm/team.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('libnpmteam') diff --git a/deps/npm/node_modules/libnpm/unpublish.js b/deps/npm/node_modules/libnpm/unpublish.js new file mode 100644 index 00000000000000..bc0d34c9a09cbb --- /dev/null +++ b/deps/npm/node_modules/libnpm/unpublish.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('libnpmpublish').unpublish diff --git a/deps/npm/node_modules/libnpm/verify-lock.js b/deps/npm/node_modules/libnpm/verify-lock.js new file mode 100644 index 00000000000000..e396756419c7ac --- /dev/null +++ b/deps/npm/node_modules/libnpm/verify-lock.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('lock-verify') diff --git a/deps/npm/node_modules/libnpmaccess/.travis.yml b/deps/npm/node_modules/libnpmaccess/.travis.yml new file mode 100644 index 00000000000000..db5ea8b0186403 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +sudo: false +node_js: + - "10" + - "9" + - "8" + - "6" diff --git a/deps/npm/node_modules/libnpmaccess/CHANGELOG.md b/deps/npm/node_modules/libnpmaccess/CHANGELOG.md new file mode 100644 index 00000000000000..14959aaefbe445 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/CHANGELOG.md @@ -0,0 +1,124 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [3.0.1](https://github.com/npm/libnpmaccess/compare/v3.0.0...v3.0.1) (2018-11-12) + + +### Bug Fixes + +* **ls-packages:** fix confusing splitEntity arg check ([1769090](https://github.com/npm/libnpmaccess/commit/1769090)) + + + + +# [3.0.0](https://github.com/npm/libnpmaccess/compare/v2.0.1...v3.0.0) (2018-08-24) + + +### Features + +* **api:** overhaul API ergonomics ([1faf00a](https://github.com/npm/libnpmaccess/commit/1faf00a)) + + +### BREAKING CHANGES + +* **api:** all API calls where scope and team were separate, or +where team was an extra, optional argument should now use a +fully-qualified team name instead, in the `scope:team` format. + + + + +## [2.0.1](https://github.com/npm/libnpmaccess/compare/v2.0.0...v2.0.1) (2018-08-24) + + + + +# [2.0.0](https://github.com/npm/libnpmaccess/compare/v1.2.2...v2.0.0) (2018-08-21) + + +### Bug Fixes + +* **json:** stop trying to parse response JSON ([20fdd84](https://github.com/npm/libnpmaccess/commit/20fdd84)) +* **lsPackages:** team URL was wrong D: ([b52201c](https://github.com/npm/libnpmaccess/commit/b52201c)) + + +### BREAKING CHANGES + +* **json:** use cases where registries were returning JSON +strings in the response body will no longer have an effect. All +API functions except for lsPackages and lsCollaborators will return +`true` on completion. + + + + +## [1.2.2](https://github.com/npm/libnpmaccess/compare/v1.2.1...v1.2.2) (2018-08-20) + + +### Bug Fixes + +* **docs:** tiny doc hiccup fix ([106396f](https://github.com/npm/libnpmaccess/commit/106396f)) + + + + +## [1.2.1](https://github.com/npm/libnpmaccess/compare/v1.2.0...v1.2.1) (2018-08-20) + + +### Bug Fixes + +* **docs:** document the stream interfaces ([c435aa2](https://github.com/npm/libnpmaccess/commit/c435aa2)) + + + + +# [1.2.0](https://github.com/npm/libnpmaccess/compare/v1.1.0...v1.2.0) (2018-08-20) + + +### Bug Fixes + +* **readme:** fix up appveyor badge url ([42b45a1](https://github.com/npm/libnpmaccess/commit/42b45a1)) + + +### Features + +* **streams:** add streaming result support for lsPkg and lsCollab ([0f06f46](https://github.com/npm/libnpmaccess/commit/0f06f46)) + + + + +# [1.1.0](https://github.com/npm/libnpmaccess/compare/v1.0.0...v1.1.0) (2018-08-17) + + +### Bug Fixes + +* **2fa:** escape package names correctly ([f2d83fe](https://github.com/npm/libnpmaccess/commit/f2d83fe)) +* **grant:** fix permissions validation ([07f7435](https://github.com/npm/libnpmaccess/commit/07f7435)) +* **ls-collaborators:** fix package name escaping + query ([3c02858](https://github.com/npm/libnpmaccess/commit/3c02858)) +* **ls-packages:** add query + fix fallback request order ([bdc4791](https://github.com/npm/libnpmaccess/commit/bdc4791)) +* **node6:** stop using Object.entries() ([4fec03c](https://github.com/npm/libnpmaccess/commit/4fec03c)) +* **public/restricted:** body should be string, not bool ([cffc727](https://github.com/npm/libnpmaccess/commit/cffc727)) +* **readme:** fix up title and badges ([2bd6113](https://github.com/npm/libnpmaccess/commit/2bd6113)) +* **specs:** require specs to be registry specs ([7892891](https://github.com/npm/libnpmaccess/commit/7892891)) + + +### Features + +* **test:** add 100% coverage test suite ([22b5dec](https://github.com/npm/libnpmaccess/commit/22b5dec)) + + + + +# 1.0.0 (2018-08-17) + + +### Bug Fixes + +* **test:** -100 is apparently bad now ([a5ab879](https://github.com/npm/libnpmaccess/commit/a5ab879)) + + +### Features + +* **impl:** initial implementation of api ([7039390](https://github.com/npm/libnpmaccess/commit/7039390)) diff --git a/deps/npm/node_modules/libnpmaccess/CODE_OF_CONDUCT.md b/deps/npm/node_modules/libnpmaccess/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000000..aeb72f598dcb45 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/CODE_OF_CONDUCT.md @@ -0,0 +1,151 @@ +# Code of Conduct + +## When Something Happens + +If you see a Code of Conduct violation, follow these steps: + +1. Let the person know that what they did is not appropriate and ask them to stop and/or edit their message(s) or commits. +2. That person should immediately stop the behavior and correct the issue. +3. If this doesn’t happen, or if you're uncomfortable speaking up, [contact the maintainers](#contacting-maintainers). +4. As soon as available, a maintainer will look into the issue, and take [further action (see below)](#further-enforcement), starting with a warning, then temporary block, then long-term repo or organization ban. + +When reporting, please include any relevant details, links, screenshots, context, or other information that may be used to better understand and resolve the situation. + +**The maintainer team will prioritize the well-being and comfort of the recipients of the violation over the comfort of the violator.** See [some examples below](#enforcement-examples). + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers of this project pledge to making participation in our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, technical preferences, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + + * Using welcoming and inclusive language. + * Being respectful of differing viewpoints and experiences. + * Gracefully accepting constructive feedback. + * Focusing on what is best for the community. + * Showing empathy and kindness towards other community members. + * Encouraging and raising up your peers in the project so you can all bask in hacks and glory. + +Examples of unacceptable behavior by participants include: + + * The use of sexualized language or imagery and unwelcome sexual attention or advances, including when simulated online. The only exception to sexual topics is channels/spaces specifically for topics of sexual identity. + * Casual mention of slavery or indentured servitude and/or false comparisons of one's occupation or situation to slavery. Please consider using or asking about alternate terminology when referring to such metaphors in technology. + * Making light of/making mocking comments about trigger warnings and content warnings. + * Trolling, insulting/derogatory comments, and personal or political attacks. + * Public or private harassment, deliberate intimidation, or threats. + * Publishing others' private information, such as a physical or electronic address, without explicit permission. This includes any sort of "outing" of any aspect of someone's identity without their consent. + * Publishing private screenshots or quotes of interactions in the context of this project without all quoted users' *explicit* consent. + * Publishing of private communication that doesn't have to do with reporting harrassment. + * Any of the above even when [presented as "ironic" or "joking"](https://en.wikipedia.org/wiki/Hipster_racism). + * Any attempt to present "reverse-ism" versions of the above as violations. Examples of reverse-isms are "reverse racism", "reverse sexism", "heterophobia", and "cisphobia". + * Unsolicited explanations under the assumption that someone doesn't already know it. Ask before you teach! Don't assume what people's knowledge gaps are. + * [Feigning or exaggerating surprise](https://www.recurse.com/manual#no-feigned-surprise) when someone admits to not knowing something. + * "[Well-actuallies](https://www.recurse.com/manual#no-well-actuallys)" + * Other conduct which could reasonably be considered inappropriate in a professional or community setting. + +## Scope + +This Code of Conduct applies both within spaces involving this project and in other spaces involving community members. This includes the repository, its Pull Requests and Issue tracker, its Twitter community, private email communications in the context of the project, and any events where members of the project are participating, as well as adjacent communities and venues affecting the project's members. + +Depending on the violation, the maintainers may decide that violations of this code of conduct that have happened outside of the scope of the community may deem an individual unwelcome, and take appropriate action to maintain the comfort and safety of its members. + +### Other Community Standards + +As a project on GitHub, this project is additionally covered by the [GitHub Community Guidelines](https://help.github.com/articles/github-community-guidelines/). + +Additionally, as a project hosted on npm, is is covered by [npm, Inc's Code of Conduct](https://www.npmjs.com/policies/conduct). + +Enforcement of those guidelines after violations overlapping with the above are the responsibility of the entities, and enforcement may happen in any or all of the services/communities. + +## Maintainer Enforcement Process + +Once the maintainers get involved, they will follow a documented series of steps and do their best to preserve the well-being of project members. This section covers actual concrete steps. + +### Contacting Maintainers + +You may get in touch with the maintainer team through any of the following methods: + + * Through email: + * [kzm@zkat.tech](mailto:kzm@zkat.tech) (Kat Marchán) + + * Through Twitter: + * [@maybekatz](https://twitter.com/maybekatz) (Kat Marchán) + +### Further Enforcement + +If you've already followed the [initial enforcement steps](#enforcement), these are the steps maintainers will take for further enforcement, as needed: + + 1. Repeat the request to stop. + 2. If the person doubles down, they will have offending messages removed or edited by a maintainers given an official warning. The PR or Issue may be locked. + 3. If the behavior continues or is repeated later, the person will be blocked from participating for 24 hours. + 4. If the behavior continues or is repeated after the temporary block, a long-term (6-12mo) ban will be used. + +On top of this, maintainers may remove any offending messages, images, contributions, etc, as they deem necessary. + +Maintainers reserve full rights to skip any of these steps, at their discretion, if the violation is considered to be a serious and/or immediate threat to the health and well-being of members of the community. These include any threats, serious physical or verbal attacks, and other such behavior that would be completely unacceptable in any social setting that puts our members at risk. + +Members expelled from events or venues with any sort of paid attendance will not be refunded. + +### Who Watches the Watchers? + +Maintainers and other leaders who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. These may include anything from removal from the maintainer team to a permanent ban from the community. + +Additionally, as a project hosted on both GitHub and npm, [their own Codes of Conducts may be applied against maintainers of this project](#other-community-standards), externally of this project's procedures. + +### Enforcement Examples + +#### The Best Case + +The vast majority of situations work out like this. This interaction is common, and generally positive. + +> Alex: "Yeah I used X and it was really crazy!" + +> Patt (not a maintainer): "Hey, could you not use that word? What about 'ridiculous' instead?" + +> Alex: "oh sorry, sure." -> edits old comment to say "it was really confusing!" + +#### The Maintainer Case + +Sometimes, though, you need to get maintainers involved. Maintainers will do their best to resolve conflicts, but people who were harmed by something **will take priority**. + +> Patt: "Honestly, sometimes I just really hate using $library and anyone who uses it probably sucks at their job." + +> Alex: "Whoa there, could you dial it back a bit? There's a CoC thing about attacking folks' tech use like that." + +> Patt: "I'm not attacking anyone, what's your problem?" + +> Alex: "@maintainers hey uh. Can someone look at this issue? Patt is getting a bit aggro. I tried to nudge them about it, but nope." + +> KeeperOfCommitBits: (on issue) "Hey Patt, maintainer here. Could you tone it down? This sort of attack is really not okay in this space." + +> Patt: "Leave me alone I haven't said anything bad wtf is wrong with you." + +> KeeperOfCommitBits: (deletes user's comment), "@patt I mean it. Please refer to the CoC over at (URL to this CoC) if you have questions, but you can consider this an actual warning. I'd appreciate it if you reworded your messages in this thread, since they made folks there uncomfortable. Let's try and be kind, yeah?" + +> Patt: "@keeperofbits Okay sorry. I'm just frustrated and I'm kinda burnt out and I guess I got carried away. I'll DM Alex a note apologizing and edit my messages. Sorry for the trouble." + +> KeeperOfCommitBits: "@patt Thanks for that. I hear you on the stress. Burnout sucks :/. Have a good one!" + +#### The Nope Case + +> PepeTheFrog🐸: "Hi, I am a literal actual nazi and I think white supremacists are quite fashionable." + +> Patt: "NOOOOPE. OH NOPE NOPE." + +> Alex: "JFC NO. NOPE. @keeperofbits NOPE NOPE LOOK HERE" + +> KeeperOfCommitBits: "👀 Nope. NOPE NOPE NOPE. 🔥" + +> PepeTheFrog🐸 has been banned from all organization or user repositories belonging to KeeperOfCommitBits. + +## Attribution + +This Code of Conduct was generated using [WeAllJS Code of Conduct Generator](https://npm.im/weallbehave), which is based on the [WeAllJS Code of +Conduct](https://wealljs.org/code-of-conduct), which is itself based on +[Contributor Covenant](http://contributor-covenant.org), version 1.4, available +at +[http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4), +and the LGBTQ in Technology Slack [Code of +Conduct](http://lgbtq.technology/coc.html). diff --git a/deps/npm/node_modules/libnpmaccess/CONTRIBUTING.md b/deps/npm/node_modules/libnpmaccess/CONTRIBUTING.md new file mode 100644 index 00000000000000..e13356ea444974 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/CONTRIBUTING.md @@ -0,0 +1,256 @@ +# Contributing + +## How do I... + +* [Use This Guide](#introduction)? +* Ask or Say Something? 🤔🐛😱 + * [Request Support](#request-support) + * [Report an Error or Bug](#report-an-error-or-bug) + * [Request a Feature](#request-a-feature) +* Make Something? 🤓👩🏽‍💻📜🍳 + * [Project Setup](#project-setup) + * [Contribute Documentation](#contribute-documentation) + * [Contribute Code](#contribute-code) +* Manage Something ✅🙆🏼💃👔 + * [Provide Support on Issues](#provide-support-on-issues) + * [Label Issues](#label-issues) + * [Clean Up Issues and PRs](#clean-up-issues-and-prs) + * [Review Pull Requests](#review-pull-requests) + * [Merge Pull Requests](#merge-pull-requests) + * [Tag a Release](#tag-a-release) + * [Join the Project Team](#join-the-project-team) +* Add a Guide Like This One [To My Project](#attribution)? 🤖😻👻 + +## Introduction + +Thank you so much for your interest in contributing!. All types of contributions are encouraged and valued. See the [table of contents](#toc) for different ways to help and details about how this project handles them!📝 + +Please make sure to read the relevant section before making your contribution! It will make it a lot easier for us maintainers to make the most of it and smooth out the experience for all involved. 💚 + +The [Project Team](#join-the-project-team) looks forward to your contributions. 🙌🏾✨ + +## Request Support + +If you have a question about this project, how to use it, or just need clarification about something: + +* Open an Issue at https://github.com/npm/libnpmaccess/issues +* Provide as much context as you can about what you're running into. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* Someone will try to have a response soon. +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. + +## Report an Error or Bug + +If you run into an error or bug with the project: + +* Open an Issue at https://github.com/npm/libnpmaccess/issues +* Include *reproduction steps* that someone else can follow to recreate the bug or error on their own. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* A team member will try to reproduce the issue with your provided steps. If there are no repro steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +* If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#contribute-code). +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. +* `critical` issues may be left open, depending on perceived immediacy and severity, even past the 30 day deadline. + +## Request a Feature + +If the project doesn't do something you need or want it to do: + +* Open an Issue at https://github.com/npm/libnpmaccess/issues +* Provide as much context as you can about what you're running into. +* Please try and be clear about why existing features and alternatives would not work for you. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* The project team will evaluate the feature request, possibly asking you more questions to understand its purpose and any relevant requirements. If the issue is closed, the team will convey their reasoning and suggest an alternative path forward. +* If the feature request is accepted, it will be marked for implementation with `feature-accepted`, which can then be done by either by a core team member or by anyone in the community who wants to [contribute code](#contribute-code). + +Note: The team is unlikely to be able to accept every single feature request that is filed. Please understand if they need to say no. + +## Project Setup + +So you wanna contribute some code! That's great! This project uses GitHub Pull Requests to manage contributions, so [read up on how to fork a GitHub project and file a PR](https://guides.github.com/activities/forking) if you've never done it before. + +If this seems like a lot or you aren't able to do all this setup, you might also be able to [edit the files directly](https://help.github.com/articles/editing-files-in-another-user-s-repository/) without having to do any of this setup. Yes, [even code](#contribute-code). + +If you want to go the usual route and run the project locally, though: + +* [Install Node.js](https://nodejs.org/en/download/) +* [Fork the project](https://guides.github.com/activities/forking/#fork) + +Then in your terminal: +* `cd path/to/your/clone` +* `npm install` +* `npm test` + +And you should be ready to go! + +## Contribute Documentation + +Documentation is a super important, critical part of this project. Docs are how we keep track of what we're doing, how, and why. It's how we stay on the same page about our policies. And it's how we tell others everything they need in order to be able to use this project -- or contribute to it. So thank you in advance. + +Documentation contributions of any size are welcome! Feel free to file a PR even if you're just rewording a sentence to be more clear, or fixing a spelling mistake! + +To contribute documentation: + +* [Set up the project](#project-setup). +* Edit or add any relevant documentation. +* Make sure your changes are formatted correctly and consistently with the rest of the documentation. +* Re-read what you wrote, and run a spellchecker on it to make sure you didn't miss anything. +* In your commit message(s), begin the first line with `docs: `. For example: `docs: Adding a doc contrib section to CONTRIBUTING.md`. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). Documentation commits should use `docs(): `. +* Go to https://github.com/npm/libnpmaccess/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Contribute Code + +We like code commits a lot! They're super handy, and they keep the project going and doing the work it needs to do to be useful to others. + +Code contributions of just about any size are acceptable! + +The main difference between code contributions and documentation contributions is that contributing code requires inclusion of relevant tests for the code being added or changed. Contributions without accompanying tests will be held off until a test is added, unless the maintainers consider the specific tests to be either impossible, or way too much of a burden for such a contribution. + +To contribute code: + +* [Set up the project](#project-setup). +* Make any necessary changes to the source code. +* Include any [additional documentation](#contribute-documentation) the changes might need. +* Write tests that verify that your contribution works as expected. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). +* Dependency updates, additions, or removals must be in individual commits, and the message must use the format: `(deps): PKG@VERSION`, where `` is any of the usual `conventional-changelog` prefixes, at your discretion. +* Go to https://github.com/npm/libnpmaccess/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* Barring special circumstances, maintainers will not review PRs until all checks pass (Travis, AppVeyor, etc). +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. Additional tags (such as `needs-tests`) will be added depending on the review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Provide Support on Issues + +[Needs Collaborator](#join-the-project-team): none + +Helping out other users with their questions is a really awesome way of contributing to any community. It's not uncommon for most of the issues on an open source projects being support-related questions by users trying to understand something they ran into, or find their way around a known bug. + +Sometimes, the `support` label will be added to things that turn out to actually be other things, like bugs or feature requests. In that case, suss out the details with the person who filed the original issue, add a comment explaining what the bug is, and change the label from `support` to `bug` or `feature`. If you can't do this yourself, @mention a maintainer so they can do it. + +In order to help other folks out with their questions: + +* Go to the issue tracker and [filter open issues by the `support` label](https://github.com/npm/libnpmaccess/issues?q=is%3Aopen+is%3Aissue+label%3Asupport). +* Read through the list until you find something that you're familiar enough with to give an answer to. +* Respond to the issue with whatever details are needed to clarify the question, or get more details about what's going on. +* Once the discussion wraps up and things are clarified, either close the issue, or ask the original issue filer (or a maintainer) to close it for you. + +Some notes on picking up support issues: + +* Avoid responding to issues you don't know you can answer accurately. +* As much as possible, try to refer to past issues with accepted answers. Link to them from your replies with the `#123` format. +* Be kind and patient with users -- often, folks who have run into confusing things might be upset or impatient. This is ok. Try to understand where they're coming from, and if you're too uncomfortable with the tone, feel free to stay away or withdraw from the issue. (note: if the user is outright hostile or is violating the CoC, [refer to the Code of Conduct](CODE_OF_CONDUCT.md) to resolve the conflict). + +## Label Issues + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +One of the most important tasks in handling issues is labeling them usefully and accurately. All other tasks involving issues ultimately rely on the issue being classified in such a way that relevant parties looking to do their own tasks can find them quickly and easily. + +In order to label issues, [open up the list of unlabeled issues](https://github.com/npm/libnpmaccess/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and, **from newest to oldest**, read through each one and apply issue labels according to the table below. If you're unsure about what label to apply, skip the issue and try the next one: don't feel obligated to label each and every issue yourself! + +Label | Apply When | Notes +--- | --- | --- +`bug` | Cases where the code (or documentation) is behaving in a way it wasn't intended to. | If something is happening that surprises the *user* but does not go against the way the code is designed, it should use the `enhancement` label. +`critical` | Added to `bug` issues if the problem described makes the code completely unusable in a common situation. | +`documentation` | Added to issues or pull requests that affect any of the documentation for the project. | Can be combined with other labels, such as `bug` or `enhancement`. +`duplicate` | Added to issues or PRs that refer to the exact same issue as another one that's been previously labeled. | Duplicate issues should be marked and closed right away, with a message referencing the issue it's a duplicate of (with `#123`) +`enhancement` | Added to [feature requests](#request-a-feature), PRs, or documentation issues that are purely additive: the code or docs currently work as expected, but a change is being requested or suggested. | +`help wanted` | Applied by [Committers](#join-the-project-team) to issues and PRs that they would like to get outside help for. Generally, this means it's lower priority for the maintainer team to itself implement, but that the community is encouraged to pick up if they so desire | Never applied on first-pass labeling. +`in-progress` | Applied by [Committers](#join-the-project-team) to PRs that are pending some work before they're ready for review. | The original PR submitter should @mention the team member that applied the label once the PR is complete. +`performance` | This issue or PR is directly related to improving performance. | +`refactor` | Added to issues or PRs that deal with cleaning up or modifying the project for the betterment of it. | +`starter` | Applied by [Committers](#join-the-project-team) to issues that they consider good introductions to the project for people who have not contributed before. These are not necessarily "easy", but rather focused around how much context is necessary in order to understand what needs to be done for this project in particular. | Existing project members are expected to stay away from these unless they increase in priority. +`support` | This issue is either asking a question about how to use the project, clarifying the reason for unexpected behavior, or possibly reporting a `bug` but does not have enough detail yet to determine whether it would count as such. | The label should be switched to `bug` if reliable reproduction steps are provided. Issues primarily with unintended configurations of a user's environment are not considered bugs, even if they cause crashes. +`tests` | This issue or PR either requests or adds primarily tests to the project. | If a PR is pending tests, that will be handled through the [PR review process](#review-pull-requests) +`wontfix` | Labelers may apply this label to issues that clearly have nothing at all to do with the project or are otherwise entirely outside of its scope/sphere of influence. [Committers](#join-the-project-team) may apply this label and close an issue or PR if they decide to pass on an otherwise relevant issue. | The issue or PR should be closed as soon as the label is applied, and a clear explanation provided of why the label was used. Contributors are free to contest the labeling, but the decision ultimately falls on committers as to whether to accept something or not. + +## Clean Up Issues and PRs + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +Issues and PRs can go stale after a while. Maybe they're abandoned. Maybe the team will just plain not have time to address them any time soon. + +In these cases, they should be closed until they're brought up again or the interaction starts over. + +To clean up issues and PRs: + +* Search the issue tracker for issues or PRs, and add the term `updated:<=YYYY-MM-DD`, where the date is 30 days before today. +* Go through each issue *from oldest to newest*, and close them if **all of the following are true**: + * not opened by a maintainer + * not marked as `critical` + * not marked as `starter` or `help wanted` (these might stick around for a while, in general, as they're intended to be available) + * no explicit messages in the comments asking for it to be left open + * does not belong to a milestone +* Leave a message when closing saying "Cleaning up stale issue. Please reopen or ping us if and when you're ready to resume this. See https://github.com/npm/libnpmaccess/blob/latest/CONTRIBUTING.md#clean-up-issues-and-prs for more details." + +## Review Pull Requests + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +While anyone can comment on a PR, add feedback, etc, PRs are only *approved* by team members with Issue Tracker or higher permissions. + +PR reviews use [GitHub's own review feature](https://help.github.com/articles/about-pull-request-reviews/), which manages comments, approval, and review iteration. + +Some notes: + +* You may ask for minor changes ("nitpicks"), but consider whether they are really blockers to merging: try to err on the side of "approve, with comments". +* *ALL PULL REQUESTS* should be covered by a test: either by a previously-failing test, an existing test that covers the entire functionality of the submitted code, or new tests to verify any new/changed behavior. All tests must also pass and follow established conventions. Test coverage should not drop, unless the specific case is considered reasonable by maintainers. +* Please make sure you're familiar with the code or documentation being updated, unless it's a minor change (spellchecking, minor formatting, etc). You may @mention another project member who you think is better suited for the review, but still provide a non-approving review of your own. +* Be extra kind: people who submit code/doc contributions are putting themselves in a pretty vulnerable position, and have put time and care into what they've done (even if that's not obvious to you!) -- always respond with respect, be understanding, but don't feel like you need to sacrifice your standards for their sake, either. Just don't be a jerk about it? + +## Merge Pull Requests + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. + +## Tag A Release + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. The most important bit here is probably that all tests must pass, and tags must use [semver](https://semver.org). + +## Join the Project Team + +### Ways to Join + +There are many ways to contribute! Most of them don't require any official status unless otherwise noted. That said, there's a couple of positions that grant special repository abilities, and this section describes how they're granted and what they do. + +All of the below positions are granted based on the project team's needs, as well as their consensus opinion about whether they would like to work with the person and think that they would fit well into that position. The process is relatively informal, and it's likely that people who express interest in participating can just be granted the permissions they'd like. + +You can spot a collaborator on the repo by looking for the `[Collaborator]` or `[Owner]` tags next to their names. + +Permission | Description +--- | --- +Issue Tracker | Granted to contributors who express a strong interest in spending time on the project's issue tracker. These tasks are mainly [labeling issues](#label-issues), [cleaning up old ones](#clean-up-issues-and-prs), and [reviewing pull requests](#review-pull-requests), as well as all the usual things non-team-member contributors can do. Issue handlers should not merge pull requests, tag releases, or directly commit code themselves: that should still be done through the usual pull request process. Becoming an Issue Handler means the project team trusts you to understand enough of the team's process and context to implement it on the issue tracker. +Committer | Granted to contributors who want to handle the actual pull request merges, tagging new versions, etc. Committers should have a good level of familiarity with the codebase, and enough context to understand the implications of various changes, as well as a good sense of the will and expectations of the project team. +Admin/Owner | Granted to people ultimately responsible for the project, its community, etc. + +## Attribution + +This guide was generated using the WeAllJS `CONTRIBUTING.md` generator. [Make your own](https://npm.im/weallcontribute)! diff --git a/deps/npm/node_modules/libnpmaccess/LICENSE b/deps/npm/node_modules/libnpmaccess/LICENSE new file mode 100644 index 00000000000000..209e4477f39c1a --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +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/libnpmaccess/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmaccess/PULL_REQUEST_TEMPLATE new file mode 100644 index 00000000000000..9471c6d325f7eb --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/PULL_REQUEST_TEMPLATE @@ -0,0 +1,7 @@ + diff --git a/deps/npm/node_modules/libnpmaccess/README.md b/deps/npm/node_modules/libnpmaccess/README.md new file mode 100644 index 00000000000000..2b639823a06415 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/README.md @@ -0,0 +1,258 @@ +# libnpmaccess [![npm version](https://img.shields.io/npm/v/libnpmaccess.svg)](https://npm.im/libnpmaccess) [![license](https://img.shields.io/npm/l/libnpmaccess.svg)](https://npm.im/libnpmaccess) [![Travis](https://img.shields.io/travis/npm/libnpmaccess/latest.svg)](https://travis-ci.org/npm/libnpmaccess) [![AppVeyor](https://img.shields.io/appveyor/ci/zkat/libnpmaccess/latest.svg)](https://ci.appveyor.com/project/zkat/libnpmaccess) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmaccess/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmaccess?branch=latest) + +[`libnpmaccess`](https://github.com/npm/libnpmaccess) is a Node.js +library that provides programmatic access to the guts of the npm CLI's `npm +access` command and its various subcommands. This includes managing account 2FA, +listing packages and permissions, looking at package collaborators, and defining +package permissions for users, orgs, and teams. + +## Example + +```javascript +const access = require('libnpmaccess') + +// List all packages @zkat has access to on the npm registry. +console.log(Object.keys(await access.lsPackages('zkat'))) +``` + +## Table of Contents + +* [Installing](#install) +* [Example](#example) +* [Contributing](#contributing) +* [API](#api) + * [access opts](#opts) + * [`public()`](#public) + * [`restricted()`](#restricted) + * [`grant()`](#grant) + * [`revoke()`](#revoke) + * [`tfaRequired()`](#tfa-required) + * [`tfaNotRequired()`](#tfa-not-required) + * [`lsPackages()`](#ls-packages) + * [`lsPackages.stream()`](#ls-packages-stream) + * [`lsCollaborators()`](#ls-collaborators) + * [`lsCollaborators.stream()`](#ls-collaborators-stream) + +### Install + +`$ npm install libnpmaccess` + +### Contributing + +The npm team enthusiastically welcomes contributions and project participation! +There's a bunch of things you can do if you want to contribute! The [Contributor +Guide](CONTRIBUTING.md) has all the information you need for everything from +reporting bugs to contributing entire new features. Please don't hesitate to +jump in if you'd like to, or even ask us questions if something isn't clear. + +All participants and maintainers in this project are expected to follow [Code of +Conduct](CODE_OF_CONDUCT.md), and just generally be excellent to each other. + +Please refer to the [Changelog](CHANGELOG.md) for project history details, too. + +Happy hacking! + +### API + +#### `opts` for `libnpmaccess` commands + +`libnpmaccess` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). +All options are passed through directly to that library, so please refer to [its +own `opts` +documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) +for options that can be passed in. + +A couple of options of note for those in a hurry: + +* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. +* `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmaccess` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` +* `opts.Promise` - If you pass this in, the Promises returned by `libnpmaccess` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` + +#### `> access.public(spec, [opts]) -> Promise` + +`spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible +registry spec. + +Makes package described by `spec` public. + +##### Example + +```javascript +await access.public('@foo/bar', {token: 'myregistrytoken'}) +// `@foo/bar` is now public +``` + +#### `> access.restricted(spec, [opts]) -> Promise` + +`spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible +registry spec. + +Makes package described by `spec` private/restricted. + +##### Example + +```javascript +await access.restricted('@foo/bar', {token: 'myregistrytoken'}) +// `@foo/bar` is now private +``` + +#### `> access.grant(spec, team, permissions, [opts]) -> Promise` + +`spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible +registry spec. `team` must be a fully-qualified team name, in the `scope:team` +format, with or without the `@` prefix, and the team must be a valid team within +that scope. `permissions` must be one of `'read-only'` or `'read-write'`. + +Grants `read-only` or `read-write` permissions for a certain package to a team. + +##### Example + +```javascript +await access.grant('@foo/bar', '@foo:myteam', 'read-write', { + token: 'myregistrytoken' +}) +// `@foo/bar` is now read/write enabled for the @foo:myteam team. +``` + +#### `> access.revoke(spec, team, [opts]) -> Promise` + +`spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible +registry spec. `team` must be a fully-qualified team name, in the `scope:team` +format, with or without the `@` prefix, and the team must be a valid team within +that scope. `permissions` must be one of `'read-only'` or `'read-write'`. + +Removes access to a package from a certain team. + +##### Example + +```javascript +await access.revoke('@foo/bar', '@foo:myteam', { + token: 'myregistrytoken' +}) +// @foo:myteam can no longer access `@foo/bar` +``` + +#### `> access.tfaRequired(spec, [opts]) -> Promise` + +`spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible +registry spec. + +Makes it so publishing or managing a package requires using 2FA tokens to +complete operations. + +##### Example + +```javascript +await access.tfaRequires('lodash', {token: 'myregistrytoken'}) +// Publishing or changing dist-tags on `lodash` now require OTP to be enabled. +``` + +#### `> access.tfaNotRequired(spec, [opts]) -> Promise` + +`spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible +registry spec. + +Disabled the package-level 2FA requirement for `spec`. Note that you will need +to pass in an `otp` token in `opts` in order to complete this operation. + +##### Example + +```javascript +await access.tfaNotRequired('lodash', {otp: '123654', token: 'myregistrytoken'}) +// Publishing or editing dist-tags on `lodash` no longer requires OTP to be +// enabled. +``` + +#### `> access.lsPackages(entity, [opts]) -> Promise` + +`entity` must be either a valid org or user name, or a fully-qualified team name +in the `scope:team` format, with or without the `@` prefix. + +Lists out packages a user, org, or team has access to, with corresponding +permissions. Packages that the access token does not have access to won't be +listed. + +In order to disambiguate between users and orgs, two requests may end up being +made when listing orgs or users. + +For a streamed version of these results, see +[`access.lsPackages.stream()`](#ls-package-stream). + +##### Example + +```javascript +await access.lsPackages('zkat', { + token: 'myregistrytoken' +}) +// Lists all packages `@zkat` has access to on the registry, and the +// corresponding permissions. +``` + +#### `> access.lsPackages.stream(scope, [team], [opts]) -> Stream` + +`entity` must be either a valid org or user name, or a fully-qualified team name +in the `scope:team` format, with or without the `@` prefix. + +Streams out packages a user, org, or team has access to, with corresponding +permissions, with each stream entry being formatted like `[packageName, +permissions]`. Packages that the access token does not have access to won't be +listed. + +In order to disambiguate between users and orgs, two requests may end up being +made when listing orgs or users. + +The returned stream is a valid `asyncIterator`. + +##### Example + +```javascript +for await (let [pkg, perm] of access.lsPackages.stream('zkat')) { + console.log('zkat has', perm, 'access to', pkg) +} +// zkat has read-write access to eggplant +// zkat has read-only access to @npmcorp/secret +``` + +#### `> access.lsCollaborators(spec, [user], [opts]) -> Promise` + +`spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible +registry spec. `user` must be a valid user name, with or without the `@` +prefix. + +Lists out access privileges for a certain package. Will only show permissions +for packages to which you have at least read access. If `user` is passed in, the +list is filtered only to teams _that_ user happens to belong to. + +For a streamed version of these results, see [`access.lsCollaborators.stream()`](#ls-collaborators-stream). + +##### Example + +```javascript +await access.lsCollaborators('@npm/foo', 'zkat', { + token: 'myregistrytoken' +}) +// Lists all teams with access to @npm/foo that @zkat belongs to. +``` + +#### `> access.lsCollaborators.stream(spec, [user], [opts]) -> Stream` + +`spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible +registry spec. `user` must be a valid user name, with or without the `@` +prefix. + +Stream out access privileges for a certain package, with each entry in `[user, +permissions]` format. Will only show permissions for packages to which you have +at least read access. If `user` is passed in, the list is filtered only to teams +_that_ user happens to belong to. + +The returned stream is a valid `asyncIterator`. + +##### Example + +```javascript +for await (let [usr, perm] of access.lsCollaborators.stream('npm')) { + console.log(usr, 'has', perm, 'access to npm') +} +// zkat has read-write access to npm +// iarna has read-write access to npm +``` diff --git a/deps/npm/node_modules/libnpmaccess/appveyor.yml b/deps/npm/node_modules/libnpmaccess/appveyor.yml new file mode 100644 index 00000000000000..9cc64c58e02f96 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/appveyor.yml @@ -0,0 +1,22 @@ +environment: + matrix: + - nodejs_version: "10" + - nodejs_version: "9" + - nodejs_version: "8" + - nodejs_version: "6" + +platform: + - x64 + +install: + - ps: Install-Product node $env:nodejs_version $env:platform + - npm config set spin false + - npm install + +test_script: + - npm test + +matrix: + fast_finish: true + +build: off diff --git a/deps/npm/node_modules/libnpmaccess/index.js b/deps/npm/node_modules/libnpmaccess/index.js new file mode 100644 index 00000000000000..e241fcbfc68a22 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/index.js @@ -0,0 +1,201 @@ +'use strict' + +const figgyPudding = require('figgy-pudding') +const getStream = require('get-stream') +const npa = require('npm-package-arg') +const npmFetch = require('npm-registry-fetch') +const {PassThrough} = require('stream') +const validate = require('aproba') + +const AccessConfig = figgyPudding({ + Promise: {default: () => Promise} +}) + +const eu = encodeURIComponent +const npar = spec => { + spec = npa(spec) + if (!spec.registry) { + throw new Error('`spec` must be a registry spec') + } + return spec +} + +const cmd = module.exports = {} + +cmd.public = (spec, opts) => setAccess(spec, 'public', opts) +cmd.restricted = (spec, opts) => setAccess(spec, 'restricted', opts) +function setAccess (spec, access, opts) { + opts = AccessConfig(opts) + return pwrap(opts, () => { + spec = npar(spec) + validate('OSO', [spec, access, opts]) + const uri = `/-/package/${eu(spec.name)}/access` + return npmFetch(uri, opts.concat({ + method: 'POST', + body: {access}, + spec + })) + }).then(res => res.body.resume() && true) +} + +cmd.grant = (spec, entity, permissions, opts) => { + opts = AccessConfig(opts) + return pwrap(opts, () => { + spec = npar(spec) + const {scope, team} = splitEntity(entity) + validate('OSSSO', [spec, scope, team, permissions, opts]) + if (permissions !== 'read-write' && permissions !== 'read-only') { + throw new Error('`permissions` must be `read-write` or `read-only`. Got `' + permissions + '` instead') + } + const uri = `/-/team/${eu(scope)}/${eu(team)}/package` + return npmFetch(uri, opts.concat({ + method: 'PUT', + body: {package: spec.name, permissions}, + scope, + spec, + ignoreBody: true + })) + }).then(() => true) +} + +cmd.revoke = (spec, entity, opts) => { + opts = AccessConfig(opts) + return pwrap(opts, () => { + spec = npar(spec) + const {scope, team} = splitEntity(entity) + validate('OSSO', [spec, scope, team, opts]) + const uri = `/-/team/${eu(scope)}/${eu(team)}/package` + return npmFetch(uri, opts.concat({ + method: 'DELETE', + body: {package: spec.name}, + scope, + spec, + ignoreBody: true + })) + }).then(() => true) +} + +cmd.lsPackages = (entity, opts) => { + opts = AccessConfig(opts) + return pwrap(opts, () => { + return getStream.array( + cmd.lsPackages.stream(entity, opts) + ).then(data => data.reduce((acc, [key, val]) => { + if (!acc) { + acc = {} + } + acc[key] = val + return acc + }, null)) + }) +} + +cmd.lsPackages.stream = (entity, opts) => { + validate('SO|SZ', [entity, opts]) + opts = AccessConfig(opts) + const {scope, team} = splitEntity(entity) + let uri + if (team) { + uri = `/-/team/${eu(scope)}/${eu(team)}/package` + } else { + uri = `/-/org/${eu(scope)}/package` + } + opts = opts.concat({ + query: {format: 'cli'}, + mapJson (value, [key]) { + if (value === 'read') { + return [key, 'read-only'] + } else if (value === 'write') { + return [key, 'read-write'] + } else { + return [key, value] + } + } + }) + const ret = new PassThrough({objectMode: true}) + npmFetch.json.stream(uri, '*', opts).on('error', err => { + if (err.code === 'E404' && !team) { + uri = `/-/user/${eu(scope)}/package` + npmFetch.json.stream(uri, '*', opts).on( + 'error', err => ret.emit('error', err) + ).pipe(ret) + } else { + ret.emit('error', err) + } + }).pipe(ret) + return ret +} + +cmd.lsCollaborators = (spec, user, opts) => { + if (typeof user === 'object' && !opts) { + opts = user + user = undefined + } + opts = AccessConfig(opts) + return pwrap(opts, () => { + return getStream.array( + cmd.lsCollaborators.stream(spec, user, opts) + ).then(data => data.reduce((acc, [key, val]) => { + if (!acc) { + acc = {} + } + acc[key] = val + return acc + }, null)) + }) +} + +cmd.lsCollaborators.stream = (spec, user, opts) => { + if (typeof user === 'object' && !opts) { + opts = user + user = undefined + } + opts = AccessConfig(opts) + spec = npar(spec) + validate('OSO|OZO', [spec, user, opts]) + const uri = `/-/package/${eu(spec.name)}/collaborators` + return npmFetch.json.stream(uri, '*', opts.concat({ + query: {format: 'cli', user: user || undefined}, + mapJson (value, [key]) { + if (value === 'read') { + return [key, 'read-only'] + } else if (value === 'write') { + return [key, 'read-write'] + } else { + return [key, value] + } + } + })) +} + +cmd.tfaRequired = (spec, opts) => setRequires2fa(spec, true, opts) +cmd.tfaNotRequired = (spec, opts) => setRequires2fa(spec, false, opts) +function setRequires2fa (spec, required, opts) { + opts = AccessConfig(opts) + return new opts.Promise((resolve, reject) => { + spec = npar(spec) + validate('OBO', [spec, required, opts]) + const uri = `/-/package/${eu(spec.name)}/access` + return npmFetch(uri, opts.concat({ + method: 'POST', + body: {publish_requires_tfa: required}, + spec, + ignoreBody: true + })).then(resolve, reject) + }).then(() => true) +} + +cmd.edit = () => { + throw new Error('Not implemented yet') +} + +function splitEntity (entity = '') { + let [, scope, team] = entity.match(/^@?([^:]+)(?::(.*))?$/) || [] + return {scope, team} +} + +function pwrap (opts, fn) { + return new opts.Promise((resolve, reject) => { + fn().then(resolve, reject) + }) +} diff --git a/deps/npm/node_modules/libnpmaccess/node_modules/aproba/CHANGELOG.md b/deps/npm/node_modules/libnpmaccess/node_modules/aproba/CHANGELOG.md new file mode 100644 index 00000000000000..bab30ecb7e625d --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/node_modules/aproba/CHANGELOG.md @@ -0,0 +1,4 @@ +2.0.0 + * Drop support for 0.10 and 0.12. They haven't been in travis but still, + since we _know_ we'll break with them now it's only polite to do a + major bump. diff --git a/deps/npm/node_modules/libnpmaccess/node_modules/aproba/LICENSE b/deps/npm/node_modules/libnpmaccess/node_modules/aproba/LICENSE new file mode 100644 index 00000000000000..2a4982dc40cb69 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/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/libnpmaccess/node_modules/aproba/README.md b/deps/npm/node_modules/libnpmaccess/node_modules/aproba/README.md new file mode 100644 index 00000000000000..e94799201ce046 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/node_modules/aproba/README.md @@ -0,0 +1,93 @@ +aproba +====== + +A ridiculously 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 | `Array.isArray` 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` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### 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/libnpmaccess/node_modules/aproba/index.js b/deps/npm/node_modules/libnpmaccess/node_modules/aproba/index.js new file mode 100644 index 00000000000000..fd947481ba5575 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' +module.exports = validate + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +const types = { + '*': {label: 'any', check: () => true}, + A: {label: 'array', check: _ => Array.isArray(_) || isArguments(_)}, + S: {label: 'string', check: _ => typeof _ === 'string'}, + N: {label: 'number', check: _ => typeof _ === 'number'}, + F: {label: 'function', check: _ => typeof _ === 'function'}, + O: {label: 'object', check: _ => typeof _ === 'object' && _ != null && !types.A.check(_) && !types.E.check(_)}, + B: {label: 'boolean', check: _ => typeof _ === 'boolean'}, + E: {label: 'error', check: _ => _ instanceof Error}, + Z: {label: 'null', check: _ => _ == null} +} + +function addSchema (schema, arity) { + const group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +function validate (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + const schemas = rawSchemas.split('|') + const arity = {} + + schemas.forEach(schema => { + for (let ii = 0; ii < schema.length; ++ii) { + const type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + let matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (let ii = 0; ii < args.length; ++ii) { + let newMatching = matching.filter(schema => { + const type = schema[ii] + const typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + const labels = matching.map(_ => types[_[ii]].label).filter(_ => _ != null) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +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, expectedTypes, value) { + let valueType + Object.keys(types).forEach(typeCode => { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + const english = englishList(expected) + const args = expected.every(ex => ex.length === 1) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + const err = new Error(msg) + err.code = code + /* istanbul ignore else */ + if (Error.captureStackTrace) Error.captureStackTrace(err, validate) + return err +} diff --git a/deps/npm/node_modules/libnpmaccess/node_modules/aproba/package.json b/deps/npm/node_modules/libnpmaccess/node_modules/aproba/package.json new file mode 100644 index 00000000000000..c184114b068494 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/node_modules/aproba/package.json @@ -0,0 +1,66 @@ +{ + "_args": [ + [ + "aproba@2.0.0", + "/Users/zkat/Documents/code/work/npm" + ] + ], + "_from": "aproba@2.0.0", + "_id": "aproba@2.0.0", + "_inBundle": false, + "_integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "_location": "/libnpmaccess/aproba", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "aproba@2.0.0", + "name": "aproba", + "escapedName": "aproba", + "rawSpec": "2.0.0", + "saveSpec": null, + "fetchSpec": "2.0.0" + }, + "_requiredBy": [ + "/libnpmaccess" + ], + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "_spec": "2.0.0", + "_where": "/Users/zkat/Documents/code/work/npm", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "dependencies": {}, + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "devDependencies": { + "standard": "^11.0.1", + "tap": "^12.0.1" + }, + "directories": { + "test": "test" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "name": "aproba", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "pretest": "standard", + "test": "tap --100 -J test/*.js" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/libnpmaccess/package.json b/deps/npm/node_modules/libnpmaccess/package.json new file mode 100644 index 00000000000000..c60e95b8d975fe --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/package.json @@ -0,0 +1,66 @@ +{ + "_from": "libnpmaccess@^3.0.1", + "_id": "libnpmaccess@3.0.1", + "_inBundle": false, + "_integrity": "sha512-RlZ7PNarCBt+XbnP7R6PoVgOq9t+kou5rvhaInoNibhPO7eMlRfS0B8yjatgn2yaHIwWNyoJDolC/6Lc5L/IQA==", + "_location": "/libnpmaccess", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "libnpmaccess@^3.0.1", + "name": "libnpmaccess", + "escapedName": "libnpmaccess", + "rawSpec": "^3.0.1", + "saveSpec": null, + "fetchSpec": "^3.0.1" + }, + "_requiredBy": [ + "/libnpm" + ], + "_resolved": "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-3.0.1.tgz", + "_shasum": "5b3a9de621f293d425191aa2e779102f84167fa8", + "_spec": "libnpmaccess@^3.0.1", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpm", + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech" + }, + "bugs": { + "url": "https://github.com/npm/libnpmaccess/issues" + }, + "bundleDependencies": false, + "dependencies": { + "aproba": "^2.0.0", + "get-stream": "^4.0.0", + "npm-package-arg": "^6.1.0", + "npm-registry-fetch": "^3.8.0" + }, + "deprecated": false, + "description": "programmatic library for `npm access` commands", + "devDependencies": { + "nock": "^9.6.1", + "standard": "*", + "standard-version": "*", + "tap": "*", + "weallbehave": "*", + "weallcontribute": "*" + }, + "homepage": "https://npmjs.com/package/libnpmaccess", + "license": "ISC", + "name": "libnpmaccess", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/libnpmaccess.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --100 test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "3.0.1" +} diff --git a/deps/npm/node_modules/libnpmaccess/test/index.js b/deps/npm/node_modules/libnpmaccess/test/index.js new file mode 100644 index 00000000000000..b48815e79a1fb3 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/test/index.js @@ -0,0 +1,347 @@ +'use strict' + +const figgyPudding = require('figgy-pudding') +const getStream = require('get-stream') +const {test} = require('tap') +const tnock = require('./util/tnock.js') + +const access = require('../index.js') + +const REG = 'http://localhost:1337' +const OPTS = figgyPudding({})({ + registry: REG +}) + +test('access public', t => { + tnock(t, REG).post( + '/-/package/%40foo%2Fbar/access', {access: 'public'} + ).reply(200) + return access.public('@foo/bar', OPTS).then(ret => { + t.deepEqual(ret, true, 'request succeeded') + }) +}) + +test('access restricted', t => { + tnock(t, REG).post( + '/-/package/%40foo%2Fbar/access', {access: 'restricted'} + ).reply(200) + return access.restricted('@foo/bar', OPTS).then(ret => { + t.deepEqual(ret, true, 'request succeeded') + }) +}) + +test('access 2fa-required', t => { + tnock(t, REG).post('/-/package/%40foo%2Fbar/access', { + publish_requires_tfa: true + }).reply(200, {ok: true}) + return access.tfaRequired('@foo/bar', OPTS).then(ret => { + t.deepEqual(ret, true, 'request succeeded') + }) +}) + +test('access 2fa-not-required', t => { + tnock(t, REG).post('/-/package/%40foo%2Fbar/access', { + publish_requires_tfa: false + }).reply(200, {ok: true}) + return access.tfaNotRequired('@foo/bar', OPTS).then(ret => { + t.deepEqual(ret, true, 'request succeeded') + }) +}) + +test('access grant basic read-write', t => { + tnock(t, REG).put('/-/team/myorg/myteam/package', { + package: '@foo/bar', + permissions: 'read-write' + }).reply(201) + return access.grant( + '@foo/bar', 'myorg:myteam', 'read-write', OPTS + ).then(ret => { + t.deepEqual(ret, true, 'request succeeded') + }) +}) + +test('access grant basic read-only', t => { + tnock(t, REG).put('/-/team/myorg/myteam/package', { + package: '@foo/bar', + permissions: 'read-only' + }).reply(201) + return access.grant( + '@foo/bar', 'myorg:myteam', 'read-only', OPTS + ).then(ret => { + t.deepEqual(ret, true, 'request succeeded') + }) +}) + +test('access grant bad perm', t => { + return access.grant( + '@foo/bar', 'myorg:myteam', 'unknown', OPTS + ).then(ret => { + throw new Error('should not have succeeded') + }, err => { + t.match( + err.message, + /must be.*read-write.*read-only/, + 'only read-write and read-only are accepted' + ) + }) +}) + +test('access grant no entity', t => { + return access.grant( + '@foo/bar', undefined, 'read-write', OPTS + ).then(ret => { + throw new Error('should not have succeeded') + }, err => { + t.match( + err.message, + /Expected string/, + 'passing undefined entity gives useful error' + ) + }) +}) + +test('access grant basic unscoped', t => { + tnock(t, REG).put('/-/team/myorg/myteam/package', { + package: 'bar', + permissions: 'read-write' + }).reply(201) + return access.grant( + 'bar', 'myorg:myteam', 'read-write', OPTS + ).then(ret => { + t.deepEqual(ret, true, 'request succeeded') + }) +}) + +test('access revoke basic', t => { + tnock(t, REG).delete('/-/team/myorg/myteam/package', { + package: '@foo/bar' + }).reply(200) + return access.revoke('@foo/bar', 'myorg:myteam', OPTS).then(ret => { + t.deepEqual(ret, true, 'request succeeded') + }) +}) + +test('access revoke basic unscoped', t => { + tnock(t, REG).delete('/-/team/myorg/myteam/package', { + package: 'bar' + }).reply(200, {accessChanged: true}) + return access.revoke('bar', 'myorg:myteam', OPTS).then(ret => { + t.deepEqual(ret, true, 'request succeeded') + }) +}) + +test('ls-packages on team', t => { + const serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read', + '@foo/other': 'shrödinger' + } + const clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only', + '@foo/other': 'shrödinger' + } + tnock(t, REG).get( + '/-/team/myorg/myteam/package?format=cli' + ).reply(200, serverPackages) + return access.lsPackages('myorg:myteam', OPTS).then(data => { + t.deepEqual(data, clientPackages, 'got client package info') + }) +}) + +test('ls-packages on org', t => { + const serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read', + '@foo/other': 'shrödinger' + } + const clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only', + '@foo/other': 'shrödinger' + } + tnock(t, REG).get( + '/-/org/myorg/package?format=cli' + ).reply(200, serverPackages) + return access.lsPackages('myorg', OPTS).then(data => { + t.deepEqual(data, clientPackages, 'got client package info') + }) +}) + +test('ls-packages on user', t => { + const serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read', + '@foo/other': 'shrödinger' + } + const clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only', + '@foo/other': 'shrödinger' + } + const srv = tnock(t, REG) + srv.get('/-/org/myuser/package?format=cli').reply(404, {error: 'not found'}) + srv.get('/-/user/myuser/package?format=cli').reply(200, serverPackages) + return access.lsPackages('myuser', OPTS).then(data => { + t.deepEqual(data, clientPackages, 'got client package info') + }) +}) + +test('ls-packages error on team', t => { + tnock(t, REG).get('/-/team/myorg/myteam/package?format=cli').reply(404) + return access.lsPackages('myorg:myteam', OPTS).then( + () => { throw new Error('should not have succeeded') }, + err => t.equal(err.code, 'E404', 'spit out 404 directly if team provided') + ) +}) + +test('ls-packages error on user', t => { + const srv = tnock(t, REG) + srv.get('/-/org/myuser/package?format=cli').reply(404, {error: 'not found'}) + srv.get('/-/user/myuser/package?format=cli').reply(404, {error: 'not found'}) + return access.lsPackages('myuser', OPTS).then( + () => { throw new Error('should not have succeeded') }, + err => t.equal(err.code, 'E404', 'spit out 404 if both reqs fail') + ) +}) + +test('ls-packages bad response', t => { + tnock(t, REG).get( + '/-/team/myorg/myteam/package?format=cli' + ).reply(200, JSON.stringify(null)) + return access.lsPackages('myorg:myteam', OPTS).then(data => { + t.deepEqual(data, null, 'succeeds with null') + }) +}) + +test('ls-packages stream', t => { + const serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read', + '@foo/other': 'shrödinger' + } + const clientPackages = [ + ['@foo/bar', 'read-write'], + ['@foo/util', 'read-only'], + ['@foo/other', 'shrödinger'] + ] + tnock(t, REG).get( + '/-/team/myorg/myteam/package?format=cli' + ).reply(200, serverPackages) + return getStream.array( + access.lsPackages.stream('myorg:myteam', OPTS) + ).then(data => { + t.deepEqual(data, clientPackages, 'got streamed client package info') + }) +}) + +test('ls-collaborators', t => { + const serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read', + 'myorg:thirdteam': 'special-case' + } + const clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only', + 'myorg:thirdteam': 'special-case' + } + tnock(t, REG).get( + '/-/package/%40foo%2Fbar/collaborators?format=cli' + ).reply(200, serverCollaborators) + return access.lsCollaborators('@foo/bar', OPTS).then(data => { + t.deepEqual(data, clientCollaborators, 'got collaborators') + }) +}) + +test('ls-collaborators stream', t => { + const serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read', + 'myorg:thirdteam': 'special-case' + } + const clientCollaborators = [ + ['myorg:myteam', 'read-write'], + ['myorg:anotherteam', 'read-only'], + ['myorg:thirdteam', 'special-case'] + ] + tnock(t, REG).get( + '/-/package/%40foo%2Fbar/collaborators?format=cli' + ).reply(200, serverCollaborators) + return getStream.array( + access.lsCollaborators.stream('@foo/bar', OPTS) + ).then(data => { + t.deepEqual(data, clientCollaborators, 'got collaborators') + }) +}) + +test('ls-collaborators w/scope', t => { + const serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read', + 'myorg:thirdteam': 'special-case' + } + const clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only', + 'myorg:thirdteam': 'special-case' + } + tnock(t, REG).get( + '/-/package/%40foo%2Fbar/collaborators?format=cli&user=zkat' + ).reply(200, serverCollaborators) + return access.lsCollaborators('@foo/bar', 'zkat', OPTS).then(data => { + t.deepEqual(data, clientCollaborators, 'got collaborators') + }) +}) + +test('ls-collaborators w/o scope', t => { + const serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read', + 'myorg:thirdteam': 'special-case' + } + const clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only', + 'myorg:thirdteam': 'special-case' + } + tnock(t, REG).get( + '/-/package/bar/collaborators?format=cli&user=zkat' + ).reply(200, serverCollaborators) + return access.lsCollaborators('bar', 'zkat', OPTS).then(data => { + t.deepEqual(data, clientCollaborators, 'got collaborators') + }) +}) + +test('ls-collaborators bad response', t => { + tnock(t, REG).get( + '/-/package/%40foo%2Fbar/collaborators?format=cli' + ).reply(200, JSON.stringify(null)) + return access.lsCollaborators('@foo/bar', null, OPTS).then(data => { + t.deepEqual(data, null, 'succeeds with null') + }) +}) + +test('error on non-registry specs', t => { + const resolve = () => { throw new Error('should not succeed') } + const reject = err => t.match( + err.message, /spec.*must be a registry spec/, 'registry spec required' + ) + return Promise.all([ + access.public('foo/bar').then(resolve, reject), + access.restricted('foo/bar').then(resolve, reject), + access.grant('foo/bar', 'myorg', 'myteam', 'read-only').then(resolve, reject), + access.revoke('foo/bar', 'myorg', 'myteam').then(resolve, reject), + access.lsCollaborators('foo/bar').then(resolve, reject), + access.tfaRequired('foo/bar').then(resolve, reject), + access.tfaNotRequired('foo/bar').then(resolve, reject) + ]) +}) + +test('edit', t => { + t.equal(typeof access.edit, 'function', 'access.edit exists') + t.throws(() => { + access.edit() + }, /Not implemented/, 'directly throws NIY message') + t.done() +}) diff --git a/deps/npm/node_modules/libnpmaccess/test/util/tnock.js b/deps/npm/node_modules/libnpmaccess/test/util/tnock.js new file mode 100644 index 00000000000000..00b6e160e10192 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/test/util/tnock.js @@ -0,0 +1,12 @@ +'use strict' + +const nock = require('nock') + +module.exports = tnock +function tnock (t, host) { + const server = nock(host) + t.tearDown(function () { + server.done() + }) + return server +} diff --git a/deps/npm/node_modules/libnpmconfig/CHANGELOG.md b/deps/npm/node_modules/libnpmconfig/CHANGELOG.md new file mode 100644 index 00000000000000..a5708cc7ca50df --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/CHANGELOG.md @@ -0,0 +1,51 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [1.2.1](https://github.com/npm/libnpmconfig/compare/v1.2.0...v1.2.1) (2018-11-13) + + +### Bug Fixes + +* **proj:** make sure proj object exists ([8fe2663](https://github.com/npm/libnpmconfig/commit/8fe2663)) + + + + +# [1.2.0](https://github.com/npm/libnpmconfig/compare/v1.1.1...v1.2.0) (2018-11-13) + + +### Features + +* **cache:** improved cache parsing/handling ([63ba3bb](https://github.com/npm/libnpmconfig/commit/63ba3bb)) + + + + +## [1.1.1](https://github.com/npm/libnpmconfig/compare/v1.1.0...v1.1.1) (2018-11-04) + + +### Bug Fixes + +* **config:** rework load order and support builtin configs ([5ef1ac5](https://github.com/npm/libnpmconfig/commit/5ef1ac5)) + + + + +# [1.1.0](https://github.com/npm/libnpmconfig/compare/v1.0.0...v1.1.0) (2018-11-04) + + +### Features + +* **userconfig:** allow passing in userconfig from env ([f613877](https://github.com/npm/libnpmconfig/commit/f613877)) + + + + +# 1.0.0 (2018-11-04) + + +### Features + +* **api:** add read() function ([710426b](https://github.com/npm/libnpmconfig/commit/710426b)) diff --git a/deps/npm/node_modules/libnpmconfig/CODE_OF_CONDUCT.md b/deps/npm/node_modules/libnpmconfig/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000000..aeb72f598dcb45 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/CODE_OF_CONDUCT.md @@ -0,0 +1,151 @@ +# Code of Conduct + +## When Something Happens + +If you see a Code of Conduct violation, follow these steps: + +1. Let the person know that what they did is not appropriate and ask them to stop and/or edit their message(s) or commits. +2. That person should immediately stop the behavior and correct the issue. +3. If this doesn’t happen, or if you're uncomfortable speaking up, [contact the maintainers](#contacting-maintainers). +4. As soon as available, a maintainer will look into the issue, and take [further action (see below)](#further-enforcement), starting with a warning, then temporary block, then long-term repo or organization ban. + +When reporting, please include any relevant details, links, screenshots, context, or other information that may be used to better understand and resolve the situation. + +**The maintainer team will prioritize the well-being and comfort of the recipients of the violation over the comfort of the violator.** See [some examples below](#enforcement-examples). + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers of this project pledge to making participation in our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, technical preferences, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + + * Using welcoming and inclusive language. + * Being respectful of differing viewpoints and experiences. + * Gracefully accepting constructive feedback. + * Focusing on what is best for the community. + * Showing empathy and kindness towards other community members. + * Encouraging and raising up your peers in the project so you can all bask in hacks and glory. + +Examples of unacceptable behavior by participants include: + + * The use of sexualized language or imagery and unwelcome sexual attention or advances, including when simulated online. The only exception to sexual topics is channels/spaces specifically for topics of sexual identity. + * Casual mention of slavery or indentured servitude and/or false comparisons of one's occupation or situation to slavery. Please consider using or asking about alternate terminology when referring to such metaphors in technology. + * Making light of/making mocking comments about trigger warnings and content warnings. + * Trolling, insulting/derogatory comments, and personal or political attacks. + * Public or private harassment, deliberate intimidation, or threats. + * Publishing others' private information, such as a physical or electronic address, without explicit permission. This includes any sort of "outing" of any aspect of someone's identity without their consent. + * Publishing private screenshots or quotes of interactions in the context of this project without all quoted users' *explicit* consent. + * Publishing of private communication that doesn't have to do with reporting harrassment. + * Any of the above even when [presented as "ironic" or "joking"](https://en.wikipedia.org/wiki/Hipster_racism). + * Any attempt to present "reverse-ism" versions of the above as violations. Examples of reverse-isms are "reverse racism", "reverse sexism", "heterophobia", and "cisphobia". + * Unsolicited explanations under the assumption that someone doesn't already know it. Ask before you teach! Don't assume what people's knowledge gaps are. + * [Feigning or exaggerating surprise](https://www.recurse.com/manual#no-feigned-surprise) when someone admits to not knowing something. + * "[Well-actuallies](https://www.recurse.com/manual#no-well-actuallys)" + * Other conduct which could reasonably be considered inappropriate in a professional or community setting. + +## Scope + +This Code of Conduct applies both within spaces involving this project and in other spaces involving community members. This includes the repository, its Pull Requests and Issue tracker, its Twitter community, private email communications in the context of the project, and any events where members of the project are participating, as well as adjacent communities and venues affecting the project's members. + +Depending on the violation, the maintainers may decide that violations of this code of conduct that have happened outside of the scope of the community may deem an individual unwelcome, and take appropriate action to maintain the comfort and safety of its members. + +### Other Community Standards + +As a project on GitHub, this project is additionally covered by the [GitHub Community Guidelines](https://help.github.com/articles/github-community-guidelines/). + +Additionally, as a project hosted on npm, is is covered by [npm, Inc's Code of Conduct](https://www.npmjs.com/policies/conduct). + +Enforcement of those guidelines after violations overlapping with the above are the responsibility of the entities, and enforcement may happen in any or all of the services/communities. + +## Maintainer Enforcement Process + +Once the maintainers get involved, they will follow a documented series of steps and do their best to preserve the well-being of project members. This section covers actual concrete steps. + +### Contacting Maintainers + +You may get in touch with the maintainer team through any of the following methods: + + * Through email: + * [kzm@zkat.tech](mailto:kzm@zkat.tech) (Kat Marchán) + + * Through Twitter: + * [@maybekatz](https://twitter.com/maybekatz) (Kat Marchán) + +### Further Enforcement + +If you've already followed the [initial enforcement steps](#enforcement), these are the steps maintainers will take for further enforcement, as needed: + + 1. Repeat the request to stop. + 2. If the person doubles down, they will have offending messages removed or edited by a maintainers given an official warning. The PR or Issue may be locked. + 3. If the behavior continues or is repeated later, the person will be blocked from participating for 24 hours. + 4. If the behavior continues or is repeated after the temporary block, a long-term (6-12mo) ban will be used. + +On top of this, maintainers may remove any offending messages, images, contributions, etc, as they deem necessary. + +Maintainers reserve full rights to skip any of these steps, at their discretion, if the violation is considered to be a serious and/or immediate threat to the health and well-being of members of the community. These include any threats, serious physical or verbal attacks, and other such behavior that would be completely unacceptable in any social setting that puts our members at risk. + +Members expelled from events or venues with any sort of paid attendance will not be refunded. + +### Who Watches the Watchers? + +Maintainers and other leaders who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. These may include anything from removal from the maintainer team to a permanent ban from the community. + +Additionally, as a project hosted on both GitHub and npm, [their own Codes of Conducts may be applied against maintainers of this project](#other-community-standards), externally of this project's procedures. + +### Enforcement Examples + +#### The Best Case + +The vast majority of situations work out like this. This interaction is common, and generally positive. + +> Alex: "Yeah I used X and it was really crazy!" + +> Patt (not a maintainer): "Hey, could you not use that word? What about 'ridiculous' instead?" + +> Alex: "oh sorry, sure." -> edits old comment to say "it was really confusing!" + +#### The Maintainer Case + +Sometimes, though, you need to get maintainers involved. Maintainers will do their best to resolve conflicts, but people who were harmed by something **will take priority**. + +> Patt: "Honestly, sometimes I just really hate using $library and anyone who uses it probably sucks at their job." + +> Alex: "Whoa there, could you dial it back a bit? There's a CoC thing about attacking folks' tech use like that." + +> Patt: "I'm not attacking anyone, what's your problem?" + +> Alex: "@maintainers hey uh. Can someone look at this issue? Patt is getting a bit aggro. I tried to nudge them about it, but nope." + +> KeeperOfCommitBits: (on issue) "Hey Patt, maintainer here. Could you tone it down? This sort of attack is really not okay in this space." + +> Patt: "Leave me alone I haven't said anything bad wtf is wrong with you." + +> KeeperOfCommitBits: (deletes user's comment), "@patt I mean it. Please refer to the CoC over at (URL to this CoC) if you have questions, but you can consider this an actual warning. I'd appreciate it if you reworded your messages in this thread, since they made folks there uncomfortable. Let's try and be kind, yeah?" + +> Patt: "@keeperofbits Okay sorry. I'm just frustrated and I'm kinda burnt out and I guess I got carried away. I'll DM Alex a note apologizing and edit my messages. Sorry for the trouble." + +> KeeperOfCommitBits: "@patt Thanks for that. I hear you on the stress. Burnout sucks :/. Have a good one!" + +#### The Nope Case + +> PepeTheFrog🐸: "Hi, I am a literal actual nazi and I think white supremacists are quite fashionable." + +> Patt: "NOOOOPE. OH NOPE NOPE." + +> Alex: "JFC NO. NOPE. @keeperofbits NOPE NOPE LOOK HERE" + +> KeeperOfCommitBits: "👀 Nope. NOPE NOPE NOPE. 🔥" + +> PepeTheFrog🐸 has been banned from all organization or user repositories belonging to KeeperOfCommitBits. + +## Attribution + +This Code of Conduct was generated using [WeAllJS Code of Conduct Generator](https://npm.im/weallbehave), which is based on the [WeAllJS Code of +Conduct](https://wealljs.org/code-of-conduct), which is itself based on +[Contributor Covenant](http://contributor-covenant.org), version 1.4, available +at +[http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4), +and the LGBTQ in Technology Slack [Code of +Conduct](http://lgbtq.technology/coc.html). diff --git a/deps/npm/node_modules/libnpmconfig/CONTRIBUTING.md b/deps/npm/node_modules/libnpmconfig/CONTRIBUTING.md new file mode 100644 index 00000000000000..970c1cf43aca08 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/CONTRIBUTING.md @@ -0,0 +1,256 @@ +# Contributing + +## How do I... + +* [Use This Guide](#introduction)? +* Ask or Say Something? 🤔🐛😱 + * [Request Support](#request-support) + * [Report an Error or Bug](#report-an-error-or-bug) + * [Request a Feature](#request-a-feature) +* Make Something? 🤓👩🏽‍💻📜🍳 + * [Project Setup](#project-setup) + * [Contribute Documentation](#contribute-documentation) + * [Contribute Code](#contribute-code) +* Manage Something ✅🙆🏼💃👔 + * [Provide Support on Issues](#provide-support-on-issues) + * [Label Issues](#label-issues) + * [Clean Up Issues and PRs](#clean-up-issues-and-prs) + * [Review Pull Requests](#review-pull-requests) + * [Merge Pull Requests](#merge-pull-requests) + * [Tag a Release](#tag-a-release) + * [Join the Project Team](#join-the-project-team) +* Add a Guide Like This One [To My Project](#attribution)? 🤖😻👻 + +## Introduction + +Thank you so much for your interest in contributing!. All types of contributions are encouraged and valued. See the [table of contents](#toc) for different ways to help and details about how this project handles them!📝 + +Please make sure to read the relevant section before making your contribution! It will make it a lot easier for us maintainers to make the most of it and smooth out the experience for all involved. 💚 + +The [Project Team](#join-the-project-team) looks forward to your contributions. 🙌🏾✨ + +## Request Support + +If you have a question about this project, how to use it, or just need clarification about something: + +* Open an Issue at https://github.com/npm/libnpmconfig/issues +* Provide as much context as you can about what you're running into. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* Someone will try to have a response soon. +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. + +## Report an Error or Bug + +If you run into an error or bug with the project: + +* Open an Issue at https://github.com/npm/libnpmconfig/issues +* Include *reproduction steps* that someone else can follow to recreate the bug or error on their own. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* A team member will try to reproduce the issue with your provided steps. If there are no repro steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +* If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#contribute-code). +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. +* `critical` issues may be left open, depending on perceived immediacy and severity, even past the 30 day deadline. + +## Request a Feature + +If the project doesn't do something you need or want it to do: + +* Open an Issue at https://github.com/npm/libnpmconfig/issues +* Provide as much context as you can about what you're running into. +* Please try and be clear about why existing features and alternatives would not work for you. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* The project team will evaluate the feature request, possibly asking you more questions to understand its purpose and any relevant requirements. If the issue is closed, the team will convey their reasoning and suggest an alternative path forward. +* If the feature request is accepted, it will be marked for implementation with `feature-accepted`, which can then be done by either by a core team member or by anyone in the community who wants to [contribute code](#contribute-code). + +Note: The team is unlikely to be able to accept every single feature request that is filed. Please understand if they need to say no. + +## Project Setup + +So you wanna contribute some code! That's great! This project uses GitHub Pull Requests to manage contributions, so [read up on how to fork a GitHub project and file a PR](https://guides.github.com/activities/forking) if you've never done it before. + +If this seems like a lot or you aren't able to do all this setup, you might also be able to [edit the files directly](https://help.github.com/articles/editing-files-in-another-user-s-repository/) without having to do any of this setup. Yes, [even code](#contribute-code). + +If you want to go the usual route and run the project locally, though: + +* [Install Node.js](https://nodejs.org/en/download/) +* [Fork the project](https://guides.github.com/activities/forking/#fork) + +Then in your terminal: +* `cd path/to/your/clone` +* `npm install` +* `npm test` + +And you should be ready to go! + +## Contribute Documentation + +Documentation is a super important, critical part of this project. Docs are how we keep track of what we're doing, how, and why. It's how we stay on the same page about our policies. And it's how we tell others everything they need in order to be able to use this project -- or contribute to it. So thank you in advance. + +Documentation contributions of any size are welcome! Feel free to file a PR even if you're just rewording a sentence to be more clear, or fixing a spelling mistake! + +To contribute documentation: + +* [Set up the project](#project-setup). +* Edit or add any relevant documentation. +* Make sure your changes are formatted correctly and consistently with the rest of the documentation. +* Re-read what you wrote, and run a spellchecker on it to make sure you didn't miss anything. +* In your commit message(s), begin the first line with `docs: `. For example: `docs: Adding a doc contrib section to CONTRIBUTING.md`. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). Documentation commits should use `docs(): `. +* Go to https://github.com/npm/libnpmconfig/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Contribute Code + +We like code commits a lot! They're super handy, and they keep the project going and doing the work it needs to do to be useful to others. + +Code contributions of just about any size are acceptable! + +The main difference between code contributions and documentation contributions is that contributing code requires inclusion of relevant tests for the code being added or changed. Contributions without accompanying tests will be held off until a test is added, unless the maintainers consider the specific tests to be either impossible, or way too much of a burden for such a contribution. + +To contribute code: + +* [Set up the project](#project-setup). +* Make any necessary changes to the source code. +* Include any [additional documentation](#contribute-documentation) the changes might need. +* Write tests that verify that your contribution works as expected. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). +* Dependency updates, additions, or removals must be in individual commits, and the message must use the format: `(deps): PKG@VERSION`, where `` is any of the usual `conventional-changelog` prefixes, at your discretion. +* Go to https://github.com/npm/libnpmconfig/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* Barring special circumstances, maintainers will not review PRs until all checks pass (Travis, AppVeyor, etc). +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. Additional tags (such as `needs-tests`) will be added depending on the review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Provide Support on Issues + +[Needs Collaborator](#join-the-project-team): none + +Helping out other users with their questions is a really awesome way of contributing to any community. It's not uncommon for most of the issues on an open source projects being support-related questions by users trying to understand something they ran into, or find their way around a known bug. + +Sometimes, the `support` label will be added to things that turn out to actually be other things, like bugs or feature requests. In that case, suss out the details with the person who filed the original issue, add a comment explaining what the bug is, and change the label from `support` to `bug` or `feature`. If you can't do this yourself, @mention a maintainer so they can do it. + +In order to help other folks out with their questions: + +* Go to the issue tracker and [filter open issues by the `support` label](https://github.com/npm/libnpmconfig/issues?q=is%3Aopen+is%3Aissue+label%3Asupport). +* Read through the list until you find something that you're familiar enough with to give an answer to. +* Respond to the issue with whatever details are needed to clarify the question, or get more details about what's going on. +* Once the discussion wraps up and things are clarified, either close the issue, or ask the original issue filer (or a maintainer) to close it for you. + +Some notes on picking up support issues: + +* Avoid responding to issues you don't know you can answer accurately. +* As much as possible, try to refer to past issues with accepted answers. Link to them from your replies with the `#123` format. +* Be kind and patient with users -- often, folks who have run into confusing things might be upset or impatient. This is ok. Try to understand where they're coming from, and if you're too uncomfortable with the tone, feel free to stay away or withdraw from the issue. (note: if the user is outright hostile or is violating the CoC, [refer to the Code of Conduct](CODE_OF_CONDUCT.md) to resolve the conflict). + +## Label Issues + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +One of the most important tasks in handling issues is labeling them usefully and accurately. All other tasks involving issues ultimately rely on the issue being classified in such a way that relevant parties looking to do their own tasks can find them quickly and easily. + +In order to label issues, [open up the list of unlabeled issues](https://github.com/npm/libnpmconfig/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and, **from newest to oldest**, read through each one and apply issue labels according to the table below. If you're unsure about what label to apply, skip the issue and try the next one: don't feel obligated to label each and every issue yourself! + +Label | Apply When | Notes +--- | --- | --- +`bug` | Cases where the code (or documentation) is behaving in a way it wasn't intended to. | If something is happening that surprises the *user* but does not go against the way the code is designed, it should use the `enhancement` label. +`critical` | Added to `bug` issues if the problem described makes the code completely unusable in a common situation. | +`documentation` | Added to issues or pull requests that affect any of the documentation for the project. | Can be combined with other labels, such as `bug` or `enhancement`. +`duplicate` | Added to issues or PRs that refer to the exact same issue as another one that's been previously labeled. | Duplicate issues should be marked and closed right away, with a message referencing the issue it's a duplicate of (with `#123`) +`enhancement` | Added to [feature requests](#request-a-feature), PRs, or documentation issues that are purely additive: the code or docs currently work as expected, but a change is being requested or suggested. | +`help wanted` | Applied by [Committers](#join-the-project-team) to issues and PRs that they would like to get outside help for. Generally, this means it's lower priority for the maintainer team to itself implement, but that the community is encouraged to pick up if they so desire | Never applied on first-pass labeling. +`in-progress` | Applied by [Committers](#join-the-project-team) to PRs that are pending some work before they're ready for review. | The original PR submitter should @mention the team member that applied the label once the PR is complete. +`performance` | This issue or PR is directly related to improving performance. | +`refactor` | Added to issues or PRs that deal with cleaning up or modifying the project for the betterment of it. | +`starter` | Applied by [Committers](#join-the-project-team) to issues that they consider good introductions to the project for people who have not contributed before. These are not necessarily "easy", but rather focused around how much context is necessary in order to understand what needs to be done for this project in particular. | Existing project members are expected to stay away from these unless they increase in priority. +`support` | This issue is either asking a question about how to use the project, clarifying the reason for unexpected behavior, or possibly reporting a `bug` but does not have enough detail yet to determine whether it would count as such. | The label should be switched to `bug` if reliable reproduction steps are provided. Issues primarily with unintended configurations of a user's environment are not considered bugs, even if they cause crashes. +`tests` | This issue or PR either requests or adds primarily tests to the project. | If a PR is pending tests, that will be handled through the [PR review process](#review-pull-requests) +`wontfix` | Labelers may apply this label to issues that clearly have nothing at all to do with the project or are otherwise entirely outside of its scope/sphere of influence. [Committers](#join-the-project-team) may apply this label and close an issue or PR if they decide to pass on an otherwise relevant issue. | The issue or PR should be closed as soon as the label is applied, and a clear explanation provided of why the label was used. Contributors are free to contest the labeling, but the decision ultimately falls on committers as to whether to accept something or not. + +## Clean Up Issues and PRs + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +Issues and PRs can go stale after a while. Maybe they're abandoned. Maybe the team will just plain not have time to address them any time soon. + +In these cases, they should be closed until they're brought up again or the interaction starts over. + +To clean up issues and PRs: + +* Search the issue tracker for issues or PRs, and add the term `updated:<=YYYY-MM-DD`, where the date is 30 days before today. +* Go through each issue *from oldest to newest*, and close them if **all of the following are true**: + * not opened by a maintainer + * not marked as `critical` + * not marked as `starter` or `help wanted` (these might stick around for a while, in general, as they're intended to be available) + * no explicit messages in the comments asking for it to be left open + * does not belong to a milestone +* Leave a message when closing saying "Cleaning up stale issue. Please reopen or ping us if and when you're ready to resume this. See https://github.com/npm/libnpmconfig/blob/latest/CONTRIBUTING.md#clean-up-issues-and-prs for more details." + +## Review Pull Requests + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +While anyone can comment on a PR, add feedback, etc, PRs are only *approved* by team members with Issue Tracker or higher permissions. + +PR reviews use [GitHub's own review feature](https://help.github.com/articles/about-pull-request-reviews/), which manages comments, approval, and review iteration. + +Some notes: + +* You may ask for minor changes ("nitpicks"), but consider whether they are really blockers to merging: try to err on the side of "approve, with comments". +* *ALL PULL REQUESTS* should be covered by a test: either by a previously-failing test, an existing test that covers the entire functionality of the submitted code, or new tests to verify any new/changed behavior. All tests must also pass and follow established conventions. Test coverage should not drop, unless the specific case is considered reasonable by maintainers. +* Please make sure you're familiar with the code or documentation being updated, unless it's a minor change (spellchecking, minor formatting, etc). You may @mention another project member who you think is better suited for the review, but still provide a non-approving review of your own. +* Be extra kind: people who submit code/doc contributions are putting themselves in a pretty vulnerable position, and have put time and care into what they've done (even if that's not obvious to you!) -- always respond with respect, be understanding, but don't feel like you need to sacrifice your standards for their sake, either. Just don't be a jerk about it? + +## Merge Pull Requests + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. + +## Tag A Release + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. The most important bit here is probably that all tests must pass, and tags must use [semver](https://semver.org). + +## Join the Project Team + +### Ways to Join + +There are many ways to contribute! Most of them don't require any official status unless otherwise noted. That said, there's a couple of positions that grant special repository abilities, and this section describes how they're granted and what they do. + +All of the below positions are granted based on the project team's needs, as well as their consensus opinion about whether they would like to work with the person and think that they would fit well into that position. The process is relatively informal, and it's likely that people who express interest in participating can just be granted the permissions they'd like. + +You can spot a collaborator on the repo by looking for the `[Collaborator]` or `[Owner]` tags next to their names. + +Permission | Description +--- | --- +Issue Tracker | Granted to contributors who express a strong interest in spending time on the project's issue tracker. These tasks are mainly [labeling issues](#label-issues), [cleaning up old ones](#clean-up-issues-and-prs), and [reviewing pull requests](#review-pull-requests), as well as all the usual things non-team-member contributors can do. Issue handlers should not merge pull requests, tag releases, or directly commit code themselves: that should still be done through the usual pull request process. Becoming an Issue Handler means the project team trusts you to understand enough of the team's process and context to implement it on the issue tracker. +Committer | Granted to contributors who want to handle the actual pull request merges, tagging new versions, etc. Committers should have a good level of familiarity with the codebase, and enough context to understand the implications of various changes, as well as a good sense of the will and expectations of the project team. +Admin/Owner | Granted to people ultimately responsible for the project, its community, etc. + +## Attribution + +This guide was generated using the WeAllJS `CONTRIBUTING.md` generator. [Make your own](https://npm.im/weallcontribute)! diff --git a/deps/npm/node_modules/libnpmconfig/LICENSE b/deps/npm/node_modules/libnpmconfig/LICENSE new file mode 100644 index 00000000000000..209e4477f39c1a --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +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/libnpmconfig/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmconfig/PULL_REQUEST_TEMPLATE new file mode 100644 index 00000000000000..9471c6d325f7eb --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/PULL_REQUEST_TEMPLATE @@ -0,0 +1,7 @@ + diff --git a/deps/npm/node_modules/libnpmconfig/README.md b/deps/npm/node_modules/libnpmconfig/README.md new file mode 100644 index 00000000000000..91bac0d1717508 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/README.md @@ -0,0 +1,40 @@ +# libnpmconfig [![npm version](https://img.shields.io/npm/v/libnpmconfig.svg)](https://npm.im/libnpmconfig) [![license](https://img.shields.io/npm/l/libnpmconfig.svg)](https://npm.im/libnpmconfig) [![Travis](https://img.shields.io/travis/npm/libnpmconfig.svg)](https://travis-ci.org/npm/libnpmconfig) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmconfig?svg=true)](https://ci.appveyor.com/project/zkat/libnpmconfig) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmconfig/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmconfig?branch=latest) + +[`libnpmconfig`](https://github.com/npm/libnpmconfig) is a Node.js library for +programmatically managing npm's configuration files and data. + +## Example + +```js +const config = require('libnpmconfig') + +console.log('configured registry:', config.read({ + registry: 'https://default.registry/' +})) +// => configured registry: https://registry.npmjs.org +``` + +## Install + +`$ npm install libnpmconfig` + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [API](#api) + +### API + +##### `> read(cliOpts, builtinOpts)` + +Reads configurations from the filesystem and the env and returns a +[`figgy-pudding`](https://npm.im/figgy-pudding) object with the configuration +values. + +If `cliOpts` is provided, it will be merged with the returned config pudding, +shadowing any read values. These are intended as CLI-provided options. Do your +own `process.argv` parsing, though. + +If `builtinOpts.cwd` is provided, it will be used instead of `process.cwd()` as +the starting point for config searching. diff --git a/deps/npm/node_modules/libnpmconfig/index.js b/deps/npm/node_modules/libnpmconfig/index.js new file mode 100644 index 00000000000000..5501e26b75e7e6 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/index.js @@ -0,0 +1,107 @@ +'use strict' + +const fs = require('fs') +const figgyPudding = require('figgy-pudding') +const findUp = require('find-up') +const ini = require('ini') +const os = require('os') +const path = require('path') + +const NpmConfig = figgyPudding({}, { + // Open up the pudding object. + other () { return true } +}) + +const ConfigOpts = figgyPudding({ + cache: { default: path.join(os.homedir(), '.npm') }, + configNames: { default: ['npmrc', '.npmrc'] }, + envPrefix: { default: /^npm_config_/i }, + cwd: { default: () => process.cwd() }, + globalconfig: { + default: () => path.join(getGlobalPrefix(), 'etc', 'npmrc') + }, + userconfig: { default: path.join(os.homedir(), '.npmrc') } +}) + +module.exports.read = getNpmConfig +function getNpmConfig (_opts, _builtin) { + const builtin = ConfigOpts(_builtin) + const env = {} + for (let key of Object.keys(process.env)) { + if (!key.match(builtin.envPrefix)) continue + const newKey = key.toLowerCase() + .replace(builtin.envPrefix, '') + .replace(/(?!^)_/g, '-') + env[newKey] = process.env[key] + } + const cli = NpmConfig(_opts) + const userConfPath = ( + builtin.userconfig || + cli.userconfig || + env.userconfig + ) + const user = userConfPath && maybeReadIni(userConfPath) + const globalConfPath = ( + builtin.globalconfig || + cli.globalconfig || + env.globalconfig + ) + const global = globalConfPath && maybeReadIni(globalConfPath) + const projConfPath = findUp.sync(builtin.configNames, { cwd: builtin.cwd }) + let proj = {} + if (projConfPath && projConfPath !== userConfPath) { + proj = maybeReadIni(projConfPath) + } + const newOpts = NpmConfig(builtin, global, user, proj, env, cli) + if (newOpts.cache) { + return newOpts.concat({ + cache: path.resolve( + ( + (cli.cache || env.cache) + ? builtin.cwd + : proj.cache + ? path.dirname(projConfPath) + : user.cache + ? path.dirname(userConfPath) + : global.cache + ? path.dirname(globalConfPath) + : path.dirname(userConfPath) + ), + newOpts.cache + ) + }) + } else { + return newOpts + } +} + +function maybeReadIni (f) { + let txt + try { + txt = fs.readFileSync(f, 'utf8') + } catch (err) { + if (err.code === 'ENOENT') { + return '' + } else { + throw err + } + } + return ini.parse(txt) +} + +function getGlobalPrefix () { + if (process.env.PREFIX) { + return process.env.PREFIX + } else if (process.platform === 'win32') { + // c:\node\node.exe --> prefix=c:\node\ + return path.dirname(process.execPath) + } else { + // /usr/local/bin/node --> prefix=/usr/local + let pref = path.dirname(path.dirname(process.execPath)) + // destdir only is respected on Unix + if (process.env.DESTDIR) { + pref = path.join(process.env.DESTDIR, pref) + } + return pref + } +} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/index.js new file mode 100644 index 00000000000000..8e83819cea5a95 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/index.js @@ -0,0 +1,46 @@ +'use strict'; +const path = require('path'); +const locatePath = require('locate-path'); + +module.exports = (filename, opts = {}) => { + const startDir = path.resolve(opts.cwd || ''); + const {root} = path.parse(startDir); + + const filenames = [].concat(filename); + + return new Promise(resolve => { + (function find(dir) { + locatePath(filenames, {cwd: dir}).then(file => { + if (file) { + resolve(path.join(dir, file)); + } else if (dir === root) { + resolve(null); + } else { + find(path.dirname(dir)); + } + }); + })(startDir); + }); +}; + +module.exports.sync = (filename, opts = {}) => { + let dir = path.resolve(opts.cwd || ''); + const {root} = path.parse(dir); + + const filenames = [].concat(filename); + + // eslint-disable-next-line no-constant-condition + while (true) { + const file = locatePath.sync(filenames, {cwd: dir}); + + if (file) { + return path.join(dir, file); + } + + if (dir === root) { + return null; + } + + dir = path.dirname(dir); + } +}; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/license b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/package.json new file mode 100644 index 00000000000000..d18dba3f17cec1 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/package.json @@ -0,0 +1,82 @@ +{ + "_from": "find-up@^3.0.0", + "_id": "find-up@3.0.0", + "_inBundle": false, + "_integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "_location": "/libnpmconfig/find-up", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "find-up@^3.0.0", + "name": "find-up", + "escapedName": "find-up", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/libnpmconfig" + ], + "_resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "_shasum": "49169f1d7993430646da61ecc5ae355c21c97b73", + "_spec": "find-up@^3.0.0", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpmconfig", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/find-up/issues" + }, + "bundleDependencies": false, + "dependencies": { + "locate-path": "^3.0.0" + }, + "deprecated": false, + "description": "Find a file or directory by walking up parent directories", + "devDependencies": { + "ava": "*", + "tempy": "^0.2.1", + "xo": "*" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/find-up#readme", + "keywords": [ + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "license": "MIT", + "name": "find-up", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/find-up.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0" +} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/readme.md new file mode 100644 index 00000000000000..810ad7ceb52766 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/readme.md @@ -0,0 +1,87 @@ +# find-up [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/l0cyjmvh5lq72vq2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master) + +> Find a file or directory by walking up parent directories + + +## Install + +``` +$ npm install find-up +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js +``` + +`example.js` + +```js +const findUp = require('find-up'); + +(async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' +})(); +``` + + +## API + +### findUp(filename, [options]) + +Returns a `Promise` for either the filepath or `null` if it couldn't be found. + +### findUp([filenameA, filenameB], [options]) + +Returns a `Promise` for either the first filepath found (by respecting the order) or `null` if none could be found. + +### findUp.sync(filename, [options]) + +Returns a filepath or `null`. + +### findUp.sync([filenameA, filenameB], [options]) + +Returns the first filepath found (by respecting the order) or `null`. + +#### filename + +Type: `string` + +Filename of the file to find. + +#### options + +Type: `Object` + +##### cwd + +Type: `string`
        +Default: `process.cwd()` + +Directory to start from. + + +## Related + +- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package +- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js new file mode 100644 index 00000000000000..5aae6ee4ad0277 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js @@ -0,0 +1,24 @@ +'use strict'; +const path = require('path'); +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +module.exports = (iterable, options) => { + options = Object.assign({ + cwd: process.cwd() + }, options); + + return pLocate(iterable, el => pathExists(path.resolve(options.cwd, el)), options); +}; + +module.exports.sync = (iterable, options) => { + options = Object.assign({ + cwd: process.cwd() + }, options); + + for (const el of iterable) { + if (pathExists.sync(path.resolve(options.cwd, el))) { + return el; + } + } +}; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json new file mode 100644 index 00000000000000..54600c0c483dcf --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json @@ -0,0 +1,76 @@ +{ + "_from": "locate-path@^3.0.0", + "_id": "locate-path@3.0.0", + "_inBundle": false, + "_integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "_location": "/libnpmconfig/locate-path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "locate-path@^3.0.0", + "name": "locate-path", + "escapedName": "locate-path", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/libnpmconfig/find-up" + ], + "_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "_shasum": "dbec3b3ab759758071b58fe59fc41871af21400e", + "_spec": "locate-path@^3.0.0", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpmconfig/node_modules/find-up", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/locate-path/issues" + }, + "bundleDependencies": false, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "deprecated": false, + "description": "Get the first path that exists on disk of multiple paths", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/locate-path#readme", + "keywords": [ + "locate", + "path", + "paths", + "file", + "files", + "exists", + "find", + "finder", + "search", + "searcher", + "array", + "iterable", + "iterator" + ], + "license": "MIT", + "name": "locate-path", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/locate-path.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0" +} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md new file mode 100644 index 00000000000000..a1d2e628328c2b --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md @@ -0,0 +1,99 @@ +# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) + +> Get the first path that exists on disk of multiple paths + + +## Install + +``` +$ npm install locate-path +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const locatePath = require('locate-path'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + console(await locatePath(files)); + //=> 'rainbow' +})(); +``` + + +## API + +### locatePath(input, [options]) + +Returns a `Promise` for the first path that exists or `undefined` if none exists. + +#### input + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
        +Default: `Infinity`
        +Minimum: `1` + +Number of concurrently pending promises. + +##### preserveOrder + +Type: `boolean`
        +Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + +##### cwd + +Type: `string`
        +Default: `process.cwd()` + +Current working directory. + +### locatePath.sync(input, [options]) + +Returns the first path that exists or `undefined` if none exists. + +#### input + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### cwd + +Same as above. + + +## Related + +- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.js new file mode 100644 index 00000000000000..86decabbc06824 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.js @@ -0,0 +1,49 @@ +'use strict'; +const pTry = require('p-try'); + +module.exports = concurrency => { + if (concurrency < 1) { + throw new TypeError('Expected `concurrency` to be a number from 1 and up'); + } + + const queue = []; + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.length > 0) { + queue.shift()(); + } + }; + + const run = (fn, resolve, ...args) => { + activeCount++; + + const result = pTry(fn, ...args); + + resolve(result); + + result.then(next, next); + }; + + const enqueue = (fn, resolve, ...args) => { + if (activeCount < concurrency) { + run(fn, resolve, ...args); + } else { + queue.push(run.bind(null, fn, resolve, ...args)); + } + }; + + const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.length + } + }); + + return generator; +}; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/license b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/package.json new file mode 100644 index 00000000000000..233b3f13d75e15 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/package.json @@ -0,0 +1,81 @@ +{ + "_from": "p-limit@^2.0.0", + "_id": "p-limit@2.1.0", + "_inBundle": false, + "_integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "_location": "/libnpmconfig/p-limit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-limit@^2.0.0", + "name": "p-limit", + "escapedName": "p-limit", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/libnpmconfig/p-locate" + ], + "_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", + "_shasum": "1d5a0d20fb12707c758a655f6bbc4386b5930d68", + "_spec": "p-limit@^2.0.0", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpmconfig/node_modules/p-locate", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/p-limit/issues" + }, + "bundleDependencies": false, + "dependencies": { + "p-try": "^2.0.0" + }, + "deprecated": false, + "description": "Run multiple promise-returning & async functions with limited concurrency", + "devDependencies": { + "ava": "^1.0.1", + "delay": "^4.1.0", + "in-range": "^1.0.0", + "random-int": "^1.0.0", + "time-span": "^2.0.0", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/p-limit#readme", + "keywords": [ + "promise", + "limit", + "limited", + "concurrency", + "throttle", + "throat", + "rate", + "batch", + "ratelimit", + "task", + "queue", + "async", + "await", + "promises", + "bluebird" + ], + "license": "MIT", + "name": "p-limit", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/p-limit.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.1.0" +} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/readme.md new file mode 100644 index 00000000000000..92a6dbf7741d26 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/readme.md @@ -0,0 +1,90 @@ +# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) + +> Run multiple promise-returning & async functions with limited concurrency + + +## Install + +``` +$ npm install p-limit +``` + + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`
        +Minimum: `1` + +Concurrency limit. + +### limit(fn, ...args) + +Returns the promise returned by calling `fn(...args)`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + +#### ...args + +Any arguments to pass through to `fn`. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + +### limit.activeCount + +The number of promises that are currently running. + +### limit.pendingCount + +The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + + +## FAQ + +### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? + +This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause and clear the queue. + + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/index.js new file mode 100644 index 00000000000000..4bd08aad193128 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/index.js @@ -0,0 +1,34 @@ +'use strict'; +const pLimit = require('p-limit'); + +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} + +// The input can also be a promise, so we `Promise.resolve()` it +const testElement = (el, tester) => Promise.resolve(el).then(tester); + +// The input can also be a promise, so we `Promise.all()` them both +const finder = el => Promise.all(el).then(val => val[1] === true && Promise.reject(new EndError(val[0]))); + +module.exports = (iterable, tester, opts) => { + opts = Object.assign({ + concurrency: Infinity, + preserveOrder: true + }, opts); + + const limit = pLimit(opts.concurrency); + + // Start all the promises concurrently with optional limit + const items = [...iterable].map(el => [el, limit(testElement, el, tester)]); + + // Check the promises either serially or concurrently + const checkLimit = pLimit(opts.preserveOrder ? 1 : Infinity); + + return Promise.all(items.map(el => checkLimit(finder, el))) + .then(() => {}) + .catch(err => err instanceof EndError ? err.value : Promise.reject(err)); +}; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/license b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/package.json new file mode 100644 index 00000000000000..d49e3027e1e689 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/package.json @@ -0,0 +1,83 @@ +{ + "_from": "p-locate@^3.0.0", + "_id": "p-locate@3.0.0", + "_inBundle": false, + "_integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "_location": "/libnpmconfig/p-locate", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-locate@^3.0.0", + "name": "p-locate", + "escapedName": "p-locate", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/libnpmconfig/locate-path" + ], + "_resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "_shasum": "322d69a05c0264b25997d9f40cd8a891ab0064a4", + "_spec": "p-locate@^3.0.0", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpmconfig/node_modules/locate-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/p-locate/issues" + }, + "bundleDependencies": false, + "dependencies": { + "p-limit": "^2.0.0" + }, + "deprecated": false, + "description": "Get the first fulfilled promise that satisfies the provided testing function", + "devDependencies": { + "ava": "*", + "delay": "^3.0.0", + "in-range": "^1.0.0", + "time-span": "^2.0.0", + "xo": "*" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/p-locate#readme", + "keywords": [ + "promise", + "locate", + "find", + "finder", + "search", + "searcher", + "test", + "array", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "fastest", + "async", + "await", + "promises", + "bluebird" + ], + "license": "MIT", + "name": "p-locate", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/p-locate.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0" +} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/readme.md new file mode 100644 index 00000000000000..3b0173bc4ea784 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/readme.md @@ -0,0 +1,88 @@ +# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate) + +> Get the first fulfilled promise that satisfies the provided testing function + +Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). + + +## Install + +``` +$ npm install p-locate +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' +})(); +``` + +*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* + + +## API + +### pLocate(input, tester, [options]) + +Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +#### input + +Type: `Iterable` + +#### tester(element) + +Type: `Function` + +Expected to return a `Promise` or boolean. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
        +Default: `Infinity`
        +Minimum: `1` + +Number of concurrently pending promises returned by `tester`. + +##### preserveOrder + +Type: `boolean`
        +Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + + +## Related + +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.js new file mode 100644 index 00000000000000..2d26268d479380 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = (callback, ...args) => new Promise(resolve => { + resolve(callback(...args)); +}); diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/license b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/package.json new file mode 100644 index 00000000000000..d8aef830b594e2 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/package.json @@ -0,0 +1,72 @@ +{ + "_from": "p-try@^2.0.0", + "_id": "p-try@2.0.0", + "_inBundle": false, + "_integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "_location": "/libnpmconfig/p-try", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-try@^2.0.0", + "name": "p-try", + "escapedName": "p-try", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/libnpmconfig/p-limit" + ], + "_resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "_shasum": "85080bb87c64688fa47996fe8f7dfbe8211760b1", + "_spec": "p-try@^2.0.0", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpmconfig/node_modules/p-limit", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/p-try/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "`Start a promise chain", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/p-try#readme", + "keywords": [ + "promise", + "try", + "resolve", + "function", + "catch", + "async", + "await", + "promises", + "settled", + "ponyfill", + "polyfill", + "shim", + "bluebird" + ], + "license": "MIT", + "name": "p-try", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/p-try.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/readme.md new file mode 100644 index 00000000000000..58acb759aa5a41 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/readme.md @@ -0,0 +1,47 @@ +# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) + +> Start a promise chain + +[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) + + +## Install + +``` +$ npm install p-try +``` + + +## Usage + +```js +const pTry = require('p-try'); + +pTry(() => { + return synchronousFunctionThatMightThrow(); +}).then(value => { + console.log(value); +}).catch(error => { + console.error(error); +}); +``` + + +## API + +### pTry(fn, ...args) + +Returns a `Promise` resolved with the value of calling `fn(...args)`. If the function throws an error, the returned `Promise` will be rejected with that error. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + + +## Related + +- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpmconfig/package.json b/deps/npm/node_modules/libnpmconfig/package.json new file mode 100644 index 00000000000000..d272290b32fa40 --- /dev/null +++ b/deps/npm/node_modules/libnpmconfig/package.json @@ -0,0 +1,66 @@ +{ + "_from": "libnpmconfig@^1.1.1", + "_id": "libnpmconfig@1.2.1", + "_inBundle": false, + "_integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", + "_location": "/libnpmconfig", + "_phantomChildren": { + "path-exists": "3.0.0" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "libnpmconfig@^1.1.1", + "name": "libnpmconfig", + "escapedName": "libnpmconfig", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/libnpm" + ], + "_resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", + "_shasum": "c0c2f793a74e67d4825e5039e7a02a0044dfcbc0", + "_spec": "libnpmconfig@^1.1.1", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpm", + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech" + }, + "bugs": { + "url": "https://github.com/npm/libnpmconfig/issues" + }, + "bundleDependencies": false, + "dependencies": { + "figgy-pudding": "^3.5.1", + "find-up": "^3.0.0", + "ini": "^1.3.5" + }, + "deprecated": false, + "description": "Standalone library for reading/writing/managing npm configurations", + "devDependencies": { + "standard": "*", + "standard-version": "*", + "tap": "*", + "weallbehave": "*", + "weallcontribute": "*" + }, + "homepage": "https://npmjs.com/package/libnpmconfig", + "license": "ISC", + "name": "libnpmconfig", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/libnpmconfig.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --100 test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "1.2.1" +} diff --git a/deps/npm/node_modules/libnpmhook/CHANGELOG.md b/deps/npm/node_modules/libnpmhook/CHANGELOG.md index 6fe3e05b5e84e2..251d1f996dbba0 100644 --- a/deps/npm/node_modules/libnpmhook/CHANGELOG.md +++ b/deps/npm/node_modules/libnpmhook/CHANGELOG.md @@ -2,6 +2,36 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [5.0.2](https://github.com/npm/libnpmhook/compare/v5.0.1...v5.0.2) (2018-08-24) + + + + +## [5.0.1](https://github.com/npm/libnpmhook/compare/v5.0.0...v5.0.1) (2018-08-23) + + +### Bug Fixes + +* **deps:** move JSONStream to prod deps ([bb63594](https://github.com/npm/libnpmhook/commit/bb63594)) + + + + +# [5.0.0](https://github.com/npm/libnpmhook/compare/v4.0.1...v5.0.0) (2018-08-21) + + +### Features + +* **api:** overhauled API ([46b271b](https://github.com/npm/libnpmhook/commit/46b271b)) + + +### BREAKING CHANGES + +* **api:** the API for ls() has changed, and rm() no longer errors on 404 + + + ## [4.0.1](https://github.com/npm/libnpmhook/compare/v4.0.0...v4.0.1) (2018-04-09) diff --git a/deps/npm/node_modules/libnpmhook/README.md b/deps/npm/node_modules/libnpmhook/README.md index 0e2f018f2a038f..9a13d055317a51 100644 --- a/deps/npm/node_modules/libnpmhook/README.md +++ b/deps/npm/node_modules/libnpmhook/README.md @@ -1,8 +1,20 @@ -# libnpmhook [![npm version](https://img.shields.io/npm/v/libnpmhook.svg)](https://npm.im/libnpmhook) [![license](https://img.shields.io/npm/l/libnpmhook.svg)](https://npm.im/libnpmhook) [![Travis](https://img.shields.io/travis/npm/libnpmhook.svg)](https://travis-ci.org/npm/libnpmhook) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/libnpmhook?svg=true)](https://ci.appveyor.com/project/npm/libnpmhook) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmhook/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmhook?branch=latest) +# libnpmhook [![npm version](https://img.shields.io/npm/v/libnpmhook.svg)](https://npm.im/libnpmhook) [![license](https://img.shields.io/npm/l/libnpmhook.svg)](https://npm.im/libnpmhook) [![Travis](https://img.shields.io/travis/npm/libnpmhook.svg)](https://travis-ci.org/npm/libnpmhook) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmhook?svg=true)](https://ci.appveyor.com/project/zkat/libnpmhook) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmhook/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmhook?branch=latest) [`libnpmhook`](https://github.com/npm/libnpmhook) is a Node.js library for programmatically managing the npm registry's server-side hooks. +For a more general introduction to managing hooks, see [the introductory blog +post](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm). + +## Example + +```js +const hooks = require('libnpmhook') + +console.log(await hooks.ls('mypkg', {token: 'deadbeef'})) +// array of hook objects on `mypkg`. +``` + ## Install `$ npm install libnpmhook` @@ -10,14 +22,246 @@ programmatically managing the npm registry's server-side hooks. ## Table of Contents * [Example](#example) -* [Features](#features) +* [Install](#install) * [API](#api) + * [hook opts](#opts) + * [`add()`](#add) + * [`rm()`](#rm) + * [`ls()`](#ls) + * [`ls.stream()`](#ls-stream) + * [`update()`](#update) + +### API + +#### `opts` for `libnpmhook` commands + +`libnpmhook` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). +All options are passed through directly to that library, so please refer to [its +own `opts` +documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) +for options that can be passed in. -### Example +A couple of options of note for those in a hurry: + +* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. +* `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmhook` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` +* `opts.Promise` - If you pass this in, the Promises returned by `libnpmhook` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` + +#### `> hooks.add(name, endpoint, secret, [opts]) -> Promise` + +`name` is the name of the package, org, or user/org scope to watch. The type is +determined by the name syntax: `'@foo/bar'` and `'foo'` are treated as packages, +`@foo` is treated as a scope, and `~user` is treated as an org name or scope. +Each type will attach to different events. + +The `endpoint` should be a fully-qualified http URL for the endpoint the hook +will send its payload to when it fires. `secret` is a shared secret that the +hook will send to that endpoint to verify that it's actually coming from the +registry hook. + +The returned Promise resolves to the full hook object that was created, +including its generated `id`. + +See also: [`POST +/v1/hooks/hook`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#post-v1hookshook) + +##### Example ```javascript +await hooks.add('~zkat', 'https://zkat.tech/api/added', 'supersekrit', { + token: 'myregistrytoken', + otp: '694207' +}) + +=> + +{ id: '16f7xoal', + username: 'zkat', + name: 'zkat', + endpoint: 'https://zkat.tech/api/added', + secret: 'supersekrit', + type: 'owner', + created: '2018-08-21T20:05:25.125Z', + updated: '2018-08-21T20:05:25.125Z', + deleted: false, + delivered: false, + last_delivery: null, + response_code: 0, + status: 'active' } ``` -### Features +#### `> hooks.find(id, [opts]) -> Promise` -### API +Returns the hook identified by `id`. + +The returned Promise resolves to the full hook object that was found, or error +with `err.code` of `'E404'` if it didn't exist. + +See also: [`GET +/v1/hooks/hook/:id`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#get-v1hookshookid) + +##### Example + +```javascript +await hooks.find('16f7xoal', {token: 'myregistrytoken'}) + +=> + +{ id: '16f7xoal', + username: 'zkat', + name: 'zkat', + endpoint: 'https://zkat.tech/api/added', + secret: 'supersekrit', + type: 'owner', + created: '2018-08-21T20:05:25.125Z', + updated: '2018-08-21T20:05:25.125Z', + deleted: false, + delivered: false, + last_delivery: null, + response_code: 0, + status: 'active' } +``` + +#### `> hooks.rm(id, [opts]) -> Promise` + +Removes the hook identified by `id`. + +The returned Promise resolves to the full hook object that was removed, if it +existed, or `null` if no such hook was there (instead of erroring). + +See also: [`DELETE +/v1/hooks/hook/:id`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#delete-v1hookshookid) + +##### Example + +```javascript +await hooks.rm('16f7xoal', { + token: 'myregistrytoken', + otp: '694207' +}) + +=> + +{ id: '16f7xoal', + username: 'zkat', + name: 'zkat', + endpoint: 'https://zkat.tech/api/added', + secret: 'supersekrit', + type: 'owner', + created: '2018-08-21T20:05:25.125Z', + updated: '2018-08-21T20:05:25.125Z', + deleted: true, + delivered: false, + last_delivery: null, + response_code: 0, + status: 'active' } + +// Repeat it... +await hooks.rm('16f7xoal', { + token: 'myregistrytoken', + otp: '694207' +}) + +=> null +``` + +#### `> hooks.update(id, endpoint, secret, [opts]) -> Promise` + +The `id` should be a hook ID from a previously-created hook. + +The `endpoint` should be a fully-qualified http URL for the endpoint the hook +will send its payload to when it fires. `secret` is a shared secret that the +hook will send to that endpoint to verify that it's actually coming from the +registry hook. + +The returned Promise resolves to the full hook object that was updated, if it +existed. Otherwise, it will error with an `'E404'` error code. + +See also: [`PUT +/v1/hooks/hook/:id`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#put-v1hookshookid) + +##### Example + +```javascript +await hooks.update('16fxoal', 'https://zkat.tech/api/other', 'newsekrit', { + token: 'myregistrytoken', + otp: '694207' +}) + +=> + +{ id: '16f7xoal', + username: 'zkat', + name: 'zkat', + endpoint: 'https://zkat.tech/api/other', + secret: 'newsekrit', + type: 'owner', + created: '2018-08-21T20:05:25.125Z', + updated: '2018-08-21T20:14:41.964Z', + deleted: false, + delivered: false, + last_delivery: null, + response_code: 0, + status: 'active' } +``` + +#### `> hooks.ls([opts]) -> Promise` + +Resolves to an array of hook objects associated with the account you're +authenticated as. + +Results can be further filtered with three values that can be passed in through +`opts`: + +* `opts.package` - filter results by package name +* `opts.limit` - maximum number of hooks to return +* `opts.offset` - pagination offset for results (use with `opts.limit`) + +See also: + * [`hooks.ls.stream()`](#ls-stream) + * [`GET +/v1/hooks`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#get-v1hooks) + +##### Example + +```javascript +await hooks.ls({token: 'myregistrytoken'}) + +=> +[ + { id: '16f7xoal', ... }, + { id: 'wnyf98a1', ... }, + ... +] +``` + +#### `> hooks.ls.stream([opts]) -> Stream` + +Returns a stream of hook objects associated with the account you're +authenticated as. The returned stream is a valid `Symbol.asyncIterator` on +`node@>=10`. + +Results can be further filtered with three values that can be passed in through +`opts`: + +* `opts.package` - filter results by package name +* `opts.limit` - maximum number of hooks to return +* `opts.offset` - pagination offset for results (use with `opts.limit`) + +See also: + * [`hooks.ls()`](#ls) + * [`GET +/v1/hooks`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#get-v1hooks) + +##### Example + +```javascript +for await (let hook of hooks.ls.stream({token: 'myregistrytoken'})) { + console.log('found hook:', hook.id) +} + +=> +// outputs: +// found hook: 16f7xoal +// found hook: wnyf98a1 +``` diff --git a/deps/npm/node_modules/libnpmhook/config.js b/deps/npm/node_modules/libnpmhook/config.js deleted file mode 100644 index 864e1ede6af6a0..00000000000000 --- a/deps/npm/node_modules/libnpmhook/config.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' - -const pudding = require('figgy-pudding') - -const NpmHooksConfig = pudding() - -module.exports = config -function config (opts) { - return NpmHooksConfig.apply( - null, - [opts, opts.config].concat([].slice.call(arguments, 1)) - ) -} diff --git a/deps/npm/node_modules/libnpmhook/index.js b/deps/npm/node_modules/libnpmhook/index.js index b59ff842e2545e..b489294951dd0f 100644 --- a/deps/npm/node_modules/libnpmhook/index.js +++ b/deps/npm/node_modules/libnpmhook/index.js @@ -1,41 +1,80 @@ 'use strict' -const config = require('./config') const fetch = require('npm-registry-fetch') +const figgyPudding = require('figgy-pudding') +const getStream = require('get-stream') +const validate = require('aproba') -module.exports = { - add (name, endpoint, secret, opts) { - let type = 'package' - if (name && name.match(/^@[^/]+$/)) { - type = 'scope' - } - if (name && name[0] === '~') { - type = 'owner' - name = name.substr(1) - } +const HooksConfig = figgyPudding({ + package: {}, + limit: {}, + offset: {}, + Promise: {default: () => Promise} +}) - opts = config({ - method: 'POST', - body: { type, name, endpoint, secret } - }, opts) - return fetch.json('/-/npm/v1/hooks/hook', opts) - }, - - rm (id, opts) { - return fetch.json(`/-/npm/v1/hooks/hook/${encodeURIComponent(id)}`, config({ - method: 'DELETE' - }, opts)) - }, - - ls (pkg, opts) { - return fetch.json('/-/npm/v1/hooks', config({query: pkg && {package: pkg}}, opts)) - .then(json => json.objects) - }, - - update (id, endpoint, secret, opts) { - return fetch.json(`/-/npm/v1/hooks/hook/${encodeURIComponent(id)}`, config({ - method: 'PUT', - body: {endpoint, secret} - }, opts)) +const eu = encodeURIComponent +const cmd = module.exports = {} +cmd.add = (name, endpoint, secret, opts) => { + opts = HooksConfig(opts) + validate('SSSO', [name, endpoint, secret, opts]) + let type = 'package' + if (name.match(/^@[^/]+$/)) { + type = 'scope' } + if (name[0] === '~') { + type = 'owner' + name = name.substr(1) + } + return fetch.json('/-/npm/v1/hooks/hook', opts.concat({ + method: 'POST', + body: { type, name, endpoint, secret } + })) +} + +cmd.rm = (id, opts) => { + opts = HooksConfig(opts) + validate('SO', [id, opts]) + return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, opts.concat({ + method: 'DELETE' + }, opts)).catch(err => { + if (err.code === 'E404') { + return null + } else { + throw err + } + }) +} + +cmd.update = (id, endpoint, secret, opts) => { + opts = HooksConfig(opts) + validate('SSSO', [id, endpoint, secret, opts]) + return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, opts.concat({ + method: 'PUT', + body: {endpoint, secret} + }, opts)) +} + +cmd.find = (id, opts) => { + opts = HooksConfig(opts) + validate('SO', [id, opts]) + return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, opts) +} + +cmd.ls = (opts) => { + return getStream.array(cmd.ls.stream(opts)) +} + +cmd.ls.stream = (opts) => { + opts = HooksConfig(opts) + const {package: pkg, limit, offset} = opts + validate('S|Z', [pkg]) + validate('N|Z', [limit]) + validate('N|Z', [offset]) + return fetch.json.stream('/-/npm/v1/hooks', 'objects.*', opts.concat({ + query: { + package: pkg, + limit, + offset + } + })) } diff --git a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/CHANGELOG.md b/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/CHANGELOG.md deleted file mode 100644 index 8f9366551fb975..00000000000000 --- a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/CHANGELOG.md +++ /dev/null @@ -1,104 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - - -## [3.1.1](https://github.com/npm/registry-fetch/compare/v3.1.0...v3.1.1) (2018-04-09) - - - - -# [3.1.0](https://github.com/npm/registry-fetch/compare/v3.0.0...v3.1.0) (2018-04-09) - - -### Features - -* **config:** support no-proxy and https-proxy options ([9aa906b](https://github.com/npm/registry-fetch/commit/9aa906b)) - - - - -# [3.0.0](https://github.com/npm/registry-fetch/compare/v2.1.0...v3.0.0) (2018-04-09) - - -### Bug Fixes - -* **api:** pacote integration-related fixes ([a29de4f](https://github.com/npm/registry-fetch/commit/a29de4f)) -* **config:** stop caring about opts.config ([5856a6f](https://github.com/npm/registry-fetch/commit/5856a6f)) - - -### BREAKING CHANGES - -* **config:** opts.config is no longer supported. Pass the options down in opts itself. - - - - -# [2.1.0](https://github.com/npm/registry-fetch/compare/v2.0.0...v2.1.0) (2018-04-08) - - -### Features - -* **token:** accept opts.token for opts._authToken ([108c9f0](https://github.com/npm/registry-fetch/commit/108c9f0)) - - - - -# [2.0.0](https://github.com/npm/registry-fetch/compare/v1.1.1...v2.0.0) (2018-04-08) - - -### meta - -* drop support for node@4 ([758536e](https://github.com/npm/registry-fetch/commit/758536e)) - - -### BREAKING CHANGES - -* node@4 is no longer supported - - - - -## [1.1.1](https://github.com/npm/registry-fetch/compare/v1.1.0...v1.1.1) (2018-04-06) - - - - -# [1.1.0](https://github.com/npm/registry-fetch/compare/v1.0.1...v1.1.0) (2018-03-16) - - -### Features - -* **specs:** can use opts.spec to trigger pickManifest ([85c4ac9](https://github.com/npm/registry-fetch/commit/85c4ac9)) - - - - -## [1.0.1](https://github.com/npm/registry-fetch/compare/v1.0.0...v1.0.1) (2018-03-16) - - -### Bug Fixes - -* **query:** oops console.log ([870e4f5](https://github.com/npm/registry-fetch/commit/870e4f5)) - - - - -# 1.0.0 (2018-03-16) - - -### Bug Fixes - -* **auth:** get auth working with all the little details ([84b94ba](https://github.com/npm/registry-fetch/commit/84b94ba)) -* **deps:** add bluebird as an actual dep ([1286e31](https://github.com/npm/registry-fetch/commit/1286e31)) -* **errors:** Unknown auth errors use default code ([#1](https://github.com/npm/registry-fetch/issues/1)) ([3d91b93](https://github.com/npm/registry-fetch/commit/3d91b93)) -* **standard:** remove args from invocation ([9620a0a](https://github.com/npm/registry-fetch/commit/9620a0a)) - - -### Features - -* **api:** baseline kinda-working API impl ([bf91f9f](https://github.com/npm/registry-fetch/commit/bf91f9f)) -* **body:** automatic handling of different opts.body values ([f3b97db](https://github.com/npm/registry-fetch/commit/f3b97db)) -* **config:** nicer input config input handling ([b9ce21d](https://github.com/npm/registry-fetch/commit/b9ce21d)) -* **opts:** use figgy-pudding for opts handling ([0abd527](https://github.com/npm/registry-fetch/commit/0abd527)) -* **query:** add query utility support ([65ea8b1](https://github.com/npm/registry-fetch/commit/65ea8b1)) diff --git a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/README.md b/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/README.md deleted file mode 100644 index 3d55eef6de85b8..00000000000000 --- a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/README.md +++ /dev/null @@ -1,549 +0,0 @@ -# npm-registry-fetch [![npm version](https://img.shields.io/npm/v/npm-registry-fetch.svg)](https://npm.im/npm-registry-fetch) [![license](https://img.shields.io/npm/l/npm-registry-fetch.svg)](https://npm.im/npm-registry-fetch) [![Travis](https://img.shields.io/travis/npm/npm-registry-fetch/latest.svg)](https://travis-ci.org/npm/npm-registry-fetch) [![AppVeyor](https://img.shields.io/appveyor/ci/zkat/npm-registry-fetch/latest.svg)](https://ci.appveyor.com/project/npm/npm-registry-fetch) [![Coverage Status](https://coveralls.io/repos/github/npm/npm-registry-fetch/badge.svg?branch=latest)](https://coveralls.io/github/npm/npm-registry-fetch?branch=latest) - -[`npm-registry-fetch`](https://github.com/npm/npm-registry-fetch) is a Node.js -library that implements a `fetch`-like API for accessing npm registry APIs -consistently. It's able to consume npm-style configuration values and has all -the necessary logic for picking registries, handling scopes, and dealing with -authentication details built-in. - -This package is meant to replace the older -[`npm-registry-client`](https://npm.im/npm-registry-client). - -## Example - -```javascript -const npmFetch = require('npm-registry-fetch') - -console.log( - await npmFetch.json('/-/ping') -) -``` - -## Table of Contents - -* [Installing](#install) -* [Example](#example) -* [Contributing](#contributing) -* [API](#api) - * [`fetch`](#fetch) - * [`fetch.json`](#fetch-json) - * [`fetch` options](#fetch-opts) - -### Install - -`$ npm install npm-registry-fetch` - -### Contributing - -The npm team enthusiastically welcomes contributions and project participation! -There's a bunch of things you can do if you want to contribute! The [Contributor -Guide](CONTRIBUTING.md) has all the information you need for everything from -reporting bugs to contributing entire new features. Please don't hesitate to -jump in if you'd like to, or even ask us questions if something isn't clear. - -All participants and maintainers in this project are expected to follow [Code of -Conduct](CODE_OF_CONDUCT.md), and just generally be excellent to each other. - -Please refer to the [Changelog](CHANGELOG.md) for project history details, too. - -Happy hacking! - -### API - -#### `> fetch(url, [opts]) -> Promise` - -Performs a request to a given URL. - -The URL can be either a full URL, or a path to one. The appropriate registry -will be automatically picked if only a URL path is given. - -For available options, please see the section on [`fetch` options](#fetch-opts). - -##### Example - -```javascript -const res = await fetch('/-/ping') -console.log(res.headers) -res.on('data', d => console.log(d.toString('utf8'))) -``` - -#### `> fetch.json(url, [opts]) -> Promise` - -Performs a request to a given registry URL, parses the body of the response as -JSON, and returns it as its final value. This is a utility shorthand for -`fetch(url).then(res => res.json())`. - -For available options, please see the section on [`fetch` options](#fetch-opts). - -##### Example - -```javascript -const res = await fetch.json('/-/ping') -console.log(res) // Body parsed as JSON -``` - -#### `fetch` Options - -Fetch options are optional, and can be passed in as either a Map-like object -(one with a `.get()` method), a plain javascript object, or a -[`figgy-pudding`](https://npm.im/figgy-pudding) instance. - -##### `opts.agent` - -* Type: http.Agent -* Default: an appropriate agent based on URL protocol and proxy settings - -An [`Agent`](https://nodejs.org/api/http.html#http_class_http_agent) instance to -be shared across requests. This allows multiple concurrent `fetch` requests to -happen on the same socket. - -You do _not_ need to provide this option unless you want something particularly -specialized, since proxy configurations and http/https agents are already -automatically managed internally when this option is not passed through. - -##### `opts.body` - -* Type: Buffer | Stream | Object -* Default: null - -Request body to send through the outgoing request. Buffers and Streams will be -passed through as-is, with a default `content-type` of -`application/octet-stream`. Plain JavaScript objects will be `JSON.stringify`ed -and the `content-type` will default to `application/json`. - -Use [`opts.headers`](#opts-headers) to set the content-type to something else. - -##### `opts.ca` - -* Type: String, Array, or null -* Default: null - -The Certificate Authority signing certificate that is trusted for SSL -connections to the registry. Values should be in PEM format (Windows calls it -"Base-64 encoded X.509 (.CER)") with newlines replaced by the string `'\n'`. For -example: - -``` -{ - ca: '-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----' -} -``` - -Set to `null` to only allow "known" registrars, or to a specific CA cert -to trust only that specific signing authority. - -Multiple CAs can be trusted by specifying an array of certificates instead of a -single string. - -See also [`opts.strict-ssl`](#opts-strict-ssl), [`opts.ca`](#opts-ca) and -[`opts.key`](#opts-key) - -##### `opts.cache` - -* Type: path -* Default: null - -The location of the http cache directory. If provided, certain cachable requests -will be cached according to [IETF RFC 7234](https://tools.ietf.org/html/rfc7234) -rules. This will speed up future requests, as well as make the cached data -available offline if necessary/requested. - -See also [`offline`](#opts-offline), [`prefer-offline`](#opts-prefer-offline), -and [`prefer-online`](#opts-prefer-online). - -##### `opts.cert` - -* Type: String -* Default: null - -A client certificate to pass when accessing the registry. Values should be in -PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines -replaced by the string `'\n'`. For example: - -``` -{ - cert: '-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----' -} -``` - -It is _not_ the path to a certificate file (and there is no "certfile" option). - -See also: [`opts.ca`](#opts-ca) and [`opts.key`](#opts-key) - -##### `opts.fetch-retries` - -* Type: Number -* Default: 2 - -The "retries" config for [`retry`](https://npm.im/retry) to use when fetching -packages from the registry. - -See also [`opts.retry`](#opts-retry) to provide all retry options as a single -object. - -##### `opts.fetch-retry-factor` - -* Type: Number -* Default: 10 - -The "factor" config for [`retry`](https://npm.im/retry) to use when fetching -packages. - -See also [`opts.retry`](#opts-retry) to provide all retry options as a single -object. - -##### `opts.fetch-retry-mintimeout` - -* Type: Number -* Default: 10000 (10 seconds) - -The "minTimeout" config for [`retry`](https://npm.im/retry) to use when fetching -packages. - -See also [`opts.retry`](#opts-retry) to provide all retry options as a single -object. - -##### `opts.fetch-retry-maxtimeout` - -* Type: Number -* Default: 60000 (1 minute) - -The "maxTimeout" config for [`retry`](https://npm.im/retry) to use when fetching -packages. - -See also [`opts.retry`](#opts-retry) to provide all retry options as a single -object. - -##### `opts.headers` - -* Type: Object -* Default: null - -Additional headers for the outgoing request. This option can also be used to -override headers automatically generated by `npm-registry-fetch`, such as -`Content-Type`. - -##### `opts.integrity` - -* Type: String | [SRI object](https://npm.im/ssri) -* Default: null - -If provided, the response body's will be verified against this integrity string, -using [`ssri`](https://npm.im/ssri). If verification succeeds, the response will -complete as normal. If verification fails, the response body will error with an -`EINTEGRITY` error. - -Body integrity is only verified if the body is actually consumed to completion -- -that is, if you use `res.json()`/`res.buffer()`, or if you consume the default -`res` stream data to its end. - -Cached data will have its integrity automatically verified using the -previously-generated integrity hash for the saved request information, so -`EINTEGRITY` errors can happen if [`opts.cache`](#opts-cache) is used, even if -`opts.integrity` is not passed in. - -##### `opts.is-from-ci` - -* Alias: `opts.isFromCI` -* Type: Boolean -* Default: Based on environment variables - -This is used to populate the `npm-in-ci` request header sent to the registry. - -##### `opts.key` - -* Type: String -* Default: null - -A client key to pass when accessing the registry. Values should be in PEM -format with newlines replaced by the string `'\n'`. For example: - -``` -{ - key: '-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----' -} -``` - -It is _not_ the path to a key file (and there is no "keyfile" option). - -See also: [`opts.ca`](#opts-ca) and [`opts.cert`](#opts-cert) - -##### `opts.local-address` - -* Type: IP Address String -* Default: null - -The IP address of the local interface to use when making connections -to the registry. - -See also [`opts.proxy`](#opts-proxy) - -##### `opts.log` - -* Type: [`npmlog`](https://npm.im/npmlog)-like -* Default: null - -Logger object to use for logging operation details. Must have the same methods -as `npmlog`. - -##### `opts.maxsockets` - -* Alias: `opts.max-sockets` -* Type: Integer -* Default: 12 - -Maximum number of sockets to keep open during requests. Has no effect if -[`opts.agent`](#opts-agent) is used. - -##### `opts.method` - -* Type: String -* Default: 'GET' - -HTTP method to use for the outgoing request. Case-insensitive. - -##### `opts.noproxy` - -* Type: Boolean -* Default: process.env.NOPROXY - -If true, proxying will be disabled even if [`opts.proxy`](#opts-proxy) is used. - -##### `opts.npm-session` - -* Alias: `opts.npmSession` -* Type: String -* Default: null - -If provided, will be sent in the `npm-session` header. This header is used by -the npm registry to identify individual user sessions (usually individual -invocations of the CLI). - -##### `opts.offline` - -* Type: Boolean -* Default: false - -Force offline mode: no network requests will be done during install. To allow -`npm-registry-fetch` to fill in missing cache data, see -[`opts.prefer-offline`](#opts-prefer-offline). - -This option is only really useful if you're also using -[`opts.cache`](#opts-cache). - -##### `opts.otp` - -* Type: Number | String -* Default: null - -This is a one-time password from a two-factor authenticator. It is required for -certain registry interactions when two-factor auth is enabled for a user -account. - -##### `opts.password` - -* Alias: _password -* Type: String -* Default: null - -Password used for basic authentication. For the more modern authentication -method, please use the (more secure) [`opts.token`](#opts-token) - -Can optionally be scoped to a registry by using a "nerf dart" for that registry. -That is: - -``` -{ - '//registry.npmjs.org/:password': 't0k3nH34r' -} -``` - -See also [`opts.username`](#opts-username) - -##### `opts.prefer-offline` - -* Type: Boolean -* Default: false - -If true, staleness checks for cached data will be bypassed, but missing data -will be requested from the server. To force full offline mode, use -[`opts.offline`](#opts-offline). - -This option is generally only useful if you're also using -[`opts.cache`](#opts-cache). - -##### `opts.prefer-online` - -* Type: Boolean -* Default: false - -If true, staleness checks for cached data will be forced, making the CLI look -for updates immediately even for fresh package data. - -This option is generally only useful if you're also using -[`opts.cache`](#opts-cache). - - -##### `opts.project-scope` - -* Alias: `opts.projectScope` -* Type: String -* Default: null - -If provided, will be sent in the `npm-scope` header. This header is used by the -npm registry to identify the toplevel package scope that a particular project -installation is using. - -##### `opts.proxy` - -* Type: url -* Default: null - -A proxy to use for outgoing http requests. If not passed in, the `HTTP(S)_PROXY` -environment variable will be used. - -##### `opts.query` - -* Type: String | Object -* Default: null - -If provided, the request URI will have a query string appended to it using this -query. If `opts.query` is an object, it will be converted to a query string -using -[`querystring.stringify()`](https://nodejs.org/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options). - -If the request URI already has a query string, it will be merged with -`opts.query`, preferring `opts.query` values. - -##### `opts.refer` - -* Alias: `opts.referer` -* Type: String -* Default: null - -Value to use for the `Referer` header. The npm CLI itself uses this to serialize -the npm command line using the given request. - -##### `opts.registry` - -* Type: URL -* Default: `'https://registry.npmjs.org'` - -Registry configuration for a request. If a request URL only includes the URL -path, this registry setting will be prepended. This configuration is also used -to determine authentication details, so even if the request URL references a -completely different host, `opts.registry` will be used to find the auth details -for that request. - -See also [`opts.scope`](#opts-scope), [`opts.spec`](#opts-spec), and -[`opts.:registry`](#opts-scope-registry) which can all affect the actual -registry URL used by the outgoing request. - -##### `opts.retry` - -* Type: Object -* Default: null - -Single-object configuration for request retry settings. If passed in, will -override individually-passed `fetch-retry-*` settings. - -##### `opts.scope` - -* Type: String -* Default: null - -Associate an operation with a scope for a scoped registry. This option can force -lookup of scope-specific registries and authentication. - -See also [`opts.:registry`](#opts-scope-registry) and -[`opts.spec`](#opts-spec) for interactions with this option. - -##### `opts.:registry` - -* Type: String -* Default: null - -This option type can be used to configure the registry used for requests -involving a particular scope. For example, `opts['@myscope:registry'] = -'https://scope-specific.registry/'` will make it so requests go out to this -registry instead of [`opts.registry`](#opts-registry) when -[`opts.scope`](#opts-scope) is used, or when [`opts.spec`](#opts-spec) is a -scoped package spec. - -The `@` before the scope name is optional, but recommended. - -##### `opts.spec` - -* Type: String | [`npm-registry-arg`](https://npm.im/npm-registry-arg) object. -* Default: null - -If provided, can be used to automatically configure [`opts.scope`](#opts-scope) -based on a specific package name. Non-registry package specs will throw an -error. - -##### `opts.strict-ssl` - -* Type: Boolean -* Default: true - -Whether or not to do SSL key validation when making requests to the -registry via https. - -See also [`opts.ca`](#opts-ca). - -##### `opts.timeout` - -* Type: Milliseconds -* Default: 30000 (30 seconds) - -Time before a hanging request times out. - -##### `opts.token` - -* Alias: `opts._authToken` -* Type: String -* Default: null - -Authentication token string. - -Can be scoped to a registry by using a "nerf dart" for that registry. That is: - -``` -{ - '//registry.npmjs.org/:token': 't0k3nH34r' -} -``` - -##### `opts.user-agent` - -* Type: String -* Default: `'npm-registry-fetch@/node@+ ()'` - -User agent string to send in the `User-Agent` header. - -##### `opts.username` - -* Type: String -* Default: null - -Username used for basic authentication. For the more modern authentication -method, please use the (more secure) [`opts.token`](#opts-token) - -Can optionally be scoped to a registry by using a "nerf dart" for that registry. -That is: - -``` -{ - '//registry.npmjs.org/:username': 't0k3nH34r' -} -``` - -See also [`opts.password`](#opts-password) - -##### `opts._auth` - -* Type: String -* Default: null - -** DEPRECATED ** This is a legacy authentication token supported only for -*compatibility. Please use [`opts.token`](#opts-token) instead. diff --git a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/auth.js b/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/auth.js deleted file mode 100644 index 9532341db14000..00000000000000 --- a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/auth.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict' - -const config = require('./config.js') -const url = require('url') - -module.exports = getAuth -function getAuth (registry, opts) { - if (!registry) { throw new Error('registry is required') } - opts = config(opts) - let AUTH = {} - const regKey = registry && registryKey(registry) - const doKey = (key, alias) => addKey(opts, AUTH, regKey, key, alias) - doKey('token') - doKey('_authToken', 'token') - doKey('username') - doKey('password') - doKey('_password', 'password') - doKey('email') - doKey('_auth') - doKey('otp') - doKey('always-auth', 'alwaysAuth') - if (AUTH.password) { - AUTH.password = Buffer.from(AUTH.password, 'base64').toString('utf8') - } - AUTH.alwaysAuth = AUTH.alwaysAuth === 'false' ? false : !!AUTH.alwaysAuth - return AUTH -} - -function addKey (opts, obj, scope, key, objKey) { - if (opts.get(key)) { - obj[objKey || key] = opts.get(key) - } - if (scope && opts.get(`${scope}:${key}`)) { - obj[objKey || key] = opts.get(`${scope}:${key}`) - } -} - -// Called a nerf dart in the main codebase. Used as a "safe" -// key when fetching registry info from config. -function registryKey (registry) { - const parsed = url.parse(registry) - const formatted = url.format({ - host: parsed.host, - pathname: parsed.pathname, - slashes: parsed.slashes - }) - return url.resolve(formatted, '.') -} diff --git a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/check-response.js b/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/check-response.js deleted file mode 100644 index 407a80e4ce38a5..00000000000000 --- a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/check-response.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict' - -const config = require('./config.js') -const errors = require('./errors.js') -const LRU = require('lru-cache') - -module.exports = checkResponse -function checkResponse (method, res, registry, startTime, opts) { - opts = config(opts) - if (res.headers.has('npm-notice') && !res.headers.has('x-local-cache')) { - opts.get('log').notice('', res.headers.get('npm-notice')) - } - checkWarnings(res, registry, opts) - if (res.status >= 400) { - logRequest(method, res, startTime, opts) - return checkErrors(method, res, startTime, opts) - } else { - res.body.on('end', () => logRequest(method, res, startTime, opts)) - return res - } -} - -function logRequest (method, res, startTime, opts) { - const elapsedTime = Date.now() - startTime - const attempt = res.headers.get('x-fetch-attempts') - const attemptStr = attempt && attempt > 1 ? ` attempt #${attempt}` : '' - const cacheStr = res.headers.get('x-local-cache') ? ' (from cache)' : '' - opts.get('log').http( - 'fetch', - `${method.toUpperCase()} ${res.status} ${res.url} ${elapsedTime}ms${attemptStr}${cacheStr}` - ) -} - -const WARNING_REGEXP = /^\s*(\d{3})\s+(\S+)\s+"(.*)"\s+"([^"]+)"/ -const BAD_HOSTS = new LRU({ max: 50 }) - -function checkWarnings (res, registry, opts) { - if (res.headers.has('warning') && !BAD_HOSTS.has(registry)) { - const warnings = {} - res.headers.raw()['warning'].forEach(w => { - const match = w.match(WARNING_REGEXP) - if (match) { - warnings[match[1]] = { - code: match[1], - host: match[2], - message: match[3], - date: new Date(match[4]) - } - } - }) - BAD_HOSTS.set(registry, true) - if (warnings['199']) { - if (warnings['199'].message.match(/ENOTFOUND/)) { - opts.get('log').warn('registry', `Using stale data from ${registry} because the host is inaccessible -- are you offline?`) - } else { - opts.get('log').warn('registry', `Unexpected warning for ${registry}: ${warnings['199'].message}`) - } - } - if (warnings['111']) { - // 111 Revalidation failed -- we're using stale data - opts.get('log').warn( - 'registry', - `Using stale data from ${registry} due to a request error during revalidation.` - ) - } - } -} - -function checkErrors (method, res, startTime, opts) { - return res.buffer() - .catch(() => null) - .then(body => { - try { - body = JSON.parse(body.toString('utf8')) - } catch (e) {} - if (res.status === 401 && res.headers.get('www-authenticate')) { - const auth = res.headers.get('www-authenticate') - .split(/,\s*/) - .map(s => s.toLowerCase()) - if (auth.indexOf('ipaddress') !== -1) { - throw new errors.HttpErrorAuthIPAddress( - method, res, body, opts.spec - ) - } else if (auth.indexOf('otp') !== -1) { - throw new errors.HttpErrorAuthOTP( - method, res, body, opts.spec - ) - } else { - throw new errors.HttpErrorAuthUnknown( - method, res, body, opts.spec - ) - } - } else { - throw new errors.HttpErrorGeneral( - method, res, body, opts.spec - ) - } - }) -} diff --git a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/config.js b/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/config.js deleted file mode 100644 index db08c1e47001f1..00000000000000 --- a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/config.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict' - -const pkg = require('./package.json') -const figgyPudding = require('figgy-pudding') -const silentLog = require('./silentlog.js') - -const AUTH_REGEX = /^(?:.*:)?(token|_authToken|username|_password|password|email|always-auth|_auth|otp)$/ -const SCOPE_REGISTRY_REGEX = /@.*:registry$/gi -module.exports = figgyPudding({ - 'agent': {}, - 'algorithms': {}, - 'body': {}, - 'ca': {}, - 'cache': {}, - 'cert': {}, - 'fetch-retries': {}, - 'fetch-retry-factor': {}, - 'fetch-retry-maxtimeout': {}, - 'fetch-retry-mintimeout': {}, - 'gid': {}, - 'headers': {}, - 'https-proxy': {}, - 'integrity': {}, - 'is-from-ci': 'isFromCI', - 'isFromCI': { - default () { - return ( - process.env['CI'] === 'true' || - process.env['TDDIUM'] || - process.env['JENKINS_URL'] || - process.env['bamboo.buildKey'] || - process.env['GO_PIPELINE_NAME'] - ) - } - }, - 'key': {}, - 'local-address': {}, - 'log': { - default: silentLog - }, - 'max-sockets': 'maxsockets', - 'maxsockets': { - default: 12 - }, - 'memoize': {}, - 'method': { - default: 'GET' - }, - 'no-proxy': {}, - 'noproxy': {}, - 'npm-session': 'npmSession', - 'npmSession': {}, - 'offline': {}, - 'otp': {}, - 'prefer-offline': {}, - 'prefer-online': {}, - 'projectScope': {}, - 'project-scope': 'projectScope', - 'Promise': {}, - 'proxy': {}, - 'query': {}, - 'refer': {}, - 'referer': 'refer', - 'registry': { - default: 'https://registry.npmjs.org/' - }, - 'retry': {}, - 'scope': {}, - 'spec': {}, - 'strict-ssl': {}, - 'timeout': {}, - 'uid': {}, - 'user-agent': { - default: `${ - pkg.name - }@${ - pkg.version - }/node@${ - process.version - }+${ - process.arch - } (${ - process.platform - })` - } -}, { - other (key) { - return key.match(AUTH_REGEX) || key.match(SCOPE_REGISTRY_REGEX) - } -}) diff --git a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/errors.js b/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/errors.js deleted file mode 100644 index 217f46f9773a78..00000000000000 --- a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/errors.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict' - -class HttpErrorBase extends Error { - constructor (method, res, body, spec) { - super() - this.headers = res.headers.raw() - this.statusCode = res.status - this.code = `E${res.status}` - this.method = method - this.uri = res.url - this.body = body - } -} -module.exports.HttpErrorBase = HttpErrorBase - -class HttpErrorGeneral extends HttpErrorBase { - constructor (method, res, body, spec) { - super(method, res, body, spec) - this.message = `${res.status} ${res.statusText} - ${ - this.method.toUpperCase() - } ${ - this.spec || this.uri - }${ - (body && body.error) ? ' - ' + body.error : '' - }` - Error.captureStackTrace(this, HttpErrorGeneral) - } -} -module.exports.HttpErrorGeneral = HttpErrorGeneral - -class HttpErrorAuthOTP extends HttpErrorBase { - constructor (method, res, body, spec) { - super(method, res, body, spec) - this.message = 'OTP required for authentication' - this.code = 'EOTP' - Error.captureStackTrace(this, HttpErrorAuthOTP) - } -} -module.exports.HttpErrorAuthOTP = HttpErrorAuthOTP - -class HttpErrorAuthIPAddress extends HttpErrorBase { - constructor (method, res, body, spec) { - super(method, res, body, spec) - this.message = 'Login is not allowed from your IP address' - this.code = 'EAUTHIP' - Error.captureStackTrace(this, HttpErrorAuthIPAddress) - } -} -module.exports.HttpErrorAuthIPAddress = HttpErrorAuthIPAddress - -class HttpErrorAuthUnknown extends HttpErrorBase { - constructor (method, res, body, spec) { - super(method, res, body, spec) - this.message = 'Unable to authenticate, need: ' + res.headers.get('www-authenticate') - Error.captureStackTrace(this, HttpErrorAuthUnknown) - } -} -module.exports.HttpErrorAuthUnknown = HttpErrorAuthUnknown diff --git a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/index.js b/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/index.js deleted file mode 100644 index bb6ddeaee0151d..00000000000000 --- a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/index.js +++ /dev/null @@ -1,160 +0,0 @@ -'use strict' - -const Buffer = require('safe-buffer').Buffer - -const checkResponse = require('./check-response.js') -const config = require('./config.js') -const getAuth = require('./auth.js') -const fetch = require('make-fetch-happen') -const npa = require('npm-package-arg') -const qs = require('querystring') -const url = require('url') - -module.exports = regFetch -function regFetch (uri, opts) { - opts = config(opts) - const registry = ( - (opts.get('spec') && pickRegistry(opts.get('spec'), opts)) || - opts.get('registry') || - 'https://registry.npmjs.org/' - ) - uri = url.parse(uri).protocol - ? uri - : `${ - registry.trim().replace(/\/?$/g, '') - }/${ - uri.trim().replace(/^\//, '') - }` - // through that takes into account the scope, the prefix of `uri`, etc - const startTime = Date.now() - const headers = getHeaders(registry, uri, opts) - let body = opts.get('body') - const bodyIsStream = body && - typeof body === 'object' && - typeof body.pipe === 'function' - if (body && !bodyIsStream && typeof body !== 'string' && !Buffer.isBuffer(body)) { - headers['content-type'] = headers['content-type'] || 'application/json' - body = JSON.stringify(body) - } else if (body && !headers['content-type']) { - headers['content-type'] = 'application/octet-stream' - } - if (opts.get('query')) { - let q = opts.get('query') - if (typeof q === 'string') { - q = qs.parse(q) - } - const parsed = url.parse(uri) - parsed.search = '?' + qs.stringify( - parsed.query - ? Object.assign(qs.parse(parsed.query), q) - : q - ) - uri = url.format(parsed) - } - return fetch(uri, { - agent: opts.get('agent'), - algorithms: opts.get('algorithms'), - body, - cache: getCacheMode(opts), - cacheManager: opts.get('cache'), - ca: opts.get('ca'), - cert: opts.get('cert'), - headers, - integrity: opts.get('integrity'), - key: opts.get('key'), - localAddress: opts.get('local-address'), - maxSockets: opts.get('maxsockets'), - memoize: opts.get('memoize'), - method: opts.get('method') || 'GET', - noProxy: opts.get('no-proxy') || opts.get('noproxy'), - Promise: opts.get('Promise'), - proxy: opts.get('https-proxy') || opts.get('proxy'), - referer: opts.get('refer'), - retry: opts.get('retry') || { - retries: opts.get('fetch-retries'), - factor: opts.get('fetch-retry-factor'), - minTimeout: opts.get('fetch-retry-mintimeout'), - maxTimeout: opts.get('fetch-retry-maxtimeout') - }, - strictSSL: !!opts.get('strict-ssl'), - timeout: opts.get('timeout'), - uid: opts.get('uid'), - gid: opts.get('gid') - }).then(res => checkResponse( - opts.get('method') || 'GET', res, registry, startTime, opts - )) -} - -module.exports.json = fetchJSON -function fetchJSON (uri, opts) { - return regFetch(uri, opts).then(res => res.json()) -} - -module.exports.pickRegistry = pickRegistry -function pickRegistry (spec, opts) { - spec = npa(spec) - opts = config(opts) - let registry = spec.scope && - opts.get(spec.scope.replace(/^@?/, '@') + ':registry') - - if (!registry && opts.get('scope')) { - registry = opts.get( - opts.get('scope').replace(/^@?/, '@') + ':registry' - ) - } - - if (!registry) { - registry = opts.get('registry') || 'https://registry.npmjs.org/' - } - - return registry -} - -function getCacheMode (opts) { - return opts.get('offline') - ? 'only-if-cached' - : opts.get('prefer-offline') - ? 'force-cache' - : opts.get('prefer-online') - ? 'no-cache' - : 'default' -} - -function getHeaders (registry, uri, opts) { - const headers = Object.assign({ - 'npm-in-ci': !!( - opts.get('is-from-ci') || - process.env['CI'] === 'true' || - process.env['TDDIUM'] || - process.env['JENKINS_URL'] || - process.env['bamboo.buildKey'] || - process.env['GO_PIPELINE_NAME'] - ), - 'npm-scope': opts.get('project-scope'), - 'npm-session': opts.get('npm-session'), - 'user-agent': opts.get('user-agent'), - 'referer': opts.get('refer') - }, opts.get('headers')) - - const auth = getAuth(registry, opts) - // If a tarball is hosted on a different place than the manifest, only send - // credentials on `alwaysAuth` - const shouldAuth = ( - auth.alwaysAuth || - url.parse(uri).host === url.parse(registry).host - ) - if (shouldAuth && auth.token) { - headers.authorization = `Bearer ${auth.token}` - } else if (shouldAuth && auth.username && auth.password) { - const encoded = Buffer.from( - `${auth.username}:${auth.password}`, 'utf8' - ).toString('base64') - headers.authorization = `Basic ${encoded}` - } else if (shouldAuth && auth._auth) { - headers.authorization = `Basic ${auth._auth}` - } - if (shouldAuth && auth.otp) { - headers['npm-otp'] = auth.otp - } - return headers -} diff --git a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/package.json b/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/package.json deleted file mode 100644 index f17636c6cf5e46..00000000000000 --- a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "_from": "npm-registry-fetch@^3.0.0", - "_id": "npm-registry-fetch@3.1.1", - "_inBundle": false, - "_integrity": "sha512-xBobENeenvjIG8PgQ1dy77AXTI25IbYhmA3DusMIfw/4EL5BaQ5e1V9trkPrqHvyjR3/T0cnH6o0Wt/IzcI5Ag==", - "_location": "/libnpmhook/npm-registry-fetch", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "npm-registry-fetch@^3.0.0", - "name": "npm-registry-fetch", - "escapedName": "npm-registry-fetch", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/libnpmhook" - ], - "_resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-3.1.1.tgz", - "_shasum": "e96bae698afdd45d4a01aca29e881fc0bc55206c", - "_spec": "npm-registry-fetch@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/libnpmhook", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/npm/registry-fetch/issues" - }, - "bundleDependencies": false, - "config": { - "nyc": { - "exclude": [ - "node_modules/**", - "test/**" - ] - } - }, - "dependencies": { - "bluebird": "^3.5.1", - "figgy-pudding": "^3.1.0", - "lru-cache": "^4.1.2", - "make-fetch-happen": "^4.0.0", - "npm-package-arg": "^6.0.0" - }, - "deprecated": false, - "description": "Fetch-based http client for use with npm registry APIs", - "devDependencies": { - "cacache": "^11.0.0", - "mkdirp": "^0.5.1", - "nock": "^9.2.3", - "npmlog": "^4.1.2", - "rimraf": "^2.6.2", - "ssri": "^6.0.0", - "standard": "^11.0.1", - "standard-version": "^4.2.0", - "tap": "^11.1.3", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" - }, - "files": [ - "*.js", - "lib" - ], - "homepage": "https://github.com/npm/registry-fetch#readme", - "keywords": [ - "npm", - "registry", - "fetch" - ], - "license": "ISC", - "main": "index.js", - "name": "npm-registry-fetch", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/registry-fetch.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" - }, - "version": "3.1.1" -} diff --git a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/silentlog.js b/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/silentlog.js deleted file mode 100644 index 886c5d55b2dbb2..00000000000000 --- a/deps/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/silentlog.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -const noop = Function.prototype -module.exports = { - error: noop, - warn: noop, - notice: noop, - info: noop, - verbose: noop, - silly: noop, - http: noop, - pause: noop, - resume: noop -} diff --git a/deps/npm/node_modules/libnpmhook/package.json b/deps/npm/node_modules/libnpmhook/package.json index 2f06e7a6b53bfd..ebcc752a3c350f 100644 --- a/deps/npm/node_modules/libnpmhook/package.json +++ b/deps/npm/node_modules/libnpmhook/package.json @@ -1,38 +1,28 @@ { - "_args": [ - [ - "libnpmhook@4.0.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "libnpmhook@4.0.1", - "_id": "libnpmhook@4.0.1", + "_from": "libnpmhook@5.0.2", + "_id": "libnpmhook@5.0.2", "_inBundle": false, - "_integrity": "sha512-3qqpfqvBD1712WA6iGe0stkG40WwAeoWcujA6BlC0Be1JArQbqwabnEnZ0CRcD05Tf1fPYJYdCbSfcfedEJCOg==", + "_integrity": "sha512-vLenmdFWhRfnnZiNFPNMog6CK7Ujofy2TWiM2CrpZUjBRIhHkJeDaAbJdYCT6W4lcHtyrJR8yXW8KFyq6UAp1g==", "_location": "/libnpmhook", - "_phantomChildren": { - "bluebird": "3.5.1", - "figgy-pudding": "3.1.0", - "lru-cache": "4.1.3", - "make-fetch-happen": "4.0.1", - "npm-package-arg": "6.1.0" - }, + "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "libnpmhook@4.0.1", + "raw": "libnpmhook@5.0.2", "name": "libnpmhook", "escapedName": "libnpmhook", - "rawSpec": "4.0.1", + "rawSpec": "5.0.2", "saveSpec": null, - "fetchSpec": "4.0.1" + "fetchSpec": "5.0.2" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/libnpmhook/-/libnpmhook-4.0.1.tgz", - "_spec": "4.0.1", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/libnpmhook/-/libnpmhook-5.0.2.tgz", + "_shasum": "d12817b0fb893f36f1d5be20017f2aea25825d94", + "_spec": "libnpmhook@5.0.2", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -40,16 +30,20 @@ "bugs": { "url": "https://github.com/npm/libnpmhook/issues" }, + "bundleDependencies": false, "dependencies": { - "figgy-pudding": "^3.1.0", - "npm-registry-fetch": "^3.0.0" + "aproba": "^2.0.0", + "figgy-pudding": "^3.4.1", + "get-stream": "^4.0.0", + "npm-registry-fetch": "^3.8.0" }, + "deprecated": false, "description": "programmatic API for managing npm registry hooks", "devDependencies": { - "nock": "^9.2.3", + "nock": "^9.6.1", "standard": "^11.0.1", - "standard-version": "^4.3.0", - "tap": "^11.1.3", + "standard-version": "^4.4.0", + "tap": "^12.0.1", "weallbehave": "^1.2.0", "weallcontribute": "^1.0.8" }, @@ -76,9 +70,9 @@ "prerelease": "npm t", "pretest": "standard", "release": "standard-version -s", - "test": "tap -J --coverage test/*.js", + "test": "tap -J --100 --coverage test/*.js", "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "4.0.1" + "version": "5.0.2" } diff --git a/deps/npm/node_modules/libnpmorg/CHANGELOG.md b/deps/npm/node_modules/libnpmorg/CHANGELOG.md new file mode 100644 index 00000000000000..03392b64cd91cb --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/CHANGELOG.md @@ -0,0 +1,11 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# 1.0.0 (2018-08-23) + + +### Features + +* **API:** implement org api ([731b9c6](https://github.com/npm/libnpmorg/commit/731b9c6)) diff --git a/deps/npm/node_modules/libnpmorg/CODE_OF_CONDUCT.md b/deps/npm/node_modules/libnpmorg/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000000..aeb72f598dcb45 --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/CODE_OF_CONDUCT.md @@ -0,0 +1,151 @@ +# Code of Conduct + +## When Something Happens + +If you see a Code of Conduct violation, follow these steps: + +1. Let the person know that what they did is not appropriate and ask them to stop and/or edit their message(s) or commits. +2. That person should immediately stop the behavior and correct the issue. +3. If this doesn’t happen, or if you're uncomfortable speaking up, [contact the maintainers](#contacting-maintainers). +4. As soon as available, a maintainer will look into the issue, and take [further action (see below)](#further-enforcement), starting with a warning, then temporary block, then long-term repo or organization ban. + +When reporting, please include any relevant details, links, screenshots, context, or other information that may be used to better understand and resolve the situation. + +**The maintainer team will prioritize the well-being and comfort of the recipients of the violation over the comfort of the violator.** See [some examples below](#enforcement-examples). + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers of this project pledge to making participation in our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, technical preferences, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + + * Using welcoming and inclusive language. + * Being respectful of differing viewpoints and experiences. + * Gracefully accepting constructive feedback. + * Focusing on what is best for the community. + * Showing empathy and kindness towards other community members. + * Encouraging and raising up your peers in the project so you can all bask in hacks and glory. + +Examples of unacceptable behavior by participants include: + + * The use of sexualized language or imagery and unwelcome sexual attention or advances, including when simulated online. The only exception to sexual topics is channels/spaces specifically for topics of sexual identity. + * Casual mention of slavery or indentured servitude and/or false comparisons of one's occupation or situation to slavery. Please consider using or asking about alternate terminology when referring to such metaphors in technology. + * Making light of/making mocking comments about trigger warnings and content warnings. + * Trolling, insulting/derogatory comments, and personal or political attacks. + * Public or private harassment, deliberate intimidation, or threats. + * Publishing others' private information, such as a physical or electronic address, without explicit permission. This includes any sort of "outing" of any aspect of someone's identity without their consent. + * Publishing private screenshots or quotes of interactions in the context of this project without all quoted users' *explicit* consent. + * Publishing of private communication that doesn't have to do with reporting harrassment. + * Any of the above even when [presented as "ironic" or "joking"](https://en.wikipedia.org/wiki/Hipster_racism). + * Any attempt to present "reverse-ism" versions of the above as violations. Examples of reverse-isms are "reverse racism", "reverse sexism", "heterophobia", and "cisphobia". + * Unsolicited explanations under the assumption that someone doesn't already know it. Ask before you teach! Don't assume what people's knowledge gaps are. + * [Feigning or exaggerating surprise](https://www.recurse.com/manual#no-feigned-surprise) when someone admits to not knowing something. + * "[Well-actuallies](https://www.recurse.com/manual#no-well-actuallys)" + * Other conduct which could reasonably be considered inappropriate in a professional or community setting. + +## Scope + +This Code of Conduct applies both within spaces involving this project and in other spaces involving community members. This includes the repository, its Pull Requests and Issue tracker, its Twitter community, private email communications in the context of the project, and any events where members of the project are participating, as well as adjacent communities and venues affecting the project's members. + +Depending on the violation, the maintainers may decide that violations of this code of conduct that have happened outside of the scope of the community may deem an individual unwelcome, and take appropriate action to maintain the comfort and safety of its members. + +### Other Community Standards + +As a project on GitHub, this project is additionally covered by the [GitHub Community Guidelines](https://help.github.com/articles/github-community-guidelines/). + +Additionally, as a project hosted on npm, is is covered by [npm, Inc's Code of Conduct](https://www.npmjs.com/policies/conduct). + +Enforcement of those guidelines after violations overlapping with the above are the responsibility of the entities, and enforcement may happen in any or all of the services/communities. + +## Maintainer Enforcement Process + +Once the maintainers get involved, they will follow a documented series of steps and do their best to preserve the well-being of project members. This section covers actual concrete steps. + +### Contacting Maintainers + +You may get in touch with the maintainer team through any of the following methods: + + * Through email: + * [kzm@zkat.tech](mailto:kzm@zkat.tech) (Kat Marchán) + + * Through Twitter: + * [@maybekatz](https://twitter.com/maybekatz) (Kat Marchán) + +### Further Enforcement + +If you've already followed the [initial enforcement steps](#enforcement), these are the steps maintainers will take for further enforcement, as needed: + + 1. Repeat the request to stop. + 2. If the person doubles down, they will have offending messages removed or edited by a maintainers given an official warning. The PR or Issue may be locked. + 3. If the behavior continues or is repeated later, the person will be blocked from participating for 24 hours. + 4. If the behavior continues or is repeated after the temporary block, a long-term (6-12mo) ban will be used. + +On top of this, maintainers may remove any offending messages, images, contributions, etc, as they deem necessary. + +Maintainers reserve full rights to skip any of these steps, at their discretion, if the violation is considered to be a serious and/or immediate threat to the health and well-being of members of the community. These include any threats, serious physical or verbal attacks, and other such behavior that would be completely unacceptable in any social setting that puts our members at risk. + +Members expelled from events or venues with any sort of paid attendance will not be refunded. + +### Who Watches the Watchers? + +Maintainers and other leaders who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. These may include anything from removal from the maintainer team to a permanent ban from the community. + +Additionally, as a project hosted on both GitHub and npm, [their own Codes of Conducts may be applied against maintainers of this project](#other-community-standards), externally of this project's procedures. + +### Enforcement Examples + +#### The Best Case + +The vast majority of situations work out like this. This interaction is common, and generally positive. + +> Alex: "Yeah I used X and it was really crazy!" + +> Patt (not a maintainer): "Hey, could you not use that word? What about 'ridiculous' instead?" + +> Alex: "oh sorry, sure." -> edits old comment to say "it was really confusing!" + +#### The Maintainer Case + +Sometimes, though, you need to get maintainers involved. Maintainers will do their best to resolve conflicts, but people who were harmed by something **will take priority**. + +> Patt: "Honestly, sometimes I just really hate using $library and anyone who uses it probably sucks at their job." + +> Alex: "Whoa there, could you dial it back a bit? There's a CoC thing about attacking folks' tech use like that." + +> Patt: "I'm not attacking anyone, what's your problem?" + +> Alex: "@maintainers hey uh. Can someone look at this issue? Patt is getting a bit aggro. I tried to nudge them about it, but nope." + +> KeeperOfCommitBits: (on issue) "Hey Patt, maintainer here. Could you tone it down? This sort of attack is really not okay in this space." + +> Patt: "Leave me alone I haven't said anything bad wtf is wrong with you." + +> KeeperOfCommitBits: (deletes user's comment), "@patt I mean it. Please refer to the CoC over at (URL to this CoC) if you have questions, but you can consider this an actual warning. I'd appreciate it if you reworded your messages in this thread, since they made folks there uncomfortable. Let's try and be kind, yeah?" + +> Patt: "@keeperofbits Okay sorry. I'm just frustrated and I'm kinda burnt out and I guess I got carried away. I'll DM Alex a note apologizing and edit my messages. Sorry for the trouble." + +> KeeperOfCommitBits: "@patt Thanks for that. I hear you on the stress. Burnout sucks :/. Have a good one!" + +#### The Nope Case + +> PepeTheFrog🐸: "Hi, I am a literal actual nazi and I think white supremacists are quite fashionable." + +> Patt: "NOOOOPE. OH NOPE NOPE." + +> Alex: "JFC NO. NOPE. @keeperofbits NOPE NOPE LOOK HERE" + +> KeeperOfCommitBits: "👀 Nope. NOPE NOPE NOPE. 🔥" + +> PepeTheFrog🐸 has been banned from all organization or user repositories belonging to KeeperOfCommitBits. + +## Attribution + +This Code of Conduct was generated using [WeAllJS Code of Conduct Generator](https://npm.im/weallbehave), which is based on the [WeAllJS Code of +Conduct](https://wealljs.org/code-of-conduct), which is itself based on +[Contributor Covenant](http://contributor-covenant.org), version 1.4, available +at +[http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4), +and the LGBTQ in Technology Slack [Code of +Conduct](http://lgbtq.technology/coc.html). diff --git a/deps/npm/node_modules/libnpmorg/CONTRIBUTING.md b/deps/npm/node_modules/libnpmorg/CONTRIBUTING.md new file mode 100644 index 00000000000000..eb4b58b03ef1a8 --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/CONTRIBUTING.md @@ -0,0 +1,256 @@ +# Contributing + +## How do I... + +* [Use This Guide](#introduction)? +* Ask or Say Something? 🤔🐛😱 + * [Request Support](#request-support) + * [Report an Error or Bug](#report-an-error-or-bug) + * [Request a Feature](#request-a-feature) +* Make Something? 🤓👩🏽‍💻📜🍳 + * [Project Setup](#project-setup) + * [Contribute Documentation](#contribute-documentation) + * [Contribute Code](#contribute-code) +* Manage Something ✅🙆🏼💃👔 + * [Provide Support on Issues](#provide-support-on-issues) + * [Label Issues](#label-issues) + * [Clean Up Issues and PRs](#clean-up-issues-and-prs) + * [Review Pull Requests](#review-pull-requests) + * [Merge Pull Requests](#merge-pull-requests) + * [Tag a Release](#tag-a-release) + * [Join the Project Team](#join-the-project-team) +* Add a Guide Like This One [To My Project](#attribution)? 🤖😻👻 + +## Introduction + +Thank you so much for your interest in contributing!. All types of contributions are encouraged and valued. See the [table of contents](#toc) for different ways to help and details about how this project handles them!📝 + +Please make sure to read the relevant section before making your contribution! It will make it a lot easier for us maintainers to make the most of it and smooth out the experience for all involved. 💚 + +The [Project Team](#join-the-project-team) looks forward to your contributions. 🙌🏾✨ + +## Request Support + +If you have a question about this project, how to use it, or just need clarification about something: + +* Open an Issue at https://github.com/npm/libnpmorg/issues +* Provide as much context as you can about what you're running into. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* Someone will try to have a response soon. +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. + +## Report an Error or Bug + +If you run into an error or bug with the project: + +* Open an Issue at https://github.com/npm/libnpmorg/issues +* Include *reproduction steps* that someone else can follow to recreate the bug or error on their own. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* A team member will try to reproduce the issue with your provided steps. If there are no repro steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +* If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#contribute-code). +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. +* `critical` issues may be left open, depending on perceived immediacy and severity, even past the 30 day deadline. + +## Request a Feature + +If the project doesn't do something you need or want it to do: + +* Open an Issue at https://github.com/npm/libnpmorg/issues +* Provide as much context as you can about what you're running into. +* Please try and be clear about why existing features and alternatives would not work for you. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* The project team will evaluate the feature request, possibly asking you more questions to understand its purpose and any relevant requirements. If the issue is closed, the team will convey their reasoning and suggest an alternative path forward. +* If the feature request is accepted, it will be marked for implementation with `feature-accepted`, which can then be done by either by a core team member or by anyone in the community who wants to [contribute code](#contribute-code). + +Note: The team is unlikely to be able to accept every single feature request that is filed. Please understand if they need to say no. + +## Project Setup + +So you wanna contribute some code! That's great! This project uses GitHub Pull Requests to manage contributions, so [read up on how to fork a GitHub project and file a PR](https://guides.github.com/activities/forking) if you've never done it before. + +If this seems like a lot or you aren't able to do all this setup, you might also be able to [edit the files directly](https://help.github.com/articles/editing-files-in-another-user-s-repository/) without having to do any of this setup. Yes, [even code](#contribute-code). + +If you want to go the usual route and run the project locally, though: + +* [Install Node.js](https://nodejs.org/en/download/) +* [Fork the project](https://guides.github.com/activities/forking/#fork) + +Then in your terminal: +* `cd path/to/your/clone` +* `npm install` +* `npm test` + +And you should be ready to go! + +## Contribute Documentation + +Documentation is a super important, critical part of this project. Docs are how we keep track of what we're doing, how, and why. It's how we stay on the same page about our policies. And it's how we tell others everything they need in order to be able to use this project -- or contribute to it. So thank you in advance. + +Documentation contributions of any size are welcome! Feel free to file a PR even if you're just rewording a sentence to be more clear, or fixing a spelling mistake! + +To contribute documentation: + +* [Set up the project](#project-setup). +* Edit or add any relevant documentation. +* Make sure your changes are formatted correctly and consistently with the rest of the documentation. +* Re-read what you wrote, and run a spellchecker on it to make sure you didn't miss anything. +* In your commit message(s), begin the first line with `docs: `. For example: `docs: Adding a doc contrib section to CONTRIBUTING.md`. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). Documentation commits should use `docs(): `. +* Go to https://github.com/npm/libnpmorg/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Contribute Code + +We like code commits a lot! They're super handy, and they keep the project going and doing the work it needs to do to be useful to others. + +Code contributions of just about any size are acceptable! + +The main difference between code contributions and documentation contributions is that contributing code requires inclusion of relevant tests for the code being added or changed. Contributions without accompanying tests will be held off until a test is added, unless the maintainers consider the specific tests to be either impossible, or way too much of a burden for such a contribution. + +To contribute code: + +* [Set up the project](#project-setup). +* Make any necessary changes to the source code. +* Include any [additional documentation](#contribute-documentation) the changes might need. +* Write tests that verify that your contribution works as expected. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). +* Dependency updates, additions, or removals must be in individual commits, and the message must use the format: `(deps): PKG@VERSION`, where `` is any of the usual `conventional-changelog` prefixes, at your discretion. +* Go to https://github.com/npm/libnpmorg/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* Barring special circumstances, maintainers will not review PRs until all checks pass (Travis, AppVeyor, etc). +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. Additional tags (such as `needs-tests`) will be added depending on the review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Provide Support on Issues + +[Needs Collaborator](#join-the-project-team): none + +Helping out other users with their questions is a really awesome way of contributing to any community. It's not uncommon for most of the issues on an open source projects being support-related questions by users trying to understand something they ran into, or find their way around a known bug. + +Sometimes, the `support` label will be added to things that turn out to actually be other things, like bugs or feature requests. In that case, suss out the details with the person who filed the original issue, add a comment explaining what the bug is, and change the label from `support` to `bug` or `feature`. If you can't do this yourself, @mention a maintainer so they can do it. + +In order to help other folks out with their questions: + +* Go to the issue tracker and [filter open issues by the `support` label](https://github.com/npm/libnpmorg/issues?q=is%3Aopen+is%3Aissue+label%3Asupport). +* Read through the list until you find something that you're familiar enough with to give an answer to. +* Respond to the issue with whatever details are needed to clarify the question, or get more details about what's going on. +* Once the discussion wraps up and things are clarified, either close the issue, or ask the original issue filer (or a maintainer) to close it for you. + +Some notes on picking up support issues: + +* Avoid responding to issues you don't know you can answer accurately. +* As much as possible, try to refer to past issues with accepted answers. Link to them from your replies with the `#123` format. +* Be kind and patient with users -- often, folks who have run into confusing things might be upset or impatient. This is ok. Try to understand where they're coming from, and if you're too uncomfortable with the tone, feel free to stay away or withdraw from the issue. (note: if the user is outright hostile or is violating the CoC, [refer to the Code of Conduct](CODE_OF_CONDUCT.md) to resolve the conflict). + +## Label Issues + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +One of the most important tasks in handling issues is labeling them usefully and accurately. All other tasks involving issues ultimately rely on the issue being classified in such a way that relevant parties looking to do their own tasks can find them quickly and easily. + +In order to label issues, [open up the list of unlabeled issues](https://github.com/npm/libnpmorg/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and, **from newest to oldest**, read through each one and apply issue labels according to the table below. If you're unsure about what label to apply, skip the issue and try the next one: don't feel obligated to label each and every issue yourself! + +Label | Apply When | Notes +--- | --- | --- +`bug` | Cases where the code (or documentation) is behaving in a way it wasn't intended to. | If something is happening that surprises the *user* but does not go against the way the code is designed, it should use the `enhancement` label. +`critical` | Added to `bug` issues if the problem described makes the code completely unusable in a common situation. | +`documentation` | Added to issues or pull requests that affect any of the documentation for the project. | Can be combined with other labels, such as `bug` or `enhancement`. +`duplicate` | Added to issues or PRs that refer to the exact same issue as another one that's been previously labeled. | Duplicate issues should be marked and closed right away, with a message referencing the issue it's a duplicate of (with `#123`) +`enhancement` | Added to [feature requests](#request-a-feature), PRs, or documentation issues that are purely additive: the code or docs currently work as expected, but a change is being requested or suggested. | +`help wanted` | Applied by [Committers](#join-the-project-team) to issues and PRs that they would like to get outside help for. Generally, this means it's lower priority for the maintainer team to itself implement, but that the community is encouraged to pick up if they so desire | Never applied on first-pass labeling. +`in-progress` | Applied by [Committers](#join-the-project-team) to PRs that are pending some work before they're ready for review. | The original PR submitter should @mention the team member that applied the label once the PR is complete. +`performance` | This issue or PR is directly related to improving performance. | +`refactor` | Added to issues or PRs that deal with cleaning up or modifying the project for the betterment of it. | +`starter` | Applied by [Committers](#join-the-project-team) to issues that they consider good introductions to the project for people who have not contributed before. These are not necessarily "easy", but rather focused around how much context is necessary in order to understand what needs to be done for this project in particular. | Existing project members are expected to stay away from these unless they increase in priority. +`support` | This issue is either asking a question about how to use the project, clarifying the reason for unexpected behavior, or possibly reporting a `bug` but does not have enough detail yet to determine whether it would count as such. | The label should be switched to `bug` if reliable reproduction steps are provided. Issues primarily with unintended configurations of a user's environment are not considered bugs, even if they cause crashes. +`tests` | This issue or PR either requests or adds primarily tests to the project. | If a PR is pending tests, that will be handled through the [PR review process](#review-pull-requests) +`wontfix` | Labelers may apply this label to issues that clearly have nothing at all to do with the project or are otherwise entirely outside of its scope/sphere of influence. [Committers](#join-the-project-team) may apply this label and close an issue or PR if they decide to pass on an otherwise relevant issue. | The issue or PR should be closed as soon as the label is applied, and a clear explanation provided of why the label was used. Contributors are free to contest the labeling, but the decision ultimately falls on committers as to whether to accept something or not. + +## Clean Up Issues and PRs + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +Issues and PRs can go stale after a while. Maybe they're abandoned. Maybe the team will just plain not have time to address them any time soon. + +In these cases, they should be closed until they're brought up again or the interaction starts over. + +To clean up issues and PRs: + +* Search the issue tracker for issues or PRs, and add the term `updated:<=YYYY-MM-DD`, where the date is 30 days before today. +* Go through each issue *from oldest to newest*, and close them if **all of the following are true**: + * not opened by a maintainer + * not marked as `critical` + * not marked as `starter` or `help wanted` (these might stick around for a while, in general, as they're intended to be available) + * no explicit messages in the comments asking for it to be left open + * does not belong to a milestone +* Leave a message when closing saying "Cleaning up stale issue. Please reopen or ping us if and when you're ready to resume this. See https://github.com/npm/libnpmorg/blob/latest/CONTRIBUTING.md#clean-up-issues-and-prs for more details." + +## Review Pull Requests + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +While anyone can comment on a PR, add feedback, etc, PRs are only *approved* by team members with Issue Tracker or higher permissions. + +PR reviews use [GitHub's own review feature](https://help.github.com/articles/about-pull-request-reviews/), which manages comments, approval, and review iteration. + +Some notes: + +* You may ask for minor changes ("nitpicks"), but consider whether they are really blockers to merging: try to err on the side of "approve, with comments". +* *ALL PULL REQUESTS* should be covered by a test: either by a previously-failing test, an existing test that covers the entire functionality of the submitted code, or new tests to verify any new/changed behavior. All tests must also pass and follow established conventions. Test coverage should not drop, unless the specific case is considered reasonable by maintainers. +* Please make sure you're familiar with the code or documentation being updated, unless it's a minor change (spellchecking, minor formatting, etc). You may @mention another project member who you think is better suited for the review, but still provide a non-approving review of your own. +* Be extra kind: people who submit code/doc contributions are putting themselves in a pretty vulnerable position, and have put time and care into what they've done (even if that's not obvious to you!) -- always respond with respect, be understanding, but don't feel like you need to sacrifice your standards for their sake, either. Just don't be a jerk about it? + +## Merge Pull Requests + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. + +## Tag A Release + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. The most important bit here is probably that all tests must pass, and tags must use [semver](https://semver.org). + +## Join the Project Team + +### Ways to Join + +There are many ways to contribute! Most of them don't require any official status unless otherwise noted. That said, there's a couple of positions that grant special repository abilities, and this section describes how they're granted and what they do. + +All of the below positions are granted based on the project team's needs, as well as their consensus opinion about whether they would like to work with the person and think that they would fit well into that position. The process is relatively informal, and it's likely that people who express interest in participating can just be granted the permissions they'd like. + +You can spot a collaborator on the repo by looking for the `[Collaborator]` or `[Owner]` tags next to their names. + +Permission | Description +--- | --- +Issue Tracker | Granted to contributors who express a strong interest in spending time on the project's issue tracker. These tasks are mainly [labeling issues](#label-issues), [cleaning up old ones](#clean-up-issues-and-prs), and [reviewing pull requests](#review-pull-requests), as well as all the usual things non-team-member contributors can do. Issue handlers should not merge pull requests, tag releases, or directly commit code themselves: that should still be done through the usual pull request process. Becoming an Issue Handler means the project team trusts you to understand enough of the team's process and context to implement it on the issue tracker. +Committer | Granted to contributors who want to handle the actual pull request merges, tagging new versions, etc. Committers should have a good level of familiarity with the codebase, and enough context to understand the implications of various changes, as well as a good sense of the will and expectations of the project team. +Admin/Owner | Granted to people ultimately responsible for the project, its community, etc. + +## Attribution + +This guide was generated using the WeAllJS `CONTRIBUTING.md` generator. [Make your own](https://npm.im/weallcontribute)! diff --git a/deps/npm/node_modules/libnpmorg/LICENSE b/deps/npm/node_modules/libnpmorg/LICENSE new file mode 100644 index 00000000000000..209e4477f39c1a --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +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/libnpmorg/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmorg/PULL_REQUEST_TEMPLATE new file mode 100644 index 00000000000000..9471c6d325f7eb --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/PULL_REQUEST_TEMPLATE @@ -0,0 +1,7 @@ + diff --git a/deps/npm/node_modules/libnpmorg/README.md b/deps/npm/node_modules/libnpmorg/README.md new file mode 100644 index 00000000000000..6244794eda016f --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/README.md @@ -0,0 +1,144 @@ +# libnpmorg [![npm version](https://img.shields.io/npm/v/libnpmorg.svg)](https://npm.im/libnpmorg) [![license](https://img.shields.io/npm/l/libnpmorg.svg)](https://npm.im/libnpmorg) [![Travis](https://img.shields.io/travis/npm/libnpmorg.svg)](https://travis-ci.org/npm/libnpmorg) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmorg?svg=true)](https://ci.appveyor.com/project/zkat/libnpmorg) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmorg/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmorg?branch=latest) + +[`libnpmorg`](https://github.com/npm/libnpmorg) is a Node.js library for +programmatically accessing the [npm Org membership +API](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#membership-detail). + +## Example + +```js +const org = require('libnpmorg') + +console.log(await org.ls('myorg', {token: 'deadbeef'})) +=> +Roster { + zkat: 'developer', + iarna: 'admin', + isaacs: 'owner' +} +``` + +## Install + +`$ npm install libnpmorg` + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [API](#api) + * [hook opts](#opts) + * [`set()`](#set) + * [`rm()`](#rm) + * [`ls()`](#ls) + * [`ls.stream()`](#ls-stream) + +### API + +#### `opts` for `libnpmorg` commands + +`libnpmorg` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). +All options are passed through directly to that library, so please refer to [its +own `opts` +documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) +for options that can be passed in. + +A couple of options of note for those in a hurry: + +* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. +* `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmorg` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` +* `opts.Promise` - If you pass this in, the Promises returned by `libnpmorg` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` + +#### `> org.set(org, user, [role], [opts]) -> Promise` + +The returned Promise resolves to a [Membership +Detail](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#membership-detail) +object. + +The `role` is optional and should be one of `admin`, `owner`, or `developer`. +`developer` is the default if no `role` is provided. + +`org` and `user` must be scope names for the org name and user name +respectively. They can optionally be prefixed with `@`. + +See also: [`PUT +/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-membership-replace) + +##### Example + +```javascript +await org.set('@myorg', '@myuser', 'admin', {token: 'deadbeef'}) +=> +MembershipDetail { + org: { + name: 'myorg', + size: 15 + }, + user: 'myuser', + role: 'admin' +} +``` + +#### `> org.rm(org, user, [opts]) -> Promise` + +The Promise resolves to `null` on success. + +`org` and `user` must be scope names for the org name and user name +respectively. They can optionally be prefixed with `@`. + +See also: [`DELETE +/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-membership-delete) + +##### Example + +```javascript +await org.rm('myorg', 'myuser', {token: 'deadbeef'}) +``` + +#### `> org.ls(org, [opts]) -> Promise` + +The Promise resolves to a +[Roster](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#roster) +object. + +`org` must be a scope name for an org, and can be optionally prefixed with `@`. + +See also: [`GET +/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-roster) + +##### Example + +```javascript +await org.ls('myorg', {token: 'deadbeef'}) +=> +Roster { + zkat: 'developer', + iarna: 'admin', + isaacs: 'owner' +} +``` + +#### `> org.ls.stream(org, [opts]) -> Stream` + +Returns a stream of entries for a +[Roster](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#roster), +with each emitted entry in `[key, value]` format. + +`org` must be a scope name for an org, and can be optionally prefixed with `@`. + +The returned stream is a valid `Symbol.asyncIterator`. + +See also: [`GET +/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-roster) + +##### Example + +```javascript +for await (let [user, role] of org.ls.stream('myorg', {token: 'deadbeef'})) { + console.log(`user: ${user} (${role})`) +} +=> +user: zkat (developer) +user: iarna (admin) +user: isaacs (owner) +``` diff --git a/deps/npm/node_modules/libnpmorg/index.js b/deps/npm/node_modules/libnpmorg/index.js new file mode 100644 index 00000000000000..bff806aa583cfa --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/index.js @@ -0,0 +1,71 @@ +'use strict' + +const eu = encodeURIComponent +const fetch = require('npm-registry-fetch') +const figgyPudding = require('figgy-pudding') +const getStream = require('get-stream') +const validate = require('aproba') + +const OrgConfig = figgyPudding({ + Promise: {default: () => Promise} +}) + +// From https://github.com/npm/registry/blob/master/docs/orgs/memberships.md +const cmd = module.exports = {} + +class MembershipDetail {} +cmd.set = (org, user, role, opts) => { + if (typeof role === 'object' && !opts) { + opts = role + role = undefined + } + opts = OrgConfig(opts) + return new opts.Promise((resolve, reject) => { + validate('SSSO|SSZO', [org, user, role, opts]) + user = user.replace(/^@?/, '') + org = org.replace(/^@?/, '') + fetch.json(`/-/org/${eu(org)}/user`, opts.concat({ + method: 'PUT', + body: {user, role} + })).then(resolve, reject) + }).then(ret => Object.assign(new MembershipDetail(), ret)) +} + +cmd.rm = (org, user, opts) => { + opts = OrgConfig(opts) + return new opts.Promise((resolve, reject) => { + validate('SSO', [org, user, opts]) + user = user.replace(/^@?/, '') + org = org.replace(/^@?/, '') + fetch(`/-/org/${eu(org)}/user`, opts.concat({ + method: 'DELETE', + body: {user}, + ignoreBody: true + })).then(resolve, reject) + }).then(() => null) +} + +class Roster {} +cmd.ls = (org, opts) => { + opts = OrgConfig(opts) + return new opts.Promise((resolve, reject) => { + getStream.array(cmd.ls.stream(org, opts)).then(entries => { + const obj = {} + for (let [key, val] of entries) { + obj[key] = val + } + return obj + }).then(resolve, reject) + }).then(ret => Object.assign(new Roster(), ret)) +} + +cmd.ls.stream = (org, opts) => { + opts = OrgConfig(opts) + validate('SO', [org, opts]) + org = org.replace(/^@?/, '') + return fetch.json.stream(`/-/org/${eu(org)}/user`, '*', opts.concat({ + mapJson (value, [key]) { + return [key, value] + } + })) +} diff --git a/deps/npm/node_modules/libnpmorg/node_modules/aproba/CHANGELOG.md b/deps/npm/node_modules/libnpmorg/node_modules/aproba/CHANGELOG.md new file mode 100644 index 00000000000000..bab30ecb7e625d --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/node_modules/aproba/CHANGELOG.md @@ -0,0 +1,4 @@ +2.0.0 + * Drop support for 0.10 and 0.12. They haven't been in travis but still, + since we _know_ we'll break with them now it's only polite to do a + major bump. diff --git a/deps/npm/node_modules/libnpmorg/node_modules/aproba/LICENSE b/deps/npm/node_modules/libnpmorg/node_modules/aproba/LICENSE new file mode 100644 index 00000000000000..2a4982dc40cb69 --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/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/libnpmorg/node_modules/aproba/README.md b/deps/npm/node_modules/libnpmorg/node_modules/aproba/README.md new file mode 100644 index 00000000000000..e94799201ce046 --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/node_modules/aproba/README.md @@ -0,0 +1,93 @@ +aproba +====== + +A ridiculously 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 | `Array.isArray` 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` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### 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/libnpmorg/node_modules/aproba/index.js b/deps/npm/node_modules/libnpmorg/node_modules/aproba/index.js new file mode 100644 index 00000000000000..fd947481ba5575 --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' +module.exports = validate + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +const types = { + '*': {label: 'any', check: () => true}, + A: {label: 'array', check: _ => Array.isArray(_) || isArguments(_)}, + S: {label: 'string', check: _ => typeof _ === 'string'}, + N: {label: 'number', check: _ => typeof _ === 'number'}, + F: {label: 'function', check: _ => typeof _ === 'function'}, + O: {label: 'object', check: _ => typeof _ === 'object' && _ != null && !types.A.check(_) && !types.E.check(_)}, + B: {label: 'boolean', check: _ => typeof _ === 'boolean'}, + E: {label: 'error', check: _ => _ instanceof Error}, + Z: {label: 'null', check: _ => _ == null} +} + +function addSchema (schema, arity) { + const group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +function validate (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + const schemas = rawSchemas.split('|') + const arity = {} + + schemas.forEach(schema => { + for (let ii = 0; ii < schema.length; ++ii) { + const type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + let matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (let ii = 0; ii < args.length; ++ii) { + let newMatching = matching.filter(schema => { + const type = schema[ii] + const typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + const labels = matching.map(_ => types[_[ii]].label).filter(_ => _ != null) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +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, expectedTypes, value) { + let valueType + Object.keys(types).forEach(typeCode => { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + const english = englishList(expected) + const args = expected.every(ex => ex.length === 1) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + const err = new Error(msg) + err.code = code + /* istanbul ignore else */ + if (Error.captureStackTrace) Error.captureStackTrace(err, validate) + return err +} diff --git a/deps/npm/node_modules/libnpmorg/node_modules/aproba/package.json b/deps/npm/node_modules/libnpmorg/node_modules/aproba/package.json new file mode 100644 index 00000000000000..3268a9ec7f7e16 --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/node_modules/aproba/package.json @@ -0,0 +1,66 @@ +{ + "_args": [ + [ + "aproba@2.0.0", + "/Users/zkat/Documents/code/work/npm" + ] + ], + "_from": "aproba@2.0.0", + "_id": "aproba@2.0.0", + "_inBundle": false, + "_integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "_location": "/libnpmorg/aproba", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "aproba@2.0.0", + "name": "aproba", + "escapedName": "aproba", + "rawSpec": "2.0.0", + "saveSpec": null, + "fetchSpec": "2.0.0" + }, + "_requiredBy": [ + "/libnpmorg" + ], + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "_spec": "2.0.0", + "_where": "/Users/zkat/Documents/code/work/npm", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "dependencies": {}, + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "devDependencies": { + "standard": "^11.0.1", + "tap": "^12.0.1" + }, + "directories": { + "test": "test" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "name": "aproba", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "pretest": "standard", + "test": "tap --100 -J test/*.js" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/libnpmorg/package.json b/deps/npm/node_modules/libnpmorg/package.json new file mode 100644 index 00000000000000..3f1941298e192e --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/package.json @@ -0,0 +1,77 @@ +{ + "_args": [ + [ + "libnpmorg@1.0.0", + "/Users/zkat/Documents/code/work/npm" + ] + ], + "_from": "libnpmorg@1.0.0", + "_id": "libnpmorg@1.0.0", + "_inBundle": false, + "_integrity": "sha512-o+4eVJBoDGMgRwh2lJY0a8pRV2c/tQM/SxlqXezjcAg26Qe9jigYVs+Xk0vvlYDWCDhP0g74J8UwWeAgsB7gGw==", + "_location": "/libnpmorg", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "libnpmorg@1.0.0", + "name": "libnpmorg", + "escapedName": "libnpmorg", + "rawSpec": "1.0.0", + "saveSpec": null, + "fetchSpec": "1.0.0" + }, + "_requiredBy": [ + "/libnpm" + ], + "_resolved": "https://registry.npmjs.org/libnpmorg/-/libnpmorg-1.0.0.tgz", + "_spec": "1.0.0", + "_where": "/Users/zkat/Documents/code/work/npm", + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech" + }, + "bugs": { + "url": "https://github.com/npm/libnpmorg/issues" + }, + "dependencies": { + "aproba": "^2.0.0", + "figgy-pudding": "^3.4.1", + "get-stream": "^4.0.0", + "npm-registry-fetch": "^3.8.0" + }, + "description": "Programmatic api for `npm org` commands", + "devDependencies": { + "nock": "^9.6.1", + "standard": "*", + "standard-version": "*", + "tap": "*", + "weallbehave": "*", + "weallcontribute": "*" + }, + "homepage": "https://npmjs.com/package/libnpmorg", + "keywords": [ + "libnpm", + "npm", + "package manager", + "api", + "orgs", + "teams" + ], + "license": "ISC", + "name": "libnpmorg", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/libnpmorg.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --100 test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/libnpmorg/test/index.js b/deps/npm/node_modules/libnpmorg/test/index.js new file mode 100644 index 00000000000000..f5e163a06a7894 --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/test/index.js @@ -0,0 +1,81 @@ +'use strict' + +const figgyPudding = require('figgy-pudding') +const getStream = require('get-stream') +const test = require('tap').test +const tnock = require('./util/tnock.js') + +const org = require('../index.js') + +const OPTS = figgyPudding({registry: {}})({ + registry: 'https://mock.reg/' +}) + +test('set', t => { + const memDeets = { + org: { + name: 'myorg', + size: 15 + }, + user: 'myuser', + role: 'admin' + } + tnock(t, OPTS.registry).put('/-/org/myorg/user', { + user: 'myuser', + role: 'admin' + }).reply(201, memDeets) + return org.set('myorg', 'myuser', 'admin', OPTS).then(res => { + t.deepEqual(res, memDeets, 'got a membership details object back') + }) +}) + +test('optional role for set', t => { + const memDeets = { + org: { + name: 'myorg', + size: 15 + }, + user: 'myuser', + role: 'developer' + } + tnock(t, OPTS.registry).put('/-/org/myorg/user', { + user: 'myuser' + }).reply(201, memDeets) + return org.set('myorg', 'myuser', OPTS).then(res => { + t.deepEqual(res, memDeets, 'got a membership details object back') + }) +}) + +test('rm', t => { + tnock(t, OPTS.registry).delete('/-/org/myorg/user', { + user: 'myuser' + }).reply(204) + return org.rm('myorg', 'myuser', OPTS).then(() => { + t.ok(true, 'request succeeded') + }) +}) + +test('ls', t => { + const roster = { + 'zkat': 'developer', + 'iarna': 'admin', + 'isaacs': 'owner' + } + tnock(t, OPTS.registry).get('/-/org/myorg/user').reply(200, roster) + return org.ls('myorg', OPTS).then(res => { + t.deepEqual(res, roster, 'got back a roster') + }) +}) + +test('ls stream', t => { + const roster = { + 'zkat': 'developer', + 'iarna': 'admin', + 'isaacs': 'owner' + } + const rosterArr = Object.keys(roster).map(k => [k, roster[k]]) + tnock(t, OPTS.registry).get('/-/org/myorg/user').reply(200, roster) + return getStream.array(org.ls.stream('myorg', OPTS)).then(res => { + t.deepEqual(res, rosterArr, 'got back a roster, in entries format') + }) +}) diff --git a/deps/npm/node_modules/libnpmorg/test/util/tnock.js b/deps/npm/node_modules/libnpmorg/test/util/tnock.js new file mode 100644 index 00000000000000..00b6e160e10192 --- /dev/null +++ b/deps/npm/node_modules/libnpmorg/test/util/tnock.js @@ -0,0 +1,12 @@ +'use strict' + +const nock = require('nock') + +module.exports = tnock +function tnock (t, host) { + const server = nock(host) + t.tearDown(function () { + server.done() + }) + return server +} diff --git a/deps/npm/node_modules/libnpmpublish/.travis.yml b/deps/npm/node_modules/libnpmpublish/.travis.yml new file mode 100644 index 00000000000000..db5ea8b0186403 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +sudo: false +node_js: + - "10" + - "9" + - "8" + - "6" diff --git a/deps/npm/node_modules/libnpmpublish/CHANGELOG.md b/deps/npm/node_modules/libnpmpublish/CHANGELOG.md new file mode 100644 index 00000000000000..529fa805a09271 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/CHANGELOG.md @@ -0,0 +1,50 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [1.1.1](https://github.com/npm/libnpmpublish/compare/v1.1.0...v1.1.1) (2019-01-22) + + +### Bug Fixes + +* **auth:** send username in correct key ([#3](https://github.com/npm/libnpmpublish/issues/3)) ([38422d0](https://github.com/npm/libnpmpublish/commit/38422d0)) + + + + +# [1.1.0](https://github.com/npm/libnpmpublish/compare/v1.0.1...v1.1.0) (2018-08-31) + + +### Features + +* **publish:** add support for publishConfig on manifests ([161723b](https://github.com/npm/libnpmpublish/commit/161723b)) + + + + +## [1.0.1](https://github.com/npm/libnpmpublish/compare/v1.0.0...v1.0.1) (2018-08-31) + + +### Bug Fixes + +* **opts:** remove unused opts ([2837098](https://github.com/npm/libnpmpublish/commit/2837098)) + + + + +# 1.0.0 (2018-08-31) + + +### Bug Fixes + +* **api:** use opts.algorithms, return true on success ([80fe34b](https://github.com/npm/libnpmpublish/commit/80fe34b)) +* **publish:** first test pass w/ bugfixes ([74135c9](https://github.com/npm/libnpmpublish/commit/74135c9)) +* **publish:** full coverage test and related fixes ([b5a3446](https://github.com/npm/libnpmpublish/commit/b5a3446)) + + +### Features + +* **docs:** add README with api docs ([553c13d](https://github.com/npm/libnpmpublish/commit/553c13d)) +* **publish:** add initial publish support. tests tbd ([5b3fe94](https://github.com/npm/libnpmpublish/commit/5b3fe94)) +* **unpublish:** add new api with unpublish support ([1c9d594](https://github.com/npm/libnpmpublish/commit/1c9d594)) diff --git a/deps/npm/node_modules/libnpmpublish/CODE_OF_CONDUCT.md b/deps/npm/node_modules/libnpmpublish/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000000..aeb72f598dcb45 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/CODE_OF_CONDUCT.md @@ -0,0 +1,151 @@ +# Code of Conduct + +## When Something Happens + +If you see a Code of Conduct violation, follow these steps: + +1. Let the person know that what they did is not appropriate and ask them to stop and/or edit their message(s) or commits. +2. That person should immediately stop the behavior and correct the issue. +3. If this doesn’t happen, or if you're uncomfortable speaking up, [contact the maintainers](#contacting-maintainers). +4. As soon as available, a maintainer will look into the issue, and take [further action (see below)](#further-enforcement), starting with a warning, then temporary block, then long-term repo or organization ban. + +When reporting, please include any relevant details, links, screenshots, context, or other information that may be used to better understand and resolve the situation. + +**The maintainer team will prioritize the well-being and comfort of the recipients of the violation over the comfort of the violator.** See [some examples below](#enforcement-examples). + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers of this project pledge to making participation in our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, technical preferences, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + + * Using welcoming and inclusive language. + * Being respectful of differing viewpoints and experiences. + * Gracefully accepting constructive feedback. + * Focusing on what is best for the community. + * Showing empathy and kindness towards other community members. + * Encouraging and raising up your peers in the project so you can all bask in hacks and glory. + +Examples of unacceptable behavior by participants include: + + * The use of sexualized language or imagery and unwelcome sexual attention or advances, including when simulated online. The only exception to sexual topics is channels/spaces specifically for topics of sexual identity. + * Casual mention of slavery or indentured servitude and/or false comparisons of one's occupation or situation to slavery. Please consider using or asking about alternate terminology when referring to such metaphors in technology. + * Making light of/making mocking comments about trigger warnings and content warnings. + * Trolling, insulting/derogatory comments, and personal or political attacks. + * Public or private harassment, deliberate intimidation, or threats. + * Publishing others' private information, such as a physical or electronic address, without explicit permission. This includes any sort of "outing" of any aspect of someone's identity without their consent. + * Publishing private screenshots or quotes of interactions in the context of this project without all quoted users' *explicit* consent. + * Publishing of private communication that doesn't have to do with reporting harrassment. + * Any of the above even when [presented as "ironic" or "joking"](https://en.wikipedia.org/wiki/Hipster_racism). + * Any attempt to present "reverse-ism" versions of the above as violations. Examples of reverse-isms are "reverse racism", "reverse sexism", "heterophobia", and "cisphobia". + * Unsolicited explanations under the assumption that someone doesn't already know it. Ask before you teach! Don't assume what people's knowledge gaps are. + * [Feigning or exaggerating surprise](https://www.recurse.com/manual#no-feigned-surprise) when someone admits to not knowing something. + * "[Well-actuallies](https://www.recurse.com/manual#no-well-actuallys)" + * Other conduct which could reasonably be considered inappropriate in a professional or community setting. + +## Scope + +This Code of Conduct applies both within spaces involving this project and in other spaces involving community members. This includes the repository, its Pull Requests and Issue tracker, its Twitter community, private email communications in the context of the project, and any events where members of the project are participating, as well as adjacent communities and venues affecting the project's members. + +Depending on the violation, the maintainers may decide that violations of this code of conduct that have happened outside of the scope of the community may deem an individual unwelcome, and take appropriate action to maintain the comfort and safety of its members. + +### Other Community Standards + +As a project on GitHub, this project is additionally covered by the [GitHub Community Guidelines](https://help.github.com/articles/github-community-guidelines/). + +Additionally, as a project hosted on npm, is is covered by [npm, Inc's Code of Conduct](https://www.npmjs.com/policies/conduct). + +Enforcement of those guidelines after violations overlapping with the above are the responsibility of the entities, and enforcement may happen in any or all of the services/communities. + +## Maintainer Enforcement Process + +Once the maintainers get involved, they will follow a documented series of steps and do their best to preserve the well-being of project members. This section covers actual concrete steps. + +### Contacting Maintainers + +You may get in touch with the maintainer team through any of the following methods: + + * Through email: + * [kzm@zkat.tech](mailto:kzm@zkat.tech) (Kat Marchán) + + * Through Twitter: + * [@maybekatz](https://twitter.com/maybekatz) (Kat Marchán) + +### Further Enforcement + +If you've already followed the [initial enforcement steps](#enforcement), these are the steps maintainers will take for further enforcement, as needed: + + 1. Repeat the request to stop. + 2. If the person doubles down, they will have offending messages removed or edited by a maintainers given an official warning. The PR or Issue may be locked. + 3. If the behavior continues or is repeated later, the person will be blocked from participating for 24 hours. + 4. If the behavior continues or is repeated after the temporary block, a long-term (6-12mo) ban will be used. + +On top of this, maintainers may remove any offending messages, images, contributions, etc, as they deem necessary. + +Maintainers reserve full rights to skip any of these steps, at their discretion, if the violation is considered to be a serious and/or immediate threat to the health and well-being of members of the community. These include any threats, serious physical or verbal attacks, and other such behavior that would be completely unacceptable in any social setting that puts our members at risk. + +Members expelled from events or venues with any sort of paid attendance will not be refunded. + +### Who Watches the Watchers? + +Maintainers and other leaders who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. These may include anything from removal from the maintainer team to a permanent ban from the community. + +Additionally, as a project hosted on both GitHub and npm, [their own Codes of Conducts may be applied against maintainers of this project](#other-community-standards), externally of this project's procedures. + +### Enforcement Examples + +#### The Best Case + +The vast majority of situations work out like this. This interaction is common, and generally positive. + +> Alex: "Yeah I used X and it was really crazy!" + +> Patt (not a maintainer): "Hey, could you not use that word? What about 'ridiculous' instead?" + +> Alex: "oh sorry, sure." -> edits old comment to say "it was really confusing!" + +#### The Maintainer Case + +Sometimes, though, you need to get maintainers involved. Maintainers will do their best to resolve conflicts, but people who were harmed by something **will take priority**. + +> Patt: "Honestly, sometimes I just really hate using $library and anyone who uses it probably sucks at their job." + +> Alex: "Whoa there, could you dial it back a bit? There's a CoC thing about attacking folks' tech use like that." + +> Patt: "I'm not attacking anyone, what's your problem?" + +> Alex: "@maintainers hey uh. Can someone look at this issue? Patt is getting a bit aggro. I tried to nudge them about it, but nope." + +> KeeperOfCommitBits: (on issue) "Hey Patt, maintainer here. Could you tone it down? This sort of attack is really not okay in this space." + +> Patt: "Leave me alone I haven't said anything bad wtf is wrong with you." + +> KeeperOfCommitBits: (deletes user's comment), "@patt I mean it. Please refer to the CoC over at (URL to this CoC) if you have questions, but you can consider this an actual warning. I'd appreciate it if you reworded your messages in this thread, since they made folks there uncomfortable. Let's try and be kind, yeah?" + +> Patt: "@keeperofbits Okay sorry. I'm just frustrated and I'm kinda burnt out and I guess I got carried away. I'll DM Alex a note apologizing and edit my messages. Sorry for the trouble." + +> KeeperOfCommitBits: "@patt Thanks for that. I hear you on the stress. Burnout sucks :/. Have a good one!" + +#### The Nope Case + +> PepeTheFrog🐸: "Hi, I am a literal actual nazi and I think white supremacists are quite fashionable." + +> Patt: "NOOOOPE. OH NOPE NOPE." + +> Alex: "JFC NO. NOPE. @keeperofbits NOPE NOPE LOOK HERE" + +> KeeperOfCommitBits: "👀 Nope. NOPE NOPE NOPE. 🔥" + +> PepeTheFrog🐸 has been banned from all organization or user repositories belonging to KeeperOfCommitBits. + +## Attribution + +This Code of Conduct was generated using [WeAllJS Code of Conduct Generator](https://npm.im/weallbehave), which is based on the [WeAllJS Code of +Conduct](https://wealljs.org/code-of-conduct), which is itself based on +[Contributor Covenant](http://contributor-covenant.org), version 1.4, available +at +[http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4), +and the LGBTQ in Technology Slack [Code of +Conduct](http://lgbtq.technology/coc.html). diff --git a/deps/npm/node_modules/libnpmpublish/CONTRIBUTING.md b/deps/npm/node_modules/libnpmpublish/CONTRIBUTING.md new file mode 100644 index 00000000000000..780044ffcc0f36 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/CONTRIBUTING.md @@ -0,0 +1,256 @@ +# Contributing + +## How do I... + +* [Use This Guide](#introduction)? +* Ask or Say Something? 🤔🐛😱 + * [Request Support](#request-support) + * [Report an Error or Bug](#report-an-error-or-bug) + * [Request a Feature](#request-a-feature) +* Make Something? 🤓👩🏽‍💻📜🍳 + * [Project Setup](#project-setup) + * [Contribute Documentation](#contribute-documentation) + * [Contribute Code](#contribute-code) +* Manage Something ✅🙆🏼💃👔 + * [Provide Support on Issues](#provide-support-on-issues) + * [Label Issues](#label-issues) + * [Clean Up Issues and PRs](#clean-up-issues-and-prs) + * [Review Pull Requests](#review-pull-requests) + * [Merge Pull Requests](#merge-pull-requests) + * [Tag a Release](#tag-a-release) + * [Join the Project Team](#join-the-project-team) +* Add a Guide Like This One [To My Project](#attribution)? 🤖😻👻 + +## Introduction + +Thank you so much for your interest in contributing!. All types of contributions are encouraged and valued. See the [table of contents](#toc) for different ways to help and details about how this project handles them!📝 + +Please make sure to read the relevant section before making your contribution! It will make it a lot easier for us maintainers to make the most of it and smooth out the experience for all involved. 💚 + +The [Project Team](#join-the-project-team) looks forward to your contributions. 🙌🏾✨ + +## Request Support + +If you have a question about this project, how to use it, or just need clarification about something: + +* Open an Issue at https://github.com/npm/libnpmpublish/issues +* Provide as much context as you can about what you're running into. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* Someone will try to have a response soon. +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. + +## Report an Error or Bug + +If you run into an error or bug with the project: + +* Open an Issue at https://github.com/npm/libnpmpublish/issues +* Include *reproduction steps* that someone else can follow to recreate the bug or error on their own. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* A team member will try to reproduce the issue with your provided steps. If there are no repro steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +* If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#contribute-code). +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. +* `critical` issues may be left open, depending on perceived immediacy and severity, even past the 30 day deadline. + +## Request a Feature + +If the project doesn't do something you need or want it to do: + +* Open an Issue at https://github.com/npm/libnpmpublish/issues +* Provide as much context as you can about what you're running into. +* Please try and be clear about why existing features and alternatives would not work for you. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* The project team will evaluate the feature request, possibly asking you more questions to understand its purpose and any relevant requirements. If the issue is closed, the team will convey their reasoning and suggest an alternative path forward. +* If the feature request is accepted, it will be marked for implementation with `feature-accepted`, which can then be done by either by a core team member or by anyone in the community who wants to [contribute code](#contribute-code). + +Note: The team is unlikely to be able to accept every single feature request that is filed. Please understand if they need to say no. + +## Project Setup + +So you wanna contribute some code! That's great! This project uses GitHub Pull Requests to manage contributions, so [read up on how to fork a GitHub project and file a PR](https://guides.github.com/activities/forking) if you've never done it before. + +If this seems like a lot or you aren't able to do all this setup, you might also be able to [edit the files directly](https://help.github.com/articles/editing-files-in-another-user-s-repository/) without having to do any of this setup. Yes, [even code](#contribute-code). + +If you want to go the usual route and run the project locally, though: + +* [Install Node.js](https://nodejs.org/en/download/) +* [Fork the project](https://guides.github.com/activities/forking/#fork) + +Then in your terminal: +* `cd path/to/your/clone` +* `npm install` +* `npm test` + +And you should be ready to go! + +## Contribute Documentation + +Documentation is a super important, critical part of this project. Docs are how we keep track of what we're doing, how, and why. It's how we stay on the same page about our policies. And it's how we tell others everything they need in order to be able to use this project -- or contribute to it. So thank you in advance. + +Documentation contributions of any size are welcome! Feel free to file a PR even if you're just rewording a sentence to be more clear, or fixing a spelling mistake! + +To contribute documentation: + +* [Set up the project](#project-setup). +* Edit or add any relevant documentation. +* Make sure your changes are formatted correctly and consistently with the rest of the documentation. +* Re-read what you wrote, and run a spellchecker on it to make sure you didn't miss anything. +* In your commit message(s), begin the first line with `docs: `. For example: `docs: Adding a doc contrib section to CONTRIBUTING.md`. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). Documentation commits should use `docs(): `. +* Go to https://github.com/npm/libnpmpublish/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Contribute Code + +We like code commits a lot! They're super handy, and they keep the project going and doing the work it needs to do to be useful to others. + +Code contributions of just about any size are acceptable! + +The main difference between code contributions and documentation contributions is that contributing code requires inclusion of relevant tests for the code being added or changed. Contributions without accompanying tests will be held off until a test is added, unless the maintainers consider the specific tests to be either impossible, or way too much of a burden for such a contribution. + +To contribute code: + +* [Set up the project](#project-setup). +* Make any necessary changes to the source code. +* Include any [additional documentation](#contribute-documentation) the changes might need. +* Write tests that verify that your contribution works as expected. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). +* Dependency updates, additions, or removals must be in individual commits, and the message must use the format: `(deps): PKG@VERSION`, where `` is any of the usual `conventional-changelog` prefixes, at your discretion. +* Go to https://github.com/npm/libnpmpublish/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* Barring special circumstances, maintainers will not review PRs until all checks pass (Travis, AppVeyor, etc). +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. Additional tags (such as `needs-tests`) will be added depending on the review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Provide Support on Issues + +[Needs Collaborator](#join-the-project-team): none + +Helping out other users with their questions is a really awesome way of contributing to any community. It's not uncommon for most of the issues on an open source projects being support-related questions by users trying to understand something they ran into, or find their way around a known bug. + +Sometimes, the `support` label will be added to things that turn out to actually be other things, like bugs or feature requests. In that case, suss out the details with the person who filed the original issue, add a comment explaining what the bug is, and change the label from `support` to `bug` or `feature`. If you can't do this yourself, @mention a maintainer so they can do it. + +In order to help other folks out with their questions: + +* Go to the issue tracker and [filter open issues by the `support` label](https://github.com/npm/libnpmpublish/issues?q=is%3Aopen+is%3Aissue+label%3Asupport). +* Read through the list until you find something that you're familiar enough with to give an answer to. +* Respond to the issue with whatever details are needed to clarify the question, or get more details about what's going on. +* Once the discussion wraps up and things are clarified, either close the issue, or ask the original issue filer (or a maintainer) to close it for you. + +Some notes on picking up support issues: + +* Avoid responding to issues you don't know you can answer accurately. +* As much as possible, try to refer to past issues with accepted answers. Link to them from your replies with the `#123` format. +* Be kind and patient with users -- often, folks who have run into confusing things might be upset or impatient. This is ok. Try to understand where they're coming from, and if you're too uncomfortable with the tone, feel free to stay away or withdraw from the issue. (note: if the user is outright hostile or is violating the CoC, [refer to the Code of Conduct](CODE_OF_CONDUCT.md) to resolve the conflict). + +## Label Issues + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +One of the most important tasks in handling issues is labeling them usefully and accurately. All other tasks involving issues ultimately rely on the issue being classified in such a way that relevant parties looking to do their own tasks can find them quickly and easily. + +In order to label issues, [open up the list of unlabeled issues](https://github.com/npm/libnpmpublish/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and, **from newest to oldest**, read through each one and apply issue labels according to the table below. If you're unsure about what label to apply, skip the issue and try the next one: don't feel obligated to label each and every issue yourself! + +Label | Apply When | Notes +--- | --- | --- +`bug` | Cases where the code (or documentation) is behaving in a way it wasn't intended to. | If something is happening that surprises the *user* but does not go against the way the code is designed, it should use the `enhancement` label. +`critical` | Added to `bug` issues if the problem described makes the code completely unusable in a common situation. | +`documentation` | Added to issues or pull requests that affect any of the documentation for the project. | Can be combined with other labels, such as `bug` or `enhancement`. +`duplicate` | Added to issues or PRs that refer to the exact same issue as another one that's been previously labeled. | Duplicate issues should be marked and closed right away, with a message referencing the issue it's a duplicate of (with `#123`) +`enhancement` | Added to [feature requests](#request-a-feature), PRs, or documentation issues that are purely additive: the code or docs currently work as expected, but a change is being requested or suggested. | +`help wanted` | Applied by [Committers](#join-the-project-team) to issues and PRs that they would like to get outside help for. Generally, this means it's lower priority for the maintainer team to itself implement, but that the community is encouraged to pick up if they so desire | Never applied on first-pass labeling. +`in-progress` | Applied by [Committers](#join-the-project-team) to PRs that are pending some work before they're ready for review. | The original PR submitter should @mention the team member that applied the label once the PR is complete. +`performance` | This issue or PR is directly related to improving performance. | +`refactor` | Added to issues or PRs that deal with cleaning up or modifying the project for the betterment of it. | +`starter` | Applied by [Committers](#join-the-project-team) to issues that they consider good introductions to the project for people who have not contributed before. These are not necessarily "easy", but rather focused around how much context is necessary in order to understand what needs to be done for this project in particular. | Existing project members are expected to stay away from these unless they increase in priority. +`support` | This issue is either asking a question about how to use the project, clarifying the reason for unexpected behavior, or possibly reporting a `bug` but does not have enough detail yet to determine whether it would count as such. | The label should be switched to `bug` if reliable reproduction steps are provided. Issues primarily with unintended configurations of a user's environment are not considered bugs, even if they cause crashes. +`tests` | This issue or PR either requests or adds primarily tests to the project. | If a PR is pending tests, that will be handled through the [PR review process](#review-pull-requests) +`wontfix` | Labelers may apply this label to issues that clearly have nothing at all to do with the project or are otherwise entirely outside of its scope/sphere of influence. [Committers](#join-the-project-team) may apply this label and close an issue or PR if they decide to pass on an otherwise relevant issue. | The issue or PR should be closed as soon as the label is applied, and a clear explanation provided of why the label was used. Contributors are free to contest the labeling, but the decision ultimately falls on committers as to whether to accept something or not. + +## Clean Up Issues and PRs + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +Issues and PRs can go stale after a while. Maybe they're abandoned. Maybe the team will just plain not have time to address them any time soon. + +In these cases, they should be closed until they're brought up again or the interaction starts over. + +To clean up issues and PRs: + +* Search the issue tracker for issues or PRs, and add the term `updated:<=YYYY-MM-DD`, where the date is 30 days before today. +* Go through each issue *from oldest to newest*, and close them if **all of the following are true**: + * not opened by a maintainer + * not marked as `critical` + * not marked as `starter` or `help wanted` (these might stick around for a while, in general, as they're intended to be available) + * no explicit messages in the comments asking for it to be left open + * does not belong to a milestone +* Leave a message when closing saying "Cleaning up stale issue. Please reopen or ping us if and when you're ready to resume this. See https://github.com/npm/libnpmpublish/blob/latest/CONTRIBUTING.md#clean-up-issues-and-prs for more details." + +## Review Pull Requests + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +While anyone can comment on a PR, add feedback, etc, PRs are only *approved* by team members with Issue Tracker or higher permissions. + +PR reviews use [GitHub's own review feature](https://help.github.com/articles/about-pull-request-reviews/), which manages comments, approval, and review iteration. + +Some notes: + +* You may ask for minor changes ("nitpicks"), but consider whether they are really blockers to merging: try to err on the side of "approve, with comments". +* *ALL PULL REQUESTS* should be covered by a test: either by a previously-failing test, an existing test that covers the entire functionality of the submitted code, or new tests to verify any new/changed behavior. All tests must also pass and follow established conventions. Test coverage should not drop, unless the specific case is considered reasonable by maintainers. +* Please make sure you're familiar with the code or documentation being updated, unless it's a minor change (spellchecking, minor formatting, etc). You may @mention another project member who you think is better suited for the review, but still provide a non-approving review of your own. +* Be extra kind: people who submit code/doc contributions are putting themselves in a pretty vulnerable position, and have put time and care into what they've done (even if that's not obvious to you!) -- always respond with respect, be understanding, but don't feel like you need to sacrifice your standards for their sake, either. Just don't be a jerk about it? + +## Merge Pull Requests + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. + +## Tag A Release + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. The most important bit here is probably that all tests must pass, and tags must use [semver](https://semver.org). + +## Join the Project Team + +### Ways to Join + +There are many ways to contribute! Most of them don't require any official status unless otherwise noted. That said, there's a couple of positions that grant special repository abilities, and this section describes how they're granted and what they do. + +All of the below positions are granted based on the project team's needs, as well as their consensus opinion about whether they would like to work with the person and think that they would fit well into that position. The process is relatively informal, and it's likely that people who express interest in participating can just be granted the permissions they'd like. + +You can spot a collaborator on the repo by looking for the `[Collaborator]` or `[Owner]` tags next to their names. + +Permission | Description +--- | --- +Issue Tracker | Granted to contributors who express a strong interest in spending time on the project's issue tracker. These tasks are mainly [labeling issues](#label-issues), [cleaning up old ones](#clean-up-issues-and-prs), and [reviewing pull requests](#review-pull-requests), as well as all the usual things non-team-member contributors can do. Issue handlers should not merge pull requests, tag releases, or directly commit code themselves: that should still be done through the usual pull request process. Becoming an Issue Handler means the project team trusts you to understand enough of the team's process and context to implement it on the issue tracker. +Committer | Granted to contributors who want to handle the actual pull request merges, tagging new versions, etc. Committers should have a good level of familiarity with the codebase, and enough context to understand the implications of various changes, as well as a good sense of the will and expectations of the project team. +Admin/Owner | Granted to people ultimately responsible for the project, its community, etc. + +## Attribution + +This guide was generated using the WeAllJS `CONTRIBUTING.md` generator. [Make your own](https://npm.im/weallcontribute)! diff --git a/deps/npm/node_modules/libnpmpublish/LICENSE b/deps/npm/node_modules/libnpmpublish/LICENSE new file mode 100644 index 00000000000000..209e4477f39c1a --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +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/libnpmpublish/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmpublish/PULL_REQUEST_TEMPLATE new file mode 100644 index 00000000000000..9471c6d325f7eb --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/PULL_REQUEST_TEMPLATE @@ -0,0 +1,7 @@ + diff --git a/deps/npm/node_modules/libnpmpublish/README.md b/deps/npm/node_modules/libnpmpublish/README.md new file mode 100644 index 00000000000000..1511b7c14e9267 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/README.md @@ -0,0 +1,111 @@ +# libnpmpublish [![npm version](https://img.shields.io/npm/v/libnpmpublish.svg)](https://npm.im/libnpmpublish) [![license](https://img.shields.io/npm/l/libnpmpublish.svg)](https://npm.im/libnpmpublish) [![Travis](https://img.shields.io/travis/npm/libnpmpublish.svg)](https://travis-ci.org/npm/libnpmpublish) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmpublish?svg=true)](https://ci.appveyor.com/project/zkat/libnpmpublish) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmpublish/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmpublish?branch=latest) + +[`libnpmpublish`](https://github.com/npm/libnpmpublish) is a Node.js library for +programmatically publishing and unpublishing npm packages. It does not take care +of packing tarballs from source code, but once you have a tarball, it can take +care of putting it up on a nice registry for you. + +## Example + +```js +const { publish, unpublish } = require('libnpmpublish') + +``` + +## Install + +`$ npm install libnpmpublish` + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [API](#api) + * [publish/unpublish opts](#opts) + * [`publish()`](#publish) + * [`unpublish()`](#unpublish) + +### API + +#### `opts` for `libnpmpublish` commands + +`libnpmpublish` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). +Most options are passed through directly to that library, so please refer to +[its own `opts` +documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) +for options that can be passed in. + +A couple of options of note for those in a hurry: + +* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. +* `opts.Promise` - If you pass this in, the Promises returned by `libnpmpublish` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` + +#### `> libpub.publish(pkgJson, tarData, [opts]) -> Promise` + +Publishes `tarData` to the appropriate configured registry. `pkgJson` should be +the parsed `package.json` for the package that is being published. + +`tarData` can be a Buffer, a base64-encoded string, or a binary stream of data. +Note that publishing itself can't be streamed, so the entire stream will be +consumed into RAM before publishing (and are thus limited in how big they can +be). + +Since `libnpmpublish` does not generate tarballs itself, one way to build your +own tarball for publishing is to do `npm pack` in the directory you wish to +pack. You can then `fs.createReadStream('my-proj-1.0.0.tgz')` and pass that to +`libnpmpublish`, along with `require('./package.json')`. + +`publish()` does its best to emulate legacy publish logic in the standard npm +client, and so should generally be compatible with any registry the npm CLI has +been able to publish to in the past. + +If `opts.npmVersion` is passed in, it will be used as the `_npmVersion` field in +the outgoing packument. It's recommended you add your own user agent string in +there! + +If `opts.algorithms` is passed in, it should be an array of hashing algorithms +to generate `integrity` hashes for. The default is `['sha512']`, which means you +end up with `dist.integrity = 'sha512-deadbeefbadc0ffee'`. Any algorithm +supported by your current node version is allowed -- npm clients that do not +support those algorithms will simply ignore the unsupported hashes. + +If `opts.access` is passed in, it must be one of `public` or `restricted`. +Unscoped packages cannot be `restricted`, and the registry may agree or disagree +with whether you're allowed to publish a restricted package. + +##### Example + +```javascript +const pkg = require('./dist/package.json') +const tarball = fs.createReadStream('./dist/pkg-1.0.1.tgz') +await libpub.publish(pkg, tarball, { + npmVersion: 'my-pub-script@1.0.2', + token: 'my-auth-token-here' +}) +// Package has been published to the npm registry. +``` + +#### `> libpub.unpublish(spec, [opts]) -> Promise` + +Unpublishes `spec` from the appropriate registry. The registry in question may +have its own limitations on unpublishing. + +`spec` should be either a string, or a valid +[`npm-package-arg`](https://npm.im/npm-package-arg) parsed spec object. For +legacy compatibility reasons, only `tag` and `version` specs will work as +expected. `range` specs will fail silently in most cases. + +##### Example + +```javascript +await libpub.unpublish('lodash', { token: 'i-am-the-worst'}) +// +// `lodash` has now been unpublished, along with all its versions, and the world +// devolves into utter chaos. +// +// That, or we all go home to our friends and/or family and have a nice time +// doing nothing having to do with programming or JavaScript and realize our +// lives are just so much happier now, and we just can't understand why we ever +// got so into this JavaScript thing but damn did it pay well. I guess you'll +// settle for gardening or something. +``` diff --git a/deps/npm/node_modules/libnpmpublish/appveyor.yml b/deps/npm/node_modules/libnpmpublish/appveyor.yml new file mode 100644 index 00000000000000..9cc64c58e02f96 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/appveyor.yml @@ -0,0 +1,22 @@ +environment: + matrix: + - nodejs_version: "10" + - nodejs_version: "9" + - nodejs_version: "8" + - nodejs_version: "6" + +platform: + - x64 + +install: + - ps: Install-Product node $env:nodejs_version $env:platform + - npm config set spin false + - npm install + +test_script: + - npm test + +matrix: + fast_finish: true + +build: off diff --git a/deps/npm/node_modules/libnpmpublish/index.js b/deps/npm/node_modules/libnpmpublish/index.js new file mode 100644 index 00000000000000..38de9ece14e4e9 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/index.js @@ -0,0 +1,4 @@ +module.exports = { + publish: require('./publish.js'), + unpublish: require('./unpublish.js') +} diff --git a/deps/npm/node_modules/libnpmpublish/package.json b/deps/npm/node_modules/libnpmpublish/package.json new file mode 100644 index 00000000000000..4df1f0011dd13b --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/package.json @@ -0,0 +1,73 @@ +{ + "_from": "libnpmpublish@^1.1.0", + "_id": "libnpmpublish@1.1.1", + "_inBundle": false, + "_integrity": "sha512-nefbvJd/wY38zdt+b9SHL6171vqBrMtZ56Gsgfd0duEKb/pB8rDT4/ObUQLrHz1tOfht1flt2zM+UGaemzAG5g==", + "_location": "/libnpmpublish", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "libnpmpublish@^1.1.0", + "name": "libnpmpublish", + "escapedName": "libnpmpublish", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/libnpm" + ], + "_resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-1.1.1.tgz", + "_shasum": "ff0c6bb0b4ad2bda2ad1f5fba6760a4af37125f0", + "_spec": "libnpmpublish@^1.1.0", + "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpm", + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech" + }, + "bugs": { + "url": "https://github.com/npm/libnpmpublish/issues" + }, + "bundleDependencies": false, + "dependencies": { + "aproba": "^2.0.0", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.0.0", + "lodash.clonedeep": "^4.5.0", + "normalize-package-data": "^2.4.0", + "npm-package-arg": "^6.1.0", + "npm-registry-fetch": "^3.8.0", + "semver": "^5.5.1", + "ssri": "^6.0.1" + }, + "deprecated": false, + "description": "Programmatic API for the bits behind npm publish and unpublish", + "devDependencies": { + "bluebird": "^3.5.1", + "nock": "^9.6.1", + "standard": "*", + "standard-version": "*", + "tap": "*", + "tar-stream": "^1.6.1", + "weallbehave": "*", + "weallcontribute": "*" + }, + "homepage": "https://npmjs.com/package/libnpmpublish", + "license": "ISC", + "name": "libnpmpublish", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/libnpmpublish.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --100 test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/libnpmpublish/publish.js b/deps/npm/node_modules/libnpmpublish/publish.js new file mode 100644 index 00000000000000..de5af4f5d3d6b2 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/publish.js @@ -0,0 +1,218 @@ +'use strict' + +const cloneDeep = require('lodash.clonedeep') +const figgyPudding = require('figgy-pudding') +const { fixer } = require('normalize-package-data') +const getStream = require('get-stream') +const npa = require('npm-package-arg') +const npmAuth = require('npm-registry-fetch/auth.js') +const npmFetch = require('npm-registry-fetch') +const semver = require('semver') +const ssri = require('ssri') +const url = require('url') +const validate = require('aproba') + +const PublishConfig = figgyPudding({ + access: {}, + algorithms: { default: ['sha512'] }, + npmVersion: {}, + tag: { default: 'latest' }, + Promise: { default: () => Promise } +}) + +module.exports = publish +function publish (manifest, tarball, opts) { + opts = PublishConfig(opts) + return new opts.Promise(resolve => resolve()).then(() => { + validate('OSO|OOO', [manifest, tarball, opts]) + if (manifest.private) { + throw Object.assign(new Error( + 'This package has been marked as private\n' + + "Remove the 'private' field from the package.json to publish it." + ), { code: 'EPRIVATE' }) + } + const spec = npa.resolve(manifest.name, manifest.version) + // NOTE: spec is used to pick the appropriate registry/auth combo. + opts = opts.concat(manifest.publishConfig, { spec }) + const reg = npmFetch.pickRegistry(spec, opts) + const auth = npmAuth(reg, opts) + const pubManifest = patchedManifest(spec, auth, manifest, opts) + + // registry-frontdoor cares about the access level, which is only + // configurable for scoped packages + if (!spec.scope && opts.access === 'restricted') { + throw Object.assign( + new Error("Can't restrict access to unscoped packages."), + { code: 'EUNSCOPED' } + ) + } + + return slurpTarball(tarball, opts).then(tardata => { + const metadata = buildMetadata( + spec, auth, reg, pubManifest, tardata, opts + ) + return npmFetch(spec.escapedName, opts.concat({ + method: 'PUT', + body: metadata, + ignoreBody: true + })).catch(err => { + if (err.code !== 'E409') { throw err } + return npmFetch.json(spec.escapedName, opts.concat({ + query: { write: true } + })).then( + current => patchMetadata(current, metadata, opts) + ).then(newMetadata => { + return npmFetch(spec.escapedName, opts.concat({ + method: 'PUT', + body: newMetadata, + ignoreBody: true + })) + }) + }) + }) + }).then(() => true) +} + +function patchedManifest (spec, auth, base, opts) { + const manifest = cloneDeep(base) + manifest._nodeVersion = process.versions.node + if (opts.npmVersion) { + manifest._npmVersion = opts.npmVersion + } + if (auth.username || auth.email) { + // NOTE: This is basically pointless, but reproduced because it's what + // legacy does: tl;dr `auth.username` and `auth.email` are going to be + // undefined in any auth situation that uses tokens instead of plain + // auth. I can only assume some registries out there decided that + // _npmUser would be of any use to them, but _npmUser in packuments + // currently gets filled in by the npm registry itself, based on auth + // information. + manifest._npmUser = { + name: auth.username, + email: auth.email + } + } + + fixer.fixNameField(manifest, { strict: true, allowLegacyCase: true }) + const version = semver.clean(manifest.version) + if (!version) { + throw Object.assign( + new Error('invalid semver: ' + manifest.version), + { code: 'EBADSEMVER' } + ) + } + manifest.version = version + return manifest +} + +function buildMetadata (spec, auth, registry, manifest, tardata, opts) { + const root = { + _id: manifest.name, + name: manifest.name, + description: manifest.description, + 'dist-tags': {}, + versions: {}, + readme: manifest.readme || '' + } + + if (opts.access) root.access = opts.access + + if (!auth.token) { + root.maintainers = [{ name: auth.username, email: auth.email }] + manifest.maintainers = JSON.parse(JSON.stringify(root.maintainers)) + } + + root.versions[ manifest.version ] = manifest + const tag = manifest.tag || opts.tag + root['dist-tags'][tag] = manifest.version + + const tbName = manifest.name + '-' + manifest.version + '.tgz' + const tbURI = manifest.name + '/-/' + tbName + const integrity = ssri.fromData(tardata, { + algorithms: [...new Set(['sha1'].concat(opts.algorithms))] + }) + + manifest._id = manifest.name + '@' + manifest.version + manifest.dist = manifest.dist || {} + // Don't bother having sha1 in the actual integrity field + manifest.dist.integrity = integrity['sha512'][0].toString() + // Legacy shasum support + manifest.dist.shasum = integrity['sha1'][0].hexDigest() + manifest.dist.tarball = url.resolve(registry, tbURI) + .replace(/^https:\/\//, 'http://') + + root._attachments = {} + root._attachments[ tbName ] = { + 'content_type': 'application/octet-stream', + 'data': tardata.toString('base64'), + 'length': tardata.length + } + + return root +} + +function patchMetadata (current, newData, opts) { + const curVers = Object.keys(current.versions || {}).map(v => { + return semver.clean(v, true) + }).concat(Object.keys(current.time || {}).map(v => { + if (semver.valid(v, true)) { return semver.clean(v, true) } + })).filter(v => v) + + const newVersion = Object.keys(newData.versions)[0] + + if (curVers.indexOf(newVersion) !== -1) { + throw ConflictError(newData.name, newData.version) + } + + current.versions = current.versions || {} + current.versions[newVersion] = newData.versions[newVersion] + for (var i in newData) { + switch (i) { + // objects that copy over the new stuffs + case 'dist-tags': + case 'versions': + case '_attachments': + for (var j in newData[i]) { + current[i] = current[i] || {} + current[i][j] = newData[i][j] + } + break + + // ignore these + case 'maintainers': + break + + // copy + default: + current[i] = newData[i] + } + } + const maint = newData.maintainers && JSON.parse(JSON.stringify(newData.maintainers)) + newData.versions[newVersion].maintainers = maint + return current +} + +function slurpTarball (tarSrc, opts) { + if (Buffer.isBuffer(tarSrc)) { + return opts.Promise.resolve(tarSrc) + } else if (typeof tarSrc === 'string') { + return opts.Promise.resolve(Buffer.from(tarSrc, 'base64')) + } else if (typeof tarSrc.pipe === 'function') { + return getStream.buffer(tarSrc) + } else { + return opts.Promise.reject(Object.assign( + new Error('invalid tarball argument. Must be a Buffer, a base64 string, or a binary stream'), { + code: 'EBADTAR' + })) + } +} + +function ConflictError (pkgid, version) { + return Object.assign(new Error( + `Cannot publish ${pkgid}@${version} over existing version.` + ), { + code: 'EPUBLISHCONFLICT', + pkgid, + version + }) +} diff --git a/deps/npm/node_modules/libnpmpublish/test/publish.js b/deps/npm/node_modules/libnpmpublish/test/publish.js new file mode 100644 index 00000000000000..65b8c82524dd2d --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/test/publish.js @@ -0,0 +1,919 @@ +'use strict' + +const crypto = require('crypto') +const cloneDeep = require('lodash.clonedeep') +const figgyPudding = require('figgy-pudding') +const mockTar = require('./util/mock-tarball.js') +const { PassThrough } = require('stream') +const ssri = require('ssri') +const { test } = require('tap') +const tnock = require('./util/tnock.js') + +const publish = require('../publish.js') + +const OPTS = figgyPudding({ registry: {} })({ + registry: 'https://mock.reg/' +}) + +const REG = OPTS.registry + +test('basic publish', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const packument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + _id: 'libnpmpublish', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + } + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.deepEqual(body, packument, 'posted packument matches expectations') + return true + }, { + authorization: 'Bearer deadbeef' + }).reply(201, {}) + + return publish(manifest, tarData, OPTS.concat({ + token: 'deadbeef' + })).then(ret => { + t.ok(ret, 'publish succeeded') + }) + }) +}) + +test('scoped publish', t => { + const manifest = { + name: '@zkat/libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const packument = { + name: '@zkat/libnpmpublish', + description: 'some stuff', + readme: '', + _id: '@zkat/libnpmpublish', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + _id: '@zkat/libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + _npmVersion: '6.9.0', + name: '@zkat/libnpmpublish', + version: '1.0.0', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/@zkat/libnpmpublish/-/@zkat/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + '@zkat/libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + } + const srv = tnock(t, REG) + srv.put('/@zkat%2flibnpmpublish', body => { + t.deepEqual(body, packument, 'posted packument matches expectations') + return true + }, { + authorization: 'Bearer deadbeef' + }).reply(201, {}) + + return publish(manifest, tarData, OPTS.concat({ + npmVersion: '6.9.0', + token: 'deadbeef' + })).then(() => { + t.ok(true, 'publish succeeded') + }) + }) +}) + +test('retry after a conflict', t => { + const REV = '72-47f2986bfd8e8b55068b204588bbf484' + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const basePackument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + _id: 'libnpmpublish', + 'dist-tags': {}, + versions: {}, + _attachments: {} + } + const currentPackument = cloneDeep(Object.assign({}, basePackument, { + time: { + modified: new Date().toISOString(), + created: new Date().toISOString(), + '1.0.1': new Date().toISOString() + }, + 'dist-tags': { latest: '1.0.1' }, + maintainers: [{ name: 'zkat', email: 'idk@idk.tech' }], + versions: { + '1.0.1': { + _id: 'libnpmpublish@1.0.1', + _nodeVersion: process.versions.node, + _npmVersion: '6.9.0', + name: 'libnpmpublish', + version: '1.0.1', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.1.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.1.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + })) + const newPackument = cloneDeep(Object.assign({}, basePackument, { + 'dist-tags': { latest: '1.0.0' }, + maintainers: [{ name: 'other', email: 'other@idk.tech' }], + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + _npmVersion: '6.9.0', + _npmUser: { + name: 'other', + email: 'other@idk.tech' + }, + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + maintainers: [{ name: 'other', email: 'other@idk.tech' }], + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + })) + const mergedPackument = cloneDeep(Object.assign({}, basePackument, { + time: currentPackument.time, + 'dist-tags': { latest: '1.0.0' }, + maintainers: currentPackument.maintainers, + versions: Object.assign({}, currentPackument.versions, newPackument.versions), + _attachments: Object.assign({}, currentPackument._attachments, newPackument._attachments) + })) + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.notOk(body._rev, 'no _rev in initial post') + t.deepEqual(body, newPackument, 'got conflicting packument') + return true + }).reply(409, { error: 'gimme _rev plz' }) + srv.get('/libnpmpublish?write=true').reply(200, Object.assign({ + _rev: REV + }, currentPackument)) + srv.put('/libnpmpublish', body => { + t.deepEqual(body, Object.assign({ + _rev: REV + }, mergedPackument), 'posted packument includes _rev and a merged version') + return true + }).reply(201, {}) + return publish(manifest, tarData, OPTS.concat({ + npmVersion: '6.9.0', + username: 'other', + email: 'other@idk.tech' + })).then(() => { + t.ok(true, 'publish succeeded') + }) + }) +}) + +test('retry after a conflict -- no versions on remote', t => { + const REV = '72-47f2986bfd8e8b55068b204588bbf484' + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const basePackument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + _id: 'libnpmpublish' + } + const currentPackument = cloneDeep(Object.assign({}, basePackument, { + maintainers: [{ name: 'zkat', email: 'idk@idk.tech' }] + })) + const newPackument = cloneDeep(Object.assign({}, basePackument, { + 'dist-tags': { latest: '1.0.0' }, + maintainers: [{ name: 'other', email: 'other@idk.tech' }], + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + _npmVersion: '6.9.0', + _npmUser: { + name: 'other', + email: 'other@idk.tech' + }, + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + maintainers: [{ name: 'other', email: 'other@idk.tech' }], + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + })) + const mergedPackument = cloneDeep(Object.assign({}, basePackument, { + 'dist-tags': { latest: '1.0.0' }, + maintainers: currentPackument.maintainers, + versions: Object.assign({}, currentPackument.versions, newPackument.versions), + _attachments: Object.assign({}, currentPackument._attachments, newPackument._attachments) + })) + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.notOk(body._rev, 'no _rev in initial post') + t.deepEqual(body, newPackument, 'got conflicting packument') + return true + }).reply(409, { error: 'gimme _rev plz' }) + srv.get('/libnpmpublish?write=true').reply(200, Object.assign({ + _rev: REV + }, currentPackument)) + srv.put('/libnpmpublish', body => { + t.deepEqual(body, Object.assign({ + _rev: REV + }, mergedPackument), 'posted packument includes _rev and a merged version') + return true + }).reply(201, {}) + return publish(manifest, tarData, OPTS.concat({ + npmVersion: '6.9.0', + username: 'other', + email: 'other@idk.tech' + })).then(() => { + t.ok(true, 'publish succeeded') + }) + }) +}) +test('version conflict', t => { + const REV = '72-47f2986bfd8e8b55068b204588bbf484' + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const basePackument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + _id: 'libnpmpublish', + 'dist-tags': {}, + versions: {}, + _attachments: {} + } + const newPackument = cloneDeep(Object.assign({}, basePackument, { + 'dist-tags': { latest: '1.0.0' }, + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + _npmVersion: '6.9.0', + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + })) + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.notOk(body._rev, 'no _rev in initial post') + t.deepEqual(body, newPackument, 'got conflicting packument') + return true + }).reply(409, { error: 'gimme _rev plz' }) + srv.get('/libnpmpublish?write=true').reply(200, Object.assign({ + _rev: REV + }, newPackument)) + return publish(manifest, tarData, OPTS.concat({ + npmVersion: '6.9.0', + token: 'deadbeef' + })).then( + () => { throw new Error('should not succeed') }, + err => { + t.equal(err.code, 'EPUBLISHCONFLICT', 'got publish conflict code') + } + ) + }) +}) + +test('publish with basic auth', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const packument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + _id: 'libnpmpublish', + 'dist-tags': { + latest: '1.0.0' + }, + maintainers: [{ + name: 'zkat', + email: 'kat@example.tech' + }], + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + _npmVersion: '6.9.0', + _npmUser: { + name: 'zkat', + email: 'kat@example.tech' + }, + maintainers: [{ + name: 'zkat', + email: 'kat@example.tech' + }], + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + } + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.deepEqual(body, packument, 'posted packument matches expectations') + return true + }, { + authorization: /^Basic / + }).reply(201, {}) + + return publish(manifest, tarData, OPTS.concat({ + npmVersion: '6.9.0', + username: 'zkat', + email: 'kat@example.tech' + })).then(() => { + t.ok(true, 'publish succeeded') + }) + }) +}) + +test('publish base64 string', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const packument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + _id: 'libnpmpublish', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + _npmVersion: '6.9.0', + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + } + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.deepEqual(body, packument, 'posted packument matches expectations') + return true + }, { + authorization: 'Bearer deadbeef' + }).reply(201, {}) + + return publish(manifest, tarData.toString('base64'), OPTS.concat({ + npmVersion: '6.9.0', + token: 'deadbeef' + })).then(() => { + t.ok(true, 'publish succeeded') + }) + }) +}) + +test('publish tar stream', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const packument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + _id: 'libnpmpublish', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + _npmVersion: '6.9.0', + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + } + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.deepEqual(body, packument, 'posted packument matches expectations') + return true + }, { + authorization: 'Bearer deadbeef' + }).reply(201, {}) + + const stream = new PassThrough() + setTimeout(() => stream.end(tarData), 0) + return publish(manifest, stream, OPTS.concat({ + npmVersion: '6.9.0', + token: 'deadbeef' + })).then(() => { + t.ok(true, 'publish succeeded') + }) + }) +}) + +test('refuse if package marked private', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + private: true + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + return publish(manifest, tarData, OPTS.concat({ + npmVersion: '6.9.0', + token: 'deadbeef' + })).then( + () => { throw new Error('should not have succeeded') }, + err => { + t.equal(err.code, 'EPRIVATE', 'got correct error code') + } + ) + }) +}) + +test('publish includes access', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const packument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + access: 'public', + _id: 'libnpmpublish', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + } + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.deepEqual(body, packument, 'posted packument matches expectations') + return true + }, { + authorization: 'Bearer deadbeef' + }).reply(201, {}) + + return publish(manifest, tarData, OPTS.concat({ + token: 'deadbeef', + access: 'public' + })).then(() => { + t.ok(true, 'publish succeeded') + }) + }) +}) + +test('refuse if package is unscoped plus `restricted` access', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + return publish(manifest, tarData, OPTS.concat({ + npmVersion: '6.9.0', + access: 'restricted' + })).then( + () => { throw new Error('should not have succeeded') }, + err => { + t.equal(err.code, 'EUNSCOPED', 'got correct error code') + } + ) + }) +}) + +test('refuse if tarball is wrong type', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return publish(manifest, { data: 42 }, OPTS.concat({ + npmVersion: '6.9.0', + token: 'deadbeef' + })).then( + () => { throw new Error('should not have succeeded') }, + err => { + t.equal(err.code, 'EBADTAR', 'got correct error code') + } + ) +}) + +test('refuse if bad semver on manifest', t => { + const manifest = { + name: 'libnpmpublish', + version: 'lmao', + description: 'some stuff' + } + return publish(manifest, 'deadbeef', OPTS).then( + () => { throw new Error('should not have succeeded') }, + err => { + t.equal(err.code, 'EBADSEMVER', 'got correct error code') + } + ) +}) + +test('other error code', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const packument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + _id: 'libnpmpublish', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + _npmVersion: '6.9.0', + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + } + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.deepEqual(body, packument, 'posted packument matches expectations') + return true + }, { + authorization: 'Bearer deadbeef' + }).reply(500, { error: 'go away' }) + + return publish(manifest, tarData, OPTS.concat({ + npmVersion: '6.9.0', + token: 'deadbeef' + })).then( + () => { throw new Error('should not succeed') }, + err => { + t.match(err.message, /go away/, 'no retry on non-409') + } + ) + }) +}) + +test('publish includes access', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff' + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const packument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + access: 'public', + _id: 'libnpmpublish', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + } + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.deepEqual(body, packument, 'posted packument matches expectations') + return true + }, { + authorization: 'Bearer deadbeef' + }).reply(201, {}) + + return publish(manifest, tarData, OPTS.concat({ + token: 'deadbeef', + access: 'public' + })).then(() => { + t.ok(true, 'publish succeeded') + }) + }) +}) + +test('publishConfig on manifest', t => { + const manifest = { + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + publishConfig: { + registry: REG + } + } + return mockTar({ + 'package.json': JSON.stringify(manifest), + 'index.js': 'console.log("hello world")' + }).then(tarData => { + const shasum = crypto.createHash('sha1').update(tarData).digest('hex') + const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) + const packument = { + name: 'libnpmpublish', + description: 'some stuff', + readme: '', + _id: 'libnpmpublish', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + _id: 'libnpmpublish@1.0.0', + _nodeVersion: process.versions.node, + name: 'libnpmpublish', + version: '1.0.0', + description: 'some stuff', + dist: { + shasum, + integrity: integrity.toString(), + tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` + }, + publishConfig: { + registry: REG + } + } + }, + _attachments: { + 'libnpmpublish-1.0.0.tgz': { + 'content_type': 'application/octet-stream', + data: tarData.toString('base64'), + length: tarData.length + } + } + } + const srv = tnock(t, REG) + srv.put('/libnpmpublish', body => { + t.deepEqual(body, packument, 'posted packument matches expectations') + return true + }, { + authorization: 'Bearer deadbeef' + }).reply(201, {}) + + return publish(manifest, tarData, { token: 'deadbeef' }).then(ret => { + t.ok(ret, 'publish succeeded') + }) + }) +}) diff --git a/deps/npm/node_modules/libnpmpublish/test/unpublish.js b/deps/npm/node_modules/libnpmpublish/test/unpublish.js new file mode 100644 index 00000000000000..19ac464a3b7322 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/test/unpublish.js @@ -0,0 +1,249 @@ +'use strict' + +const figgyPudding = require('figgy-pudding') +const test = require('tap').test +const tnock = require('./util/tnock.js') + +const OPTS = figgyPudding({ registry: {} })({ + registry: 'https://mock.reg/' +}) + +const REG = OPTS.registry +const REV = '72-47f2986bfd8e8b55068b204588bbf484' +const unpub = require('../unpublish.js') + +test('basic test', t => { + const doc = { + _id: 'foo', + _rev: REV, + name: 'foo', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: 'foo', + dist: { + tarball: `${REG}/foo/-/foo-1.0.0.tgz` + } + } + } + } + const srv = tnock(t, REG) + srv.get('/foo?write=true').reply(200, doc) + srv.delete(`/foo/-rev/${REV}`).reply(201) + return unpub('foo', OPTS).then(ret => { + t.ok(ret, 'foo was unpublished') + }) +}) + +test('scoped basic test', t => { + const doc = { + _id: '@foo/bar', + _rev: REV, + name: '@foo/bar', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: '@foo/bar', + dist: { + tarball: `${REG}/@foo/bar/-/foo-1.0.0.tgz` + } + } + } + } + const srv = tnock(t, REG) + srv.get('/@foo%2fbar?write=true').reply(200, doc) + srv.delete(`/@foo%2fbar/-rev/${REV}`).reply(201) + return unpub('@foo/bar', OPTS).then(() => { + t.ok(true, 'foo was unpublished') + }) +}) + +test('unpublish specific, last version', t => { + const doc = { + _id: 'foo', + _rev: REV, + name: 'foo', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: 'foo', + dist: { + tarball: `${REG}/foo/-/foo-1.0.0.tgz` + } + } + } + } + const srv = tnock(t, REG) + srv.get('/foo?write=true').reply(200, doc) + srv.delete(`/foo/-rev/${REV}`).reply(201) + return unpub('foo@1.0.0', OPTS).then(() => { + t.ok(true, 'foo was unpublished') + }) +}) + +test('unpublish specific version', t => { + const doc = { + _id: 'foo', + _rev: REV, + _revisions: [1, 2, 3], + _attachments: [1, 2, 3], + name: 'foo', + 'dist-tags': { + latest: '1.0.1' + }, + versions: { + '1.0.0': { + name: 'foo', + dist: { + tarball: `${REG}/foo/-/foo-1.0.0.tgz` + } + }, + '1.0.1': { + name: 'foo', + dist: { + tarball: `${REG}/foo/-/foo-1.0.1.tgz` + } + } + } + } + const postEdit = { + _id: 'foo', + _rev: REV, + name: 'foo', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: 'foo', + dist: { + tarball: `${REG}/foo/-/foo-1.0.0.tgz` + } + } + } + } + + const srv = tnock(t, REG) + srv.get('/foo?write=true').reply(200, doc) + srv.put(`/foo/-rev/${REV}`, postEdit).reply(200) + srv.get('/foo?write=true').reply(200, postEdit) + srv.delete(`/foo/-/foo-1.0.1.tgz/-rev/${REV}`).reply(200) + return unpub('foo@1.0.1', OPTS).then(() => { + t.ok(true, 'foo was unpublished') + }) +}) + +test('404 considered a success', t => { + const srv = tnock(t, REG) + srv.get('/foo?write=true').reply(404) + return unpub('foo', OPTS).then(() => { + t.ok(true, 'foo was unpublished') + }) +}) + +test('non-404 errors', t => { + const srv = tnock(t, REG) + srv.get('/foo?write=true').reply(500) + return unpub('foo', OPTS).then( + () => { throw new Error('should not have succeeded') }, + err => { t.equal(err.code, 'E500', 'got right error from server') } + ) +}) + +test('packument with missing versions unpublishes whole thing', t => { + const doc = { + _id: 'foo', + _rev: REV, + name: 'foo', + 'dist-tags': { + latest: '1.0.0' + } + } + const srv = tnock(t, REG) + srv.get('/foo?write=true').reply(200, doc) + srv.delete(`/foo/-rev/${REV}`).reply(201) + return unpub('foo@1.0.0', OPTS).then(() => { + t.ok(true, 'foo was unpublished') + }) +}) + +test('packument with missing specific version assumed unpublished', t => { + const doc = { + _id: 'foo', + _rev: REV, + name: 'foo', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: 'foo', + dist: { + tarball: `${REG}/foo/-/foo-1.0.0.tgz` + } + } + } + } + const srv = tnock(t, REG) + srv.get('/foo?write=true').reply(200, doc) + return unpub('foo@1.0.1', OPTS).then(() => { + t.ok(true, 'foo was unpublished') + }) +}) + +test('unpublish specific version without dist-tag update', t => { + const doc = { + _id: 'foo', + _rev: REV, + _revisions: [1, 2, 3], + _attachments: [1, 2, 3], + name: 'foo', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: 'foo', + dist: { + tarball: `${REG}/foo/-/foo-1.0.0.tgz` + } + }, + '1.0.1': { + name: 'foo', + dist: { + tarball: `${REG}/foo/-/foo-1.0.1.tgz` + } + } + } + } + const postEdit = { + _id: 'foo', + _rev: REV, + name: 'foo', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: 'foo', + dist: { + tarball: `${REG}/foo/-/foo-1.0.0.tgz` + } + } + } + } + const srv = tnock(t, REG) + srv.get('/foo?write=true').reply(200, doc) + srv.put(`/foo/-rev/${REV}`, postEdit).reply(200) + srv.get('/foo?write=true').reply(200, postEdit) + srv.delete(`/foo/-/foo-1.0.1.tgz/-rev/${REV}`).reply(200) + return unpub('foo@1.0.1', OPTS).then(() => { + t.ok(true, 'foo was unpublished') + }) +}) diff --git a/deps/npm/node_modules/libnpmpublish/test/util/mock-tarball.js b/deps/npm/node_modules/libnpmpublish/test/util/mock-tarball.js new file mode 100644 index 00000000000000..c6253cd218f5b9 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/test/util/mock-tarball.js @@ -0,0 +1,47 @@ +'use strict' + +const BB = require('bluebird') + +const getStream = require('get-stream') +const tar = require('tar-stream') +const zlib = require('zlib') + +module.exports = makeTarball +function makeTarball (files, opts) { + opts = opts || {} + const pack = tar.pack() + Object.keys(files).forEach(function (filename) { + const entry = files[filename] + pack.entry({ + name: (opts.noPrefix ? '' : 'package/') + filename, + type: entry.type, + size: entry.size, + mode: entry.mode, + mtime: entry.mtime || new Date(0), + linkname: entry.linkname, + uid: entry.uid, + gid: entry.gid, + uname: entry.uname, + gname: entry.gname + }, typeof files[filename] === 'string' + ? files[filename] + : files[filename].data) + }) + pack.finalize() + return BB.try(() => { + if (opts.stream && opts.gzip) { + const gz = zlib.createGzip() + pack.on('error', err => gz.emit('error', err)).pipe(gz) + } else if (opts.stream) { + return pack + } else { + return getStream.buffer(pack).then(ret => { + if (opts.gzip) { + return BB.fromNode(cb => zlib.gzip(ret, cb)) + } else { + return ret + } + }) + } + }) +} diff --git a/deps/npm/node_modules/libnpmpublish/test/util/tnock.js b/deps/npm/node_modules/libnpmpublish/test/util/tnock.js new file mode 100644 index 00000000000000..00b6e160e10192 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/test/util/tnock.js @@ -0,0 +1,12 @@ +'use strict' + +const nock = require('nock') + +module.exports = tnock +function tnock (t, host) { + const server = nock(host) + t.tearDown(function () { + server.done() + }) + return server +} diff --git a/deps/npm/node_modules/libnpmpublish/unpublish.js b/deps/npm/node_modules/libnpmpublish/unpublish.js new file mode 100644 index 00000000000000..d7d98243c6b093 --- /dev/null +++ b/deps/npm/node_modules/libnpmpublish/unpublish.js @@ -0,0 +1,86 @@ +'use strict' + +const figgyPudding = require('figgy-pudding') +const npa = require('npm-package-arg') +const npmFetch = require('npm-registry-fetch') +const semver = require('semver') +const url = require('url') + +const UnpublishConfig = figgyPudding({ + force: { default: false }, + Promise: { default: () => Promise } +}) + +module.exports = unpublish +function unpublish (spec, opts) { + opts = UnpublishConfig(opts) + return new opts.Promise(resolve => resolve()).then(() => { + spec = npa(spec) + // NOTE: spec is used to pick the appropriate registry/auth combo. + opts = opts.concat({ spec }) + const pkgUri = spec.escapedName + return npmFetch.json(pkgUri, opts.concat({ + query: { write: true } + })).then(pkg => { + if (!spec.rawSpec || spec.rawSpec === '*') { + return npmFetch(`${pkgUri}/-rev/${pkg._rev}`, opts.concat({ + method: 'DELETE', + ignoreBody: true + })) + } else { + const version = spec.rawSpec + const allVersions = pkg.versions || {} + const versionPublic = allVersions[version] + let dist + if (versionPublic) { + dist = allVersions[version].dist + } + delete allVersions[version] + // if it was the only version, then delete the whole package. + if (!Object.keys(allVersions).length) { + return npmFetch(`${pkgUri}/-rev/${pkg._rev}`, opts.concat({ + method: 'DELETE', + ignoreBody: true + })) + } else if (versionPublic) { + const latestVer = pkg['dist-tags'].latest + Object.keys(pkg['dist-tags']).forEach(tag => { + if (pkg['dist-tags'][tag] === version) { + delete pkg['dist-tags'][tag] + } + }) + + if (latestVer === version) { + pkg['dist-tags'].latest = Object.keys( + allVersions + ).sort(semver.compareLoose).pop() + } + + delete pkg._revisions + delete pkg._attachments + // Update packument with removed versions + return npmFetch(`${pkgUri}/-rev/${pkg._rev}`, opts.concat({ + method: 'PUT', + body: pkg, + ignoreBody: true + })).then(() => { + // Remove the tarball itself + return npmFetch.json(pkgUri, opts.concat({ + query: { write: true } + })).then(({ _rev, _id }) => { + const tarballUrl = url.parse(dist.tarball).pathname.substr(1) + return npmFetch(`${tarballUrl}/-rev/${_rev}`, opts.concat({ + method: 'DELETE', + ignoreBody: true + })) + }) + }) + } + } + }, err => { + if (err.code !== 'E404') { + throw err + } + }) + }).then(() => true) +} diff --git a/deps/npm/node_modules/libnpmsearch/CHANGELOG.md b/deps/npm/node_modules/libnpmsearch/CHANGELOG.md new file mode 100644 index 00000000000000..6ca044d3f48b4d --- /dev/null +++ b/deps/npm/node_modules/libnpmsearch/CHANGELOG.md @@ -0,0 +1,26 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [2.0.0](https://github.com/npm/libnpmsearch/compare/v1.0.0...v2.0.0) (2018-08-28) + + +### Features + +* **opts:** added options for pagination, details, and sorting weights ([ff97eb5](https://github.com/npm/libnpmsearch/commit/ff97eb5)) + + +### BREAKING CHANGES + +* **opts:** this changes default requests and makes libnpmsearch return more complete data for individual packages, without null-defaulting + + + + +# 1.0.0 (2018-08-27) + + +### Features + +* **api:** got API working ([fe90008](https://github.com/npm/libnpmsearch/commit/fe90008)) diff --git a/deps/npm/node_modules/libnpmsearch/CODE_OF_CONDUCT.md b/deps/npm/node_modules/libnpmsearch/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000000..aeb72f598dcb45 --- /dev/null +++ b/deps/npm/node_modules/libnpmsearch/CODE_OF_CONDUCT.md @@ -0,0 +1,151 @@ +# Code of Conduct + +## When Something Happens + +If you see a Code of Conduct violation, follow these steps: + +1. Let the person know that what they did is not appropriate and ask them to stop and/or edit their message(s) or commits. +2. That person should immediately stop the behavior and correct the issue. +3. If this doesn’t happen, or if you're uncomfortable speaking up, [contact the maintainers](#contacting-maintainers). +4. As soon as available, a maintainer will look into the issue, and take [further action (see below)](#further-enforcement), starting with a warning, then temporary block, then long-term repo or organization ban. + +When reporting, please include any relevant details, links, screenshots, context, or other information that may be used to better understand and resolve the situation. + +**The maintainer team will prioritize the well-being and comfort of the recipients of the violation over the comfort of the violator.** See [some examples below](#enforcement-examples). + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers of this project pledge to making participation in our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, technical preferences, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + + * Using welcoming and inclusive language. + * Being respectful of differing viewpoints and experiences. + * Gracefully accepting constructive feedback. + * Focusing on what is best for the community. + * Showing empathy and kindness towards other community members. + * Encouraging and raising up your peers in the project so you can all bask in hacks and glory. + +Examples of unacceptable behavior by participants include: + + * The use of sexualized language or imagery and unwelcome sexual attention or advances, including when simulated online. The only exception to sexual topics is channels/spaces specifically for topics of sexual identity. + * Casual mention of slavery or indentured servitude and/or false comparisons of one's occupation or situation to slavery. Please consider using or asking about alternate terminology when referring to such metaphors in technology. + * Making light of/making mocking comments about trigger warnings and content warnings. + * Trolling, insulting/derogatory comments, and personal or political attacks. + * Public or private harassment, deliberate intimidation, or threats. + * Publishing others' private information, such as a physical or electronic address, without explicit permission. This includes any sort of "outing" of any aspect of someone's identity without their consent. + * Publishing private screenshots or quotes of interactions in the context of this project without all quoted users' *explicit* consent. + * Publishing of private communication that doesn't have to do with reporting harrassment. + * Any of the above even when [presented as "ironic" or "joking"](https://en.wikipedia.org/wiki/Hipster_racism). + * Any attempt to present "reverse-ism" versions of the above as violations. Examples of reverse-isms are "reverse racism", "reverse sexism", "heterophobia", and "cisphobia". + * Unsolicited explanations under the assumption that someone doesn't already know it. Ask before you teach! Don't assume what people's knowledge gaps are. + * [Feigning or exaggerating surprise](https://www.recurse.com/manual#no-feigned-surprise) when someone admits to not knowing something. + * "[Well-actuallies](https://www.recurse.com/manual#no-well-actuallys)" + * Other conduct which could reasonably be considered inappropriate in a professional or community setting. + +## Scope + +This Code of Conduct applies both within spaces involving this project and in other spaces involving community members. This includes the repository, its Pull Requests and Issue tracker, its Twitter community, private email communications in the context of the project, and any events where members of the project are participating, as well as adjacent communities and venues affecting the project's members. + +Depending on the violation, the maintainers may decide that violations of this code of conduct that have happened outside of the scope of the community may deem an individual unwelcome, and take appropriate action to maintain the comfort and safety of its members. + +### Other Community Standards + +As a project on GitHub, this project is additionally covered by the [GitHub Community Guidelines](https://help.github.com/articles/github-community-guidelines/). + +Additionally, as a project hosted on npm, is is covered by [npm, Inc's Code of Conduct](https://www.npmjs.com/policies/conduct). + +Enforcement of those guidelines after violations overlapping with the above are the responsibility of the entities, and enforcement may happen in any or all of the services/communities. + +## Maintainer Enforcement Process + +Once the maintainers get involved, they will follow a documented series of steps and do their best to preserve the well-being of project members. This section covers actual concrete steps. + +### Contacting Maintainers + +You may get in touch with the maintainer team through any of the following methods: + + * Through email: + * [kzm@zkat.tech](mailto:kzm@zkat.tech) (Kat Marchán) + + * Through Twitter: + * [@maybekatz](https://twitter.com/maybekatz) (Kat Marchán) + +### Further Enforcement + +If you've already followed the [initial enforcement steps](#enforcement), these are the steps maintainers will take for further enforcement, as needed: + + 1. Repeat the request to stop. + 2. If the person doubles down, they will have offending messages removed or edited by a maintainers given an official warning. The PR or Issue may be locked. + 3. If the behavior continues or is repeated later, the person will be blocked from participating for 24 hours. + 4. If the behavior continues or is repeated after the temporary block, a long-term (6-12mo) ban will be used. + +On top of this, maintainers may remove any offending messages, images, contributions, etc, as they deem necessary. + +Maintainers reserve full rights to skip any of these steps, at their discretion, if the violation is considered to be a serious and/or immediate threat to the health and well-being of members of the community. These include any threats, serious physical or verbal attacks, and other such behavior that would be completely unacceptable in any social setting that puts our members at risk. + +Members expelled from events or venues with any sort of paid attendance will not be refunded. + +### Who Watches the Watchers? + +Maintainers and other leaders who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. These may include anything from removal from the maintainer team to a permanent ban from the community. + +Additionally, as a project hosted on both GitHub and npm, [their own Codes of Conducts may be applied against maintainers of this project](#other-community-standards), externally of this project's procedures. + +### Enforcement Examples + +#### The Best Case + +The vast majority of situations work out like this. This interaction is common, and generally positive. + +> Alex: "Yeah I used X and it was really crazy!" + +> Patt (not a maintainer): "Hey, could you not use that word? What about 'ridiculous' instead?" + +> Alex: "oh sorry, sure." -> edits old comment to say "it was really confusing!" + +#### The Maintainer Case + +Sometimes, though, you need to get maintainers involved. Maintainers will do their best to resolve conflicts, but people who were harmed by something **will take priority**. + +> Patt: "Honestly, sometimes I just really hate using $library and anyone who uses it probably sucks at their job." + +> Alex: "Whoa there, could you dial it back a bit? There's a CoC thing about attacking folks' tech use like that." + +> Patt: "I'm not attacking anyone, what's your problem?" + +> Alex: "@maintainers hey uh. Can someone look at this issue? Patt is getting a bit aggro. I tried to nudge them about it, but nope." + +> KeeperOfCommitBits: (on issue) "Hey Patt, maintainer here. Could you tone it down? This sort of attack is really not okay in this space." + +> Patt: "Leave me alone I haven't said anything bad wtf is wrong with you." + +> KeeperOfCommitBits: (deletes user's comment), "@patt I mean it. Please refer to the CoC over at (URL to this CoC) if you have questions, but you can consider this an actual warning. I'd appreciate it if you reworded your messages in this thread, since they made folks there uncomfortable. Let's try and be kind, yeah?" + +> Patt: "@keeperofbits Okay sorry. I'm just frustrated and I'm kinda burnt out and I guess I got carried away. I'll DM Alex a note apologizing and edit my messages. Sorry for the trouble." + +> KeeperOfCommitBits: "@patt Thanks for that. I hear you on the stress. Burnout sucks :/. Have a good one!" + +#### The Nope Case + +> PepeTheFrog🐸: "Hi, I am a literal actual nazi and I think white supremacists are quite fashionable." + +> Patt: "NOOOOPE. OH NOPE NOPE." + +> Alex: "JFC NO. NOPE. @keeperofbits NOPE NOPE LOOK HERE" + +> KeeperOfCommitBits: "👀 Nope. NOPE NOPE NOPE. 🔥" + +> PepeTheFrog🐸 has been banned from all organization or user repositories belonging to KeeperOfCommitBits. + +## Attribution + +This Code of Conduct was generated using [WeAllJS Code of Conduct Generator](https://npm.im/weallbehave), which is based on the [WeAllJS Code of +Conduct](https://wealljs.org/code-of-conduct), which is itself based on +[Contributor Covenant](http://contributor-covenant.org), version 1.4, available +at +[http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4), +and the LGBTQ in Technology Slack [Code of +Conduct](http://lgbtq.technology/coc.html). diff --git a/deps/npm/node_modules/libnpmsearch/CONTRIBUTING.md b/deps/npm/node_modules/libnpmsearch/CONTRIBUTING.md new file mode 100644 index 00000000000000..1a61601a16dbab --- /dev/null +++ b/deps/npm/node_modules/libnpmsearch/CONTRIBUTING.md @@ -0,0 +1,256 @@ +# Contributing + +## How do I... + +* [Use This Guide](#introduction)? +* Ask or Say Something? 🤔🐛😱 + * [Request Support](#request-support) + * [Report an Error or Bug](#report-an-error-or-bug) + * [Request a Feature](#request-a-feature) +* Make Something? 🤓👩🏽‍💻📜🍳 + * [Project Setup](#project-setup) + * [Contribute Documentation](#contribute-documentation) + * [Contribute Code](#contribute-code) +* Manage Something ✅🙆🏼💃👔 + * [Provide Support on Issues](#provide-support-on-issues) + * [Label Issues](#label-issues) + * [Clean Up Issues and PRs](#clean-up-issues-and-prs) + * [Review Pull Requests](#review-pull-requests) + * [Merge Pull Requests](#merge-pull-requests) + * [Tag a Release](#tag-a-release) + * [Join the Project Team](#join-the-project-team) +* Add a Guide Like This One [To My Project](#attribution)? 🤖😻👻 + +## Introduction + +Thank you so much for your interest in contributing!. All types of contributions are encouraged and valued. See the [table of contents](#toc) for different ways to help and details about how this project handles them!📝 + +Please make sure to read the relevant section before making your contribution! It will make it a lot easier for us maintainers to make the most of it and smooth out the experience for all involved. 💚 + +The [Project Team](#join-the-project-team) looks forward to your contributions. 🙌🏾✨ + +## Request Support + +If you have a question about this project, how to use it, or just need clarification about something: + +* Open an Issue at https://github.com/npm/libnpmsearch/issues +* Provide as much context as you can about what you're running into. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* Someone will try to have a response soon. +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. + +## Report an Error or Bug + +If you run into an error or bug with the project: + +* Open an Issue at https://github.com/npm/libnpmsearch/issues +* Include *reproduction steps* that someone else can follow to recreate the bug or error on their own. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* A team member will try to reproduce the issue with your provided steps. If there are no repro steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +* If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#contribute-code). +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. +* `critical` issues may be left open, depending on perceived immediacy and severity, even past the 30 day deadline. + +## Request a Feature + +If the project doesn't do something you need or want it to do: + +* Open an Issue at https://github.com/npm/libnpmsearch/issues +* Provide as much context as you can about what you're running into. +* Please try and be clear about why existing features and alternatives would not work for you. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* The project team will evaluate the feature request, possibly asking you more questions to understand its purpose and any relevant requirements. If the issue is closed, the team will convey their reasoning and suggest an alternative path forward. +* If the feature request is accepted, it will be marked for implementation with `feature-accepted`, which can then be done by either by a core team member or by anyone in the community who wants to [contribute code](#contribute-code). + +Note: The team is unlikely to be able to accept every single feature request that is filed. Please understand if they need to say no. + +## Project Setup + +So you wanna contribute some code! That's great! This project uses GitHub Pull Requests to manage contributions, so [read up on how to fork a GitHub project and file a PR](https://guides.github.com/activities/forking) if you've never done it before. + +If this seems like a lot or you aren't able to do all this setup, you might also be able to [edit the files directly](https://help.github.com/articles/editing-files-in-another-user-s-repository/) without having to do any of this setup. Yes, [even code](#contribute-code). + +If you want to go the usual route and run the project locally, though: + +* [Install Node.js](https://nodejs.org/en/download/) +* [Fork the project](https://guides.github.com/activities/forking/#fork) + +Then in your terminal: +* `cd path/to/your/clone` +* `npm install` +* `npm test` + +And you should be ready to go! + +## Contribute Documentation + +Documentation is a super important, critical part of this project. Docs are how we keep track of what we're doing, how, and why. It's how we stay on the same page about our policies. And it's how we tell others everything they need in order to be able to use this project -- or contribute to it. So thank you in advance. + +Documentation contributions of any size are welcome! Feel free to file a PR even if you're just rewording a sentence to be more clear, or fixing a spelling mistake! + +To contribute documentation: + +* [Set up the project](#project-setup). +* Edit or add any relevant documentation. +* Make sure your changes are formatted correctly and consistently with the rest of the documentation. +* Re-read what you wrote, and run a spellchecker on it to make sure you didn't miss anything. +* In your commit message(s), begin the first line with `docs: `. For example: `docs: Adding a doc contrib section to CONTRIBUTING.md`. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). Documentation commits should use `docs(): `. +* Go to https://github.com/npm/libnpmsearch/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Contribute Code + +We like code commits a lot! They're super handy, and they keep the project going and doing the work it needs to do to be useful to others. + +Code contributions of just about any size are acceptable! + +The main difference between code contributions and documentation contributions is that contributing code requires inclusion of relevant tests for the code being added or changed. Contributions without accompanying tests will be held off until a test is added, unless the maintainers consider the specific tests to be either impossible, or way too much of a burden for such a contribution. + +To contribute code: + +* [Set up the project](#project-setup). +* Make any necessary changes to the source code. +* Include any [additional documentation](#contribute-documentation) the changes might need. +* Write tests that verify that your contribution works as expected. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). +* Dependency updates, additions, or removals must be in individual commits, and the message must use the format: `(deps): PKG@VERSION`, where `` is any of the usual `conventional-changelog` prefixes, at your discretion. +* Go to https://github.com/npm/libnpmsearch/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* Barring special circumstances, maintainers will not review PRs until all checks pass (Travis, AppVeyor, etc). +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. Additional tags (such as `needs-tests`) will be added depending on the review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Provide Support on Issues + +[Needs Collaborator](#join-the-project-team): none + +Helping out other users with their questions is a really awesome way of contributing to any community. It's not uncommon for most of the issues on an open source projects being support-related questions by users trying to understand something they ran into, or find their way around a known bug. + +Sometimes, the `support` label will be added to things that turn out to actually be other things, like bugs or feature requests. In that case, suss out the details with the person who filed the original issue, add a comment explaining what the bug is, and change the label from `support` to `bug` or `feature`. If you can't do this yourself, @mention a maintainer so they can do it. + +In order to help other folks out with their questions: + +* Go to the issue tracker and [filter open issues by the `support` label](https://github.com/npm/libnpmsearch/issues?q=is%3Aopen+is%3Aissue+label%3Asupport). +* Read through the list until you find something that you're familiar enough with to give an answer to. +* Respond to the issue with whatever details are needed to clarify the question, or get more details about what's going on. +* Once the discussion wraps up and things are clarified, either close the issue, or ask the original issue filer (or a maintainer) to close it for you. + +Some notes on picking up support issues: + +* Avoid responding to issues you don't know you can answer accurately. +* As much as possible, try to refer to past issues with accepted answers. Link to them from your replies with the `#123` format. +* Be kind and patient with users -- often, folks who have run into confusing things might be upset or impatient. This is ok. Try to understand where they're coming from, and if you're too uncomfortable with the tone, feel free to stay away or withdraw from the issue. (note: if the user is outright hostile or is violating the CoC, [refer to the Code of Conduct](CODE_OF_CONDUCT.md) to resolve the conflict). + +## Label Issues + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +One of the most important tasks in handling issues is labeling them usefully and accurately. All other tasks involving issues ultimately rely on the issue being classified in such a way that relevant parties looking to do their own tasks can find them quickly and easily. + +In order to label issues, [open up the list of unlabeled issues](https://github.com/npm/libnpmsearch/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and, **from newest to oldest**, read through each one and apply issue labels according to the table below. If you're unsure about what label to apply, skip the issue and try the next one: don't feel obligated to label each and every issue yourself! + +Label | Apply When | Notes +--- | --- | --- +`bug` | Cases where the code (or documentation) is behaving in a way it wasn't intended to. | If something is happening that surprises the *user* but does not go against the way the code is designed, it should use the `enhancement` label. +`critical` | Added to `bug` issues if the problem described makes the code completely unusable in a common situation. | +`documentation` | Added to issues or pull requests that affect any of the documentation for the project. | Can be combined with other labels, such as `bug` or `enhancement`. +`duplicate` | Added to issues or PRs that refer to the exact same issue as another one that's been previously labeled. | Duplicate issues should be marked and closed right away, with a message referencing the issue it's a duplicate of (with `#123`) +`enhancement` | Added to [feature requests](#request-a-feature), PRs, or documentation issues that are purely additive: the code or docs currently work as expected, but a change is being requested or suggested. | +`help wanted` | Applied by [Committers](#join-the-project-team) to issues and PRs that they would like to get outside help for. Generally, this means it's lower priority for the maintainer team to itself implement, but that the community is encouraged to pick up if they so desire | Never applied on first-pass labeling. +`in-progress` | Applied by [Committers](#join-the-project-team) to PRs that are pending some work before they're ready for review. | The original PR submitter should @mention the team member that applied the label once the PR is complete. +`performance` | This issue or PR is directly related to improving performance. | +`refactor` | Added to issues or PRs that deal with cleaning up or modifying the project for the betterment of it. | +`starter` | Applied by [Committers](#join-the-project-team) to issues that they consider good introductions to the project for people who have not contributed before. These are not necessarily "easy", but rather focused around how much context is necessary in order to understand what needs to be done for this project in particular. | Existing project members are expected to stay away from these unless they increase in priority. +`support` | This issue is either asking a question about how to use the project, clarifying the reason for unexpected behavior, or possibly reporting a `bug` but does not have enough detail yet to determine whether it would count as such. | The label should be switched to `bug` if reliable reproduction steps are provided. Issues primarily with unintended configurations of a user's environment are not considered bugs, even if they cause crashes. +`tests` | This issue or PR either requests or adds primarily tests to the project. | If a PR is pending tests, that will be handled through the [PR review process](#review-pull-requests) +`wontfix` | Labelers may apply this label to issues that clearly have nothing at all to do with the project or are otherwise entirely outside of its scope/sphere of influence. [Committers](#join-the-project-team) may apply this label and close an issue or PR if they decide to pass on an otherwise relevant issue. | The issue or PR should be closed as soon as the label is applied, and a clear explanation provided of why the label was used. Contributors are free to contest the labeling, but the decision ultimately falls on committers as to whether to accept something or not. + +## Clean Up Issues and PRs + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +Issues and PRs can go stale after a while. Maybe they're abandoned. Maybe the team will just plain not have time to address them any time soon. + +In these cases, they should be closed until they're brought up again or the interaction starts over. + +To clean up issues and PRs: + +* Search the issue tracker for issues or PRs, and add the term `updated:<=YYYY-MM-DD`, where the date is 30 days before today. +* Go through each issue *from oldest to newest*, and close them if **all of the following are true**: + * not opened by a maintainer + * not marked as `critical` + * not marked as `starter` or `help wanted` (these might stick around for a while, in general, as they're intended to be available) + * no explicit messages in the comments asking for it to be left open + * does not belong to a milestone +* Leave a message when closing saying "Cleaning up stale issue. Please reopen or ping us if and when you're ready to resume this. See https://github.com/npm/libnpmsearch/blob/latest/CONTRIBUTING.md#clean-up-issues-and-prs for more details." + +## Review Pull Requests + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +While anyone can comment on a PR, add feedback, etc, PRs are only *approved* by team members with Issue Tracker or higher permissions. + +PR reviews use [GitHub's own review feature](https://help.github.com/articles/about-pull-request-reviews/), which manages comments, approval, and review iteration. + +Some notes: + +* You may ask for minor changes ("nitpicks"), but consider whether they are really blockers to merging: try to err on the side of "approve, with comments". +* *ALL PULL REQUESTS* should be covered by a test: either by a previously-failing test, an existing test that covers the entire functionality of the submitted code, or new tests to verify any new/changed behavior. All tests must also pass and follow established conventions. Test coverage should not drop, unless the specific case is considered reasonable by maintainers. +* Please make sure you're familiar with the code or documentation being updated, unless it's a minor change (spellchecking, minor formatting, etc). You may @mention another project member who you think is better suited for the review, but still provide a non-approving review of your own. +* Be extra kind: people who submit code/doc contributions are putting themselves in a pretty vulnerable position, and have put time and care into what they've done (even if that's not obvious to you!) -- always respond with respect, be understanding, but don't feel like you need to sacrifice your standards for their sake, either. Just don't be a jerk about it? + +## Merge Pull Requests + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. + +## Tag A Release + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. The most important bit here is probably that all tests must pass, and tags must use [semver](https://semver.org). + +## Join the Project Team + +### Ways to Join + +There are many ways to contribute! Most of them don't require any official status unless otherwise noted. That said, there's a couple of positions that grant special repository abilities, and this section describes how they're granted and what they do. + +All of the below positions are granted based on the project team's needs, as well as their consensus opinion about whether they would like to work with the person and think that they would fit well into that position. The process is relatively informal, and it's likely that people who express interest in participating can just be granted the permissions they'd like. + +You can spot a collaborator on the repo by looking for the `[Collaborator]` or `[Owner]` tags next to their names. + +Permission | Description +--- | --- +Issue Tracker | Granted to contributors who express a strong interest in spending time on the project's issue tracker. These tasks are mainly [labeling issues](#label-issues), [cleaning up old ones](#clean-up-issues-and-prs), and [reviewing pull requests](#review-pull-requests), as well as all the usual things non-team-member contributors can do. Issue handlers should not merge pull requests, tag releases, or directly commit code themselves: that should still be done through the usual pull request process. Becoming an Issue Handler means the project team trusts you to understand enough of the team's process and context to implement it on the issue tracker. +Committer | Granted to contributors who want to handle the actual pull request merges, tagging new versions, etc. Committers should have a good level of familiarity with the codebase, and enough context to understand the implications of various changes, as well as a good sense of the will and expectations of the project team. +Admin/Owner | Granted to people ultimately responsible for the project, its community, etc. + +## Attribution + +This guide was generated using the WeAllJS `CONTRIBUTING.md` generator. [Make your own](https://npm.im/weallcontribute)! diff --git a/deps/npm/node_modules/libnpmsearch/LICENSE b/deps/npm/node_modules/libnpmsearch/LICENSE new file mode 100644 index 00000000000000..209e4477f39c1a --- /dev/null +++ b/deps/npm/node_modules/libnpmsearch/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +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/libnpmsearch/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmsearch/PULL_REQUEST_TEMPLATE new file mode 100644 index 00000000000000..9471c6d325f7eb --- /dev/null +++ b/deps/npm/node_modules/libnpmsearch/PULL_REQUEST_TEMPLATE @@ -0,0 +1,7 @@ + diff --git a/deps/npm/node_modules/libnpmsearch/README.md b/deps/npm/node_modules/libnpmsearch/README.md new file mode 100644 index 00000000000000..6617ddb89d1151 --- /dev/null +++ b/deps/npm/node_modules/libnpmsearch/README.md @@ -0,0 +1,169 @@ +# libnpmsearch [![npm version](https://img.shields.io/npm/v/libnpmsearch.svg)](https://npm.im/libnpmsearch) [![license](https://img.shields.io/npm/l/libnpmsearch.svg)](https://npm.im/libnpmsearch) [![Travis](https://img.shields.io/travis/npm/libnpmsearch.svg)](https://travis-ci.org/npm/libnpmsearch) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmsearch?svg=true)](https://ci.appveyor.com/project/zkat/libnpmsearch) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmsearch/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmsearch?branch=latest) + +[`libnpmsearch`](https://github.com/npm/libnpmsearch) is a Node.js library for +programmatically accessing the npm search endpoint. It does **not** support +legacy search through `/-/all`. + +## Example + +```js +const search = require('libnpmsearch') + +console.log(await search('libnpm')) +=> +[ + { + name: 'libnpm', + description: 'programmatic npm API', + ...etc + }, + { + name: 'libnpmsearch', + description: 'Programmatic API for searching in npm and compatible registries', + ...etc + }, + ...more +] +``` + +## Install + +`$ npm install libnpmsearch` + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [API](#api) + * [search opts](#opts) + * [`search()`](#search) + * [`search.stream()`](#search-stream) + +### API + +#### `opts` for `libnpmsearch` commands + +The following opts are used directly by `libnpmsearch` itself: + +* `opts.limit` - Number of results to limit the query to. Default: 20 +* `opts.offset` - Offset number for results. Used with `opts.limit` for pagination. Default: 0 +* `opts.detailed` - If true, returns an object with `package`, `score`, and `searchScore` fields, with `package` being what would usually be returned, and the other two containing details about how that package scored. Useful for UIs. Default: false +* `opts.sortBy` - Used as a shorthand to set `opts.quality`, `opts.maintenance`, and `opts.popularity` with values that prioritize each one. Should be one of `'optimal'`, `'quality'`, `'maintenance'`, or `'popularity'`. Default: `'optimal'` +* `opts.maintenance` - Decimal number between `0` and `1` that defines the weight of `maintenance` metrics when scoring and sorting packages. Default: `0.65` (same as `opts.sortBy: 'optimal'`) +* `opts.popularity` - Decimal number between `0` and `1` that defines the weight of `popularity` metrics when scoring and sorting packages. Default: `0.98` (same as `opts.sortBy: 'optimal'`) +* `opts.quality` - Decimal number between `0` and `1` that defines the weight of `quality` metrics when scoring and sorting packages. Default: `0.5` (same as `opts.sortBy: 'optimal'`) + +`libnpmsearch` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). +Most options are passed through directly to that library, so please refer to +[its own `opts` +documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) +for options that can be passed in. + +A couple of options of note for those in a hurry: + +* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. +* `opts.Promise` - If you pass this in, the Promises returned by `libnpmsearch` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` + +#### `> search(query, [opts]) -> Promise` + +`query` must be either a String or an Array of search terms. + +If `opts.limit` is provided, it will be sent to the API to constrain the number +of returned results. You may receive more, or fewer results, at the endpoint's +discretion. + +The returned Promise resolved to an Array of search results with the following +format: + +```js +{ + name: String, + version: SemverString, + description: String || null, + maintainers: [ + { + username: String, + email: String + }, + ...etc + ] || null, + keywords: [String] || null, + date: Date || null +} +``` + +If `opts.limit` is provided, it will be sent to the API to constrain the number +of returned results. You may receive more, or fewer results, at the endpoint's +discretion. + +For streamed results, see [`search.stream`](#search-stream). + +##### Example + +```javascript +await search('libnpm') +=> +[ + { + name: 'libnpm', + description: 'programmatic npm API', + ...etc + }, + { + name: 'libnpmsearch', + description: 'Programmatic API for searching in npm and compatible registries', + ...etc + }, + ...more +] +``` + +#### `> search.stream(query, [opts]) -> Stream` + +`query` must be either a String or an Array of search terms. + +If `opts.limit` is provided, it will be sent to the API to constrain the number +of returned results. You may receive more, or fewer results, at the endpoint's +discretion. + +The returned Stream emits one entry per search result, with each entry having +the following format: + +```js +{ + name: String, + version: SemverString, + description: String || null, + maintainers: [ + { + username: String, + email: String + }, + ...etc + ] || null, + keywords: [String] || null, + date: Date || null +} +``` + +For getting results in one chunk, see [`search`](#search-stream). + +##### Example + +```javascript +search.stream('libnpm').on('data', console.log) +=> +// entry 1 +{ + name: 'libnpm', + description: 'programmatic npm API', + ...etc +} +// entry 2 +{ + name: 'libnpmsearch', + description: 'Programmatic API for searching in npm and compatible registries', + ...etc +} +// etc +``` diff --git a/deps/npm/node_modules/libnpmsearch/index.js b/deps/npm/node_modules/libnpmsearch/index.js new file mode 100644 index 00000000000000..b84cab150bea28 --- /dev/null +++ b/deps/npm/node_modules/libnpmsearch/index.js @@ -0,0 +1,79 @@ +'use strict' + +const figgyPudding = require('figgy-pudding') +const getStream = require('get-stream') +const npmFetch = require('npm-registry-fetch') + +const SearchOpts = figgyPudding({ + detailed: {default: false}, + limit: {default: 20}, + from: {default: 0}, + quality: {default: 0.65}, + popularity: {default: 0.98}, + maintenance: {default: 0.5}, + sortBy: {} +}) + +module.exports = search +function search (query, opts) { + return getStream.array(search.stream(query, opts)) +} +search.stream = searchStream +function searchStream (query, opts) { + opts = SearchOpts(opts) + switch (opts.sortBy) { + case 'optimal': { + opts = opts.concat({ + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + break + } + case 'quality': { + opts = opts.concat({ + quality: 1, + popularity: 0, + maintenance: 0 + }) + break + } + case 'popularity': { + opts = opts.concat({ + quality: 0, + popularity: 1, + maintenance: 0 + }) + break + } + case 'maintenance': { + opts = opts.concat({ + quality: 0, + popularity: 0, + maintenance: 1 + }) + break + } + } + return npmFetch.json.stream('/-/v1/search', 'objects.*', + opts.concat({ + query: { + text: Array.isArray(query) ? query.join(' ') : query, + size: opts.limit, + quality: opts.quality, + popularity: opts.popularity, + maintenance: opts.maintenance + }, + mapJson (obj) { + if (obj.package.date) { + obj.package.date = new Date(obj.package.date) + } + if (opts.detailed) { + return obj + } else { + return obj.package + } + } + }) + ) +} diff --git a/deps/npm/node_modules/libnpmsearch/package.json b/deps/npm/node_modules/libnpmsearch/package.json new file mode 100644 index 00000000000000..50e74c7adbff3e --- /dev/null +++ b/deps/npm/node_modules/libnpmsearch/package.json @@ -0,0 +1,74 @@ +{ + "_args": [ + [ + "libnpmsearch@2.0.0", + "/Users/zkat/Documents/code/work/npm" + ] + ], + "_from": "libnpmsearch@2.0.0", + "_id": "libnpmsearch@2.0.0", + "_inBundle": false, + "_integrity": "sha512-vd+JWbTGzOSfiOc+72MU6y7WqmBXn49egCCrIXp27iE/88bX8EpG64ST1blWQI1bSMUr9l1AKPMVsqa2tS5KWA==", + "_location": "/libnpmsearch", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "libnpmsearch@2.0.0", + "name": "libnpmsearch", + "escapedName": "libnpmsearch", + "rawSpec": "2.0.0", + "saveSpec": null, + "fetchSpec": "2.0.0" + }, + "_requiredBy": [ + "/libnpm" + ], + "_resolved": "https://registry.npmjs.org/libnpmsearch/-/libnpmsearch-2.0.0.tgz", + "_spec": "2.0.0", + "_where": "/Users/zkat/Documents/code/work/npm", + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech" + }, + "bugs": { + "url": "https://github.com/npm/libnpmsearch/issues" + }, + "dependencies": { + "figgy-pudding": "^3.5.1", + "get-stream": "^4.0.0", + "npm-registry-fetch": "^3.8.0" + }, + "description": "Programmatic API for searching in npm and compatible registries.", + "devDependencies": { + "nock": "^9.6.1", + "standard": "*", + "standard-version": "*", + "tap": "*", + "weallbehave": "*", + "weallcontribute": "*" + }, + "homepage": "https://npmjs.com/package/libnpmsearch", + "keywords": [ + "npm", + "search", + "api", + "libnpm" + ], + "license": "ISC", + "name": "libnpmsearch", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/libnpmsearch.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --100 test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/libnpmsearch/test/index.js b/deps/npm/node_modules/libnpmsearch/test/index.js new file mode 100644 index 00000000000000..f926af6da8559d --- /dev/null +++ b/deps/npm/node_modules/libnpmsearch/test/index.js @@ -0,0 +1,268 @@ +'use strict' + +const figgyPudding = require('figgy-pudding') +const getStream = require('get-stream') +const qs = require('querystring') +const test = require('tap').test +const tnock = require('./util/tnock.js') + +const OPTS = figgyPudding({registry: {}})({ + registry: 'https://mock.reg/' +}) + +const REG = OPTS.registry +const search = require('../index.js') + +test('basic test', t => { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'foo', version: '2.0.0' } } + ] + }) + return search('oo', OPTS).then(results => { + t.similar(results, [{ + name: 'cool', + version: '1.0.0' + }, { + name: 'foo', + version: '2.0.0' + }], 'got back an array of search results') + }) +}) + +test('search.stream', t => { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0', date: new Date().toISOString() } }, + { package: { name: 'foo', version: '2.0.0' } } + ] + }) + return getStream.array( + search.stream('oo', OPTS) + ).then(results => { + t.similar(results, [{ + name: 'cool', + version: '1.0.0' + }, { + name: 'foo', + version: '2.0.0' + }], 'has a stream-based API function with identical results') + }) +}) + +test('accepts a limit option', t => { + const query = qs.stringify({ + text: 'oo', + size: 3, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } } + ] + }) + return search('oo', OPTS.concat({limit: 3})).then(results => { + t.equal(results.length, 4, 'returns more results if endpoint does so') + }) +}) + +test('accepts quality/mainenance/popularity options', t => { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 1, + popularity: 2, + maintenance: 3 + }) + tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } } + ] + }) + return search('oo', OPTS.concat({ + quality: 1, + popularity: 2, + maintenance: 3 + })).then(results => { + t.equal(results.length, 4, 'returns more results if endpoint does so') + }) +}) + +test('sortBy: quality', t => { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 1, + popularity: 0, + maintenance: 0 + }) + tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } } + ] + }) + return search('oo', OPTS.concat({ + sortBy: 'quality' + })).then(results => { + t.equal(results.length, 4, 'returns more results if endpoint does so') + }) +}) + +test('sortBy: popularity', t => { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 0, + popularity: 1, + maintenance: 0 + }) + tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } } + ] + }) + return search('oo', OPTS.concat({ + sortBy: 'popularity' + })).then(results => { + t.equal(results.length, 4, 'returns more results if endpoint does so') + }) +}) + +test('sortBy: maintenance', t => { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 0, + popularity: 0, + maintenance: 1 + }) + tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } } + ] + }) + return search('oo', OPTS.concat({ + sortBy: 'maintenance' + })).then(results => { + t.equal(results.length, 4, 'returns more results if endpoint does so') + }) +}) + +test('sortBy: optimal', t => { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } } + ] + }) + return search('oo', OPTS.concat({ + sortBy: 'optimal' + })).then(results => { + t.equal(results.length, 4, 'returns more results if endpoint does so') + }) +}) + +test('detailed format', t => { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 0, + popularity: 0, + maintenance: 1 + }) + const results = [ + { + package: { name: 'cool', version: '1.0.0' }, + score: { + final: 0.9237841281241451, + detail: { + quality: 0.9270640902288084, + popularity: 0.8484861649808381, + maintenance: 0.9962706951777409 + } + }, + searchScore: 100000.914 + }, + { + package: { name: 'ok', version: '2.0.0' }, + score: { + final: 0.9237841281451, + detail: { + quality: 0.9270602288084, + popularity: 0.8461649808381, + maintenance: 0.9706951777409 + } + }, + searchScore: 1000.91 + } + ] + tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { + objects: results + }) + return search('oo', OPTS.concat({ + sortBy: 'maintenance', + detailed: true + })).then(res => { + t.deepEqual(res, results, 'return full-format results with opts.detailed') + }) +}) + +test('space-separates and URI-encodes multiple search params', t => { + const query = qs.stringify({ + text: 'foo bar:baz quux?=', + size: 1, + quality: 1, + popularity: 2, + maintenance: 3 + }) + tnock(t, REG).get(`/-/v1/search?${query}`).reply(200, { objects: [] }) + return search(['foo', 'bar:baz', 'quux?='], OPTS.concat({ + limit: 1, + quality: 1, + popularity: 2, + maintenance: 3 + })).then( + () => t.ok(true, 'sent parameters correctly urlencoded') + ) +}) diff --git a/deps/npm/node_modules/libnpmsearch/test/util/tnock.js b/deps/npm/node_modules/libnpmsearch/test/util/tnock.js new file mode 100644 index 00000000000000..00b6e160e10192 --- /dev/null +++ b/deps/npm/node_modules/libnpmsearch/test/util/tnock.js @@ -0,0 +1,12 @@ +'use strict' + +const nock = require('nock') + +module.exports = tnock +function tnock (t, host) { + const server = nock(host) + t.tearDown(function () { + server.done() + }) + return server +} diff --git a/deps/npm/node_modules/libnpmteam/.travis.yml b/deps/npm/node_modules/libnpmteam/.travis.yml new file mode 100644 index 00000000000000..db5ea8b0186403 --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +sudo: false +node_js: + - "10" + - "9" + - "8" + - "6" diff --git a/deps/npm/node_modules/libnpmteam/CHANGELOG.md b/deps/npm/node_modules/libnpmteam/CHANGELOG.md new file mode 100644 index 00000000000000..65a73146edb44e --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/CHANGELOG.md @@ -0,0 +1,18 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [1.0.1](https://github.com/npm/libnpmteam/compare/v1.0.0...v1.0.1) (2018-08-24) + + + + +# 1.0.0 (2018-08-22) + + +### Features + +* **api:** implement team api ([50dd0e1](https://github.com/npm/libnpmteam/commit/50dd0e1)) +* **docs:** add fully-documented readme ([b1370f3](https://github.com/npm/libnpmteam/commit/b1370f3)) +* **test:** test --100 ftw ([9d3bdc3](https://github.com/npm/libnpmteam/commit/9d3bdc3)) diff --git a/deps/npm/node_modules/libnpmteam/CODE_OF_CONDUCT.md b/deps/npm/node_modules/libnpmteam/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000000..aeb72f598dcb45 --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/CODE_OF_CONDUCT.md @@ -0,0 +1,151 @@ +# Code of Conduct + +## When Something Happens + +If you see a Code of Conduct violation, follow these steps: + +1. Let the person know that what they did is not appropriate and ask them to stop and/or edit their message(s) or commits. +2. That person should immediately stop the behavior and correct the issue. +3. If this doesn’t happen, or if you're uncomfortable speaking up, [contact the maintainers](#contacting-maintainers). +4. As soon as available, a maintainer will look into the issue, and take [further action (see below)](#further-enforcement), starting with a warning, then temporary block, then long-term repo or organization ban. + +When reporting, please include any relevant details, links, screenshots, context, or other information that may be used to better understand and resolve the situation. + +**The maintainer team will prioritize the well-being and comfort of the recipients of the violation over the comfort of the violator.** See [some examples below](#enforcement-examples). + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers of this project pledge to making participation in our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, technical preferences, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + + * Using welcoming and inclusive language. + * Being respectful of differing viewpoints and experiences. + * Gracefully accepting constructive feedback. + * Focusing on what is best for the community. + * Showing empathy and kindness towards other community members. + * Encouraging and raising up your peers in the project so you can all bask in hacks and glory. + +Examples of unacceptable behavior by participants include: + + * The use of sexualized language or imagery and unwelcome sexual attention or advances, including when simulated online. The only exception to sexual topics is channels/spaces specifically for topics of sexual identity. + * Casual mention of slavery or indentured servitude and/or false comparisons of one's occupation or situation to slavery. Please consider using or asking about alternate terminology when referring to such metaphors in technology. + * Making light of/making mocking comments about trigger warnings and content warnings. + * Trolling, insulting/derogatory comments, and personal or political attacks. + * Public or private harassment, deliberate intimidation, or threats. + * Publishing others' private information, such as a physical or electronic address, without explicit permission. This includes any sort of "outing" of any aspect of someone's identity without their consent. + * Publishing private screenshots or quotes of interactions in the context of this project without all quoted users' *explicit* consent. + * Publishing of private communication that doesn't have to do with reporting harrassment. + * Any of the above even when [presented as "ironic" or "joking"](https://en.wikipedia.org/wiki/Hipster_racism). + * Any attempt to present "reverse-ism" versions of the above as violations. Examples of reverse-isms are "reverse racism", "reverse sexism", "heterophobia", and "cisphobia". + * Unsolicited explanations under the assumption that someone doesn't already know it. Ask before you teach! Don't assume what people's knowledge gaps are. + * [Feigning or exaggerating surprise](https://www.recurse.com/manual#no-feigned-surprise) when someone admits to not knowing something. + * "[Well-actuallies](https://www.recurse.com/manual#no-well-actuallys)" + * Other conduct which could reasonably be considered inappropriate in a professional or community setting. + +## Scope + +This Code of Conduct applies both within spaces involving this project and in other spaces involving community members. This includes the repository, its Pull Requests and Issue tracker, its Twitter community, private email communications in the context of the project, and any events where members of the project are participating, as well as adjacent communities and venues affecting the project's members. + +Depending on the violation, the maintainers may decide that violations of this code of conduct that have happened outside of the scope of the community may deem an individual unwelcome, and take appropriate action to maintain the comfort and safety of its members. + +### Other Community Standards + +As a project on GitHub, this project is additionally covered by the [GitHub Community Guidelines](https://help.github.com/articles/github-community-guidelines/). + +Additionally, as a project hosted on npm, is is covered by [npm, Inc's Code of Conduct](https://www.npmjs.com/policies/conduct). + +Enforcement of those guidelines after violations overlapping with the above are the responsibility of the entities, and enforcement may happen in any or all of the services/communities. + +## Maintainer Enforcement Process + +Once the maintainers get involved, they will follow a documented series of steps and do their best to preserve the well-being of project members. This section covers actual concrete steps. + +### Contacting Maintainers + +You may get in touch with the maintainer team through any of the following methods: + + * Through email: + * [kzm@zkat.tech](mailto:kzm@zkat.tech) (Kat Marchán) + + * Through Twitter: + * [@maybekatz](https://twitter.com/maybekatz) (Kat Marchán) + +### Further Enforcement + +If you've already followed the [initial enforcement steps](#enforcement), these are the steps maintainers will take for further enforcement, as needed: + + 1. Repeat the request to stop. + 2. If the person doubles down, they will have offending messages removed or edited by a maintainers given an official warning. The PR or Issue may be locked. + 3. If the behavior continues or is repeated later, the person will be blocked from participating for 24 hours. + 4. If the behavior continues or is repeated after the temporary block, a long-term (6-12mo) ban will be used. + +On top of this, maintainers may remove any offending messages, images, contributions, etc, as they deem necessary. + +Maintainers reserve full rights to skip any of these steps, at their discretion, if the violation is considered to be a serious and/or immediate threat to the health and well-being of members of the community. These include any threats, serious physical or verbal attacks, and other such behavior that would be completely unacceptable in any social setting that puts our members at risk. + +Members expelled from events or venues with any sort of paid attendance will not be refunded. + +### Who Watches the Watchers? + +Maintainers and other leaders who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. These may include anything from removal from the maintainer team to a permanent ban from the community. + +Additionally, as a project hosted on both GitHub and npm, [their own Codes of Conducts may be applied against maintainers of this project](#other-community-standards), externally of this project's procedures. + +### Enforcement Examples + +#### The Best Case + +The vast majority of situations work out like this. This interaction is common, and generally positive. + +> Alex: "Yeah I used X and it was really crazy!" + +> Patt (not a maintainer): "Hey, could you not use that word? What about 'ridiculous' instead?" + +> Alex: "oh sorry, sure." -> edits old comment to say "it was really confusing!" + +#### The Maintainer Case + +Sometimes, though, you need to get maintainers involved. Maintainers will do their best to resolve conflicts, but people who were harmed by something **will take priority**. + +> Patt: "Honestly, sometimes I just really hate using $library and anyone who uses it probably sucks at their job." + +> Alex: "Whoa there, could you dial it back a bit? There's a CoC thing about attacking folks' tech use like that." + +> Patt: "I'm not attacking anyone, what's your problem?" + +> Alex: "@maintainers hey uh. Can someone look at this issue? Patt is getting a bit aggro. I tried to nudge them about it, but nope." + +> KeeperOfCommitBits: (on issue) "Hey Patt, maintainer here. Could you tone it down? This sort of attack is really not okay in this space." + +> Patt: "Leave me alone I haven't said anything bad wtf is wrong with you." + +> KeeperOfCommitBits: (deletes user's comment), "@patt I mean it. Please refer to the CoC over at (URL to this CoC) if you have questions, but you can consider this an actual warning. I'd appreciate it if you reworded your messages in this thread, since they made folks there uncomfortable. Let's try and be kind, yeah?" + +> Patt: "@keeperofbits Okay sorry. I'm just frustrated and I'm kinda burnt out and I guess I got carried away. I'll DM Alex a note apologizing and edit my messages. Sorry for the trouble." + +> KeeperOfCommitBits: "@patt Thanks for that. I hear you on the stress. Burnout sucks :/. Have a good one!" + +#### The Nope Case + +> PepeTheFrog🐸: "Hi, I am a literal actual nazi and I think white supremacists are quite fashionable." + +> Patt: "NOOOOPE. OH NOPE NOPE." + +> Alex: "JFC NO. NOPE. @keeperofbits NOPE NOPE LOOK HERE" + +> KeeperOfCommitBits: "👀 Nope. NOPE NOPE NOPE. 🔥" + +> PepeTheFrog🐸 has been banned from all organization or user repositories belonging to KeeperOfCommitBits. + +## Attribution + +This Code of Conduct was generated using [WeAllJS Code of Conduct Generator](https://npm.im/weallbehave), which is based on the [WeAllJS Code of +Conduct](https://wealljs.org/code-of-conduct), which is itself based on +[Contributor Covenant](http://contributor-covenant.org), version 1.4, available +at +[http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4), +and the LGBTQ in Technology Slack [Code of +Conduct](http://lgbtq.technology/coc.html). diff --git a/deps/npm/node_modules/libnpmteam/CONTRIBUTING.md b/deps/npm/node_modules/libnpmteam/CONTRIBUTING.md new file mode 100644 index 00000000000000..3fd40076caae85 --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/CONTRIBUTING.md @@ -0,0 +1,256 @@ +# Contributing + +## How do I... + +* [Use This Guide](#introduction)? +* Ask or Say Something? 🤔🐛😱 + * [Request Support](#request-support) + * [Report an Error or Bug](#report-an-error-or-bug) + * [Request a Feature](#request-a-feature) +* Make Something? 🤓👩🏽‍💻📜🍳 + * [Project Setup](#project-setup) + * [Contribute Documentation](#contribute-documentation) + * [Contribute Code](#contribute-code) +* Manage Something ✅🙆🏼💃👔 + * [Provide Support on Issues](#provide-support-on-issues) + * [Label Issues](#label-issues) + * [Clean Up Issues and PRs](#clean-up-issues-and-prs) + * [Review Pull Requests](#review-pull-requests) + * [Merge Pull Requests](#merge-pull-requests) + * [Tag a Release](#tag-a-release) + * [Join the Project Team](#join-the-project-team) +* Add a Guide Like This One [To My Project](#attribution)? 🤖😻👻 + +## Introduction + +Thank you so much for your interest in contributing!. All types of contributions are encouraged and valued. See the [table of contents](#toc) for different ways to help and details about how this project handles them!📝 + +Please make sure to read the relevant section before making your contribution! It will make it a lot easier for us maintainers to make the most of it and smooth out the experience for all involved. 💚 + +The [Project Team](#join-the-project-team) looks forward to your contributions. 🙌🏾✨ + +## Request Support + +If you have a question about this project, how to use it, or just need clarification about something: + +* Open an Issue at https://github.com/npm/libnpmteam/issues +* Provide as much context as you can about what you're running into. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* Someone will try to have a response soon. +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. + +## Report an Error or Bug + +If you run into an error or bug with the project: + +* Open an Issue at https://github.com/npm/libnpmteam/issues +* Include *reproduction steps* that someone else can follow to recreate the bug or error on their own. +* Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* A team member will try to reproduce the issue with your provided steps. If there are no repro steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +* If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#contribute-code). +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. +* `critical` issues may be left open, depending on perceived immediacy and severity, even past the 30 day deadline. + +## Request a Feature + +If the project doesn't do something you need or want it to do: + +* Open an Issue at https://github.com/npm/libnpmteam/issues +* Provide as much context as you can about what you're running into. +* Please try and be clear about why existing features and alternatives would not work for you. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* The project team will evaluate the feature request, possibly asking you more questions to understand its purpose and any relevant requirements. If the issue is closed, the team will convey their reasoning and suggest an alternative path forward. +* If the feature request is accepted, it will be marked for implementation with `feature-accepted`, which can then be done by either by a core team member or by anyone in the community who wants to [contribute code](#contribute-code). + +Note: The team is unlikely to be able to accept every single feature request that is filed. Please understand if they need to say no. + +## Project Setup + +So you wanna contribute some code! That's great! This project uses GitHub Pull Requests to manage contributions, so [read up on how to fork a GitHub project and file a PR](https://guides.github.com/activities/forking) if you've never done it before. + +If this seems like a lot or you aren't able to do all this setup, you might also be able to [edit the files directly](https://help.github.com/articles/editing-files-in-another-user-s-repository/) without having to do any of this setup. Yes, [even code](#contribute-code). + +If you want to go the usual route and run the project locally, though: + +* [Install Node.js](https://nodejs.org/en/download/) +* [Fork the project](https://guides.github.com/activities/forking/#fork) + +Then in your terminal: +* `cd path/to/your/clone` +* `npm install` +* `npm test` + +And you should be ready to go! + +## Contribute Documentation + +Documentation is a super important, critical part of this project. Docs are how we keep track of what we're doing, how, and why. It's how we stay on the same page about our policies. And it's how we tell others everything they need in order to be able to use this project -- or contribute to it. So thank you in advance. + +Documentation contributions of any size are welcome! Feel free to file a PR even if you're just rewording a sentence to be more clear, or fixing a spelling mistake! + +To contribute documentation: + +* [Set up the project](#project-setup). +* Edit or add any relevant documentation. +* Make sure your changes are formatted correctly and consistently with the rest of the documentation. +* Re-read what you wrote, and run a spellchecker on it to make sure you didn't miss anything. +* In your commit message(s), begin the first line with `docs: `. For example: `docs: Adding a doc contrib section to CONTRIBUTING.md`. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). Documentation commits should use `docs(): `. +* Go to https://github.com/npm/libnpmteam/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Contribute Code + +We like code commits a lot! They're super handy, and they keep the project going and doing the work it needs to do to be useful to others. + +Code contributions of just about any size are acceptable! + +The main difference between code contributions and documentation contributions is that contributing code requires inclusion of relevant tests for the code being added or changed. Contributions without accompanying tests will be held off until a test is added, unless the maintainers consider the specific tests to be either impossible, or way too much of a burden for such a contribution. + +To contribute code: + +* [Set up the project](#project-setup). +* Make any necessary changes to the source code. +* Include any [additional documentation](#contribute-documentation) the changes might need. +* Write tests that verify that your contribution works as expected. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). +* Dependency updates, additions, or removals must be in individual commits, and the message must use the format: `(deps): PKG@VERSION`, where `` is any of the usual `conventional-changelog` prefixes, at your discretion. +* Go to https://github.com/npm/libnpmteam/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* Barring special circumstances, maintainers will not review PRs until all checks pass (Travis, AppVeyor, etc). +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. Additional tags (such as `needs-tests`) will be added depending on the review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Provide Support on Issues + +[Needs Collaborator](#join-the-project-team): none + +Helping out other users with their questions is a really awesome way of contributing to any community. It's not uncommon for most of the issues on an open source projects being support-related questions by users trying to understand something they ran into, or find their way around a known bug. + +Sometimes, the `support` label will be added to things that turn out to actually be other things, like bugs or feature requests. In that case, suss out the details with the person who filed the original issue, add a comment explaining what the bug is, and change the label from `support` to `bug` or `feature`. If you can't do this yourself, @mention a maintainer so they can do it. + +In order to help other folks out with their questions: + +* Go to the issue tracker and [filter open issues by the `support` label](https://github.com/npm/libnpmteam/issues?q=is%3Aopen+is%3Aissue+label%3Asupport). +* Read through the list until you find something that you're familiar enough with to give an answer to. +* Respond to the issue with whatever details are needed to clarify the question, or get more details about what's going on. +* Once the discussion wraps up and things are clarified, either close the issue, or ask the original issue filer (or a maintainer) to close it for you. + +Some notes on picking up support issues: + +* Avoid responding to issues you don't know you can answer accurately. +* As much as possible, try to refer to past issues with accepted answers. Link to them from your replies with the `#123` format. +* Be kind and patient with users -- often, folks who have run into confusing things might be upset or impatient. This is ok. Try to understand where they're coming from, and if you're too uncomfortable with the tone, feel free to stay away or withdraw from the issue. (note: if the user is outright hostile or is violating the CoC, [refer to the Code of Conduct](CODE_OF_CONDUCT.md) to resolve the conflict). + +## Label Issues + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +One of the most important tasks in handling issues is labeling them usefully and accurately. All other tasks involving issues ultimately rely on the issue being classified in such a way that relevant parties looking to do their own tasks can find them quickly and easily. + +In order to label issues, [open up the list of unlabeled issues](https://github.com/npm/libnpmteam/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and, **from newest to oldest**, read through each one and apply issue labels according to the table below. If you're unsure about what label to apply, skip the issue and try the next one: don't feel obligated to label each and every issue yourself! + +Label | Apply When | Notes +--- | --- | --- +`bug` | Cases where the code (or documentation) is behaving in a way it wasn't intended to. | If something is happening that surprises the *user* but does not go against the way the code is designed, it should use the `enhancement` label. +`critical` | Added to `bug` issues if the problem described makes the code completely unusable in a common situation. | +`documentation` | Added to issues or pull requests that affect any of the documentation for the project. | Can be combined with other labels, such as `bug` or `enhancement`. +`duplicate` | Added to issues or PRs that refer to the exact same issue as another one that's been previously labeled. | Duplicate issues should be marked and closed right away, with a message referencing the issue it's a duplicate of (with `#123`) +`enhancement` | Added to [feature requests](#request-a-feature), PRs, or documentation issues that are purely additive: the code or docs currently work as expected, but a change is being requested or suggested. | +`help wanted` | Applied by [Committers](#join-the-project-team) to issues and PRs that they would like to get outside help for. Generally, this means it's lower priority for the maintainer team to itself implement, but that the community is encouraged to pick up if they so desire | Never applied on first-pass labeling. +`in-progress` | Applied by [Committers](#join-the-project-team) to PRs that are pending some work before they're ready for review. | The original PR submitter should @mention the team member that applied the label once the PR is complete. +`performance` | This issue or PR is directly related to improving performance. | +`refactor` | Added to issues or PRs that deal with cleaning up or modifying the project for the betterment of it. | +`starter` | Applied by [Committers](#join-the-project-team) to issues that they consider good introductions to the project for people who have not contributed before. These are not necessarily "easy", but rather focused around how much context is necessary in order to understand what needs to be done for this project in particular. | Existing project members are expected to stay away from these unless they increase in priority. +`support` | This issue is either asking a question about how to use the project, clarifying the reason for unexpected behavior, or possibly reporting a `bug` but does not have enough detail yet to determine whether it would count as such. | The label should be switched to `bug` if reliable reproduction steps are provided. Issues primarily with unintended configurations of a user's environment are not considered bugs, even if they cause crashes. +`tests` | This issue or PR either requests or adds primarily tests to the project. | If a PR is pending tests, that will be handled through the [PR review process](#review-pull-requests) +`wontfix` | Labelers may apply this label to issues that clearly have nothing at all to do with the project or are otherwise entirely outside of its scope/sphere of influence. [Committers](#join-the-project-team) may apply this label and close an issue or PR if they decide to pass on an otherwise relevant issue. | The issue or PR should be closed as soon as the label is applied, and a clear explanation provided of why the label was used. Contributors are free to contest the labeling, but the decision ultimately falls on committers as to whether to accept something or not. + +## Clean Up Issues and PRs + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +Issues and PRs can go stale after a while. Maybe they're abandoned. Maybe the team will just plain not have time to address them any time soon. + +In these cases, they should be closed until they're brought up again or the interaction starts over. + +To clean up issues and PRs: + +* Search the issue tracker for issues or PRs, and add the term `updated:<=YYYY-MM-DD`, where the date is 30 days before today. +* Go through each issue *from oldest to newest*, and close them if **all of the following are true**: + * not opened by a maintainer + * not marked as `critical` + * not marked as `starter` or `help wanted` (these might stick around for a while, in general, as they're intended to be available) + * no explicit messages in the comments asking for it to be left open + * does not belong to a milestone +* Leave a message when closing saying "Cleaning up stale issue. Please reopen or ping us if and when you're ready to resume this. See https://github.com/npm/libnpmteam/blob/latest/CONTRIBUTING.md#clean-up-issues-and-prs for more details." + +## Review Pull Requests + +[Needs Collaborator](#join-the-project-team): Issue Tracker + +While anyone can comment on a PR, add feedback, etc, PRs are only *approved* by team members with Issue Tracker or higher permissions. + +PR reviews use [GitHub's own review feature](https://help.github.com/articles/about-pull-request-reviews/), which manages comments, approval, and review iteration. + +Some notes: + +* You may ask for minor changes ("nitpicks"), but consider whether they are really blockers to merging: try to err on the side of "approve, with comments". +* *ALL PULL REQUESTS* should be covered by a test: either by a previously-failing test, an existing test that covers the entire functionality of the submitted code, or new tests to verify any new/changed behavior. All tests must also pass and follow established conventions. Test coverage should not drop, unless the specific case is considered reasonable by maintainers. +* Please make sure you're familiar with the code or documentation being updated, unless it's a minor change (spellchecking, minor formatting, etc). You may @mention another project member who you think is better suited for the review, but still provide a non-approving review of your own. +* Be extra kind: people who submit code/doc contributions are putting themselves in a pretty vulnerable position, and have put time and care into what they've done (even if that's not obvious to you!) -- always respond with respect, be understanding, but don't feel like you need to sacrifice your standards for their sake, either. Just don't be a jerk about it? + +## Merge Pull Requests + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. + +## Tag A Release + +[Needs Collaborator](#join-the-project-team): Committer + +TBD - need to hash out a bit more of this process. The most important bit here is probably that all tests must pass, and tags must use [semver](https://semver.org). + +## Join the Project Team + +### Ways to Join + +There are many ways to contribute! Most of them don't require any official status unless otherwise noted. That said, there's a couple of positions that grant special repository abilities, and this section describes how they're granted and what they do. + +All of the below positions are granted based on the project team's needs, as well as their consensus opinion about whether they would like to work with the person and think that they would fit well into that position. The process is relatively informal, and it's likely that people who express interest in participating can just be granted the permissions they'd like. + +You can spot a collaborator on the repo by looking for the `[Collaborator]` or `[Owner]` tags next to their names. + +Permission | Description +--- | --- +Issue Tracker | Granted to contributors who express a strong interest in spending time on the project's issue tracker. These tasks are mainly [labeling issues](#label-issues), [cleaning up old ones](#clean-up-issues-and-prs), and [reviewing pull requests](#review-pull-requests), as well as all the usual things non-team-member contributors can do. Issue handlers should not merge pull requests, tag releases, or directly commit code themselves: that should still be done through the usual pull request process. Becoming an Issue Handler means the project team trusts you to understand enough of the team's process and context to implement it on the issue tracker. +Committer | Granted to contributors who want to handle the actual pull request merges, tagging new versions, etc. Committers should have a good level of familiarity with the codebase, and enough context to understand the implications of various changes, as well as a good sense of the will and expectations of the project team. +Admin/Owner | Granted to people ultimately responsible for the project, its community, etc. + +## Attribution + +This guide was generated using the WeAllJS `CONTRIBUTING.md` generator. [Make your own](https://npm.im/weallcontribute)! diff --git a/deps/npm/node_modules/libnpmteam/LICENSE b/deps/npm/node_modules/libnpmteam/LICENSE new file mode 100644 index 00000000000000..209e4477f39c1a --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +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/libnpmteam/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmteam/PULL_REQUEST_TEMPLATE new file mode 100644 index 00000000000000..9471c6d325f7eb --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/PULL_REQUEST_TEMPLATE @@ -0,0 +1,7 @@ + diff --git a/deps/npm/node_modules/libnpmteam/README.md b/deps/npm/node_modules/libnpmteam/README.md new file mode 100644 index 00000000000000..e0e771c7fac86c --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/README.md @@ -0,0 +1,185 @@ +# libnpmteam [![npm version](https://img.shields.io/npm/v/libnpmteam.svg)](https://npm.im/libnpmteam) [![license](https://img.shields.io/npm/l/libnpmteam.svg)](https://npm.im/libnpmteam) [![Travis](https://img.shields.io/travis/npm/libnpmteam/latest.svg)](https://travis-ci.org/npm/libnpmteam) [![AppVeyor](https://img.shields.io/appveyor/ci/zkat/libnpmteam/latest.svg)](https://ci.appveyor.com/project/zkat/libnpmteam) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmteam/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmteam?branch=latest) + +[`libnpmteam`](https://github.com/npm/libnpmteam) is a Node.js +library that provides programmatic access to the guts of the npm CLI's `npm +team` command and its various subcommands. + +## Example + +```javascript +const access = require('libnpmteam') + +// List all teams for the @npm org. +console.log(await team.lsTeams('npm')) +``` + +## Table of Contents + +* [Installing](#install) +* [Example](#example) +* [Contributing](#contributing) +* [API](#api) + * [team opts](#opts) + * [`create()`](#create) + * [`destroy()`](#destroy) + * [`add()`](#add) + * [`rm()`](#rm) + * [`lsTeams()`](#ls-teams) + * [`lsTeams.stream()`](#ls-teams-stream) + * [`lsUsers()`](#ls-users) + * [`lsUsers.stream()`](#ls-users-stream) + +### Install + +`$ npm install libnpmteam` + +### Contributing + +The npm team enthusiastically welcomes contributions and project participation! +There's a bunch of things you can do if you want to contribute! The [Contributor +Guide](CONTRIBUTING.md) has all the information you need for everything from +reporting bugs to contributing entire new features. Please don't hesitate to +jump in if you'd like to, or even ask us questions if something isn't clear. + +All participants and maintainers in this project are expected to follow [Code of +Conduct](CODE_OF_CONDUCT.md), and just generally be excellent to each other. + +Please refer to the [Changelog](CHANGELOG.md) for project history details, too. + +Happy hacking! + +### API + +#### `opts` for `libnpmteam` commands + +`libnpmteam` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). +All options are passed through directly to that library, so please refer to [its +own `opts` +documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) +for options that can be passed in. + +A couple of options of note for those in a hurry: + +* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. +* `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmteam` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` +* `opts.Promise` - If you pass this in, the Promises returned by `libnpmteam` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` + +#### `> team.create(team, [opts]) -> Promise` + +Creates a team named `team`. Team names use the format `@:`, with +the `@` being optional. + +Additionally, `opts.description` may be passed in to include a description. + +##### Example + +```javascript +await team.create('@npm:cli', {token: 'myregistrytoken'}) +// The @npm:cli team now exists. +``` + +#### `> team.destroy(team, [opts]) -> Promise` + +Destroys a team named `team`. Team names use the format `@:`, with +the `@` being optional. + +##### Example + +```javascript +await team.destroy('@npm:cli', {token: 'myregistrytoken'}) +// The @npm:cli team has been destroyed. +``` + +#### `> team.add(user, team, [opts]) -> Promise` + +Adds `user` to `team`. + +##### Example + +```javascript +await team.add('zkat', '@npm:cli', {token: 'myregistrytoken'}) +// @zkat now belongs to the @npm:cli team. +``` + +#### `> team.rm(user, team, [opts]) -> Promise` + +Removes `user` from `team`. + +##### Example + +```javascript +await team.rm('zkat', '@npm:cli', {token: 'myregistrytoken'}) +// @zkat is no longer part of the @npm:cli team. +``` + +#### `> team.lsTeams(scope, [opts]) -> Promise` + +Resolves to an array of team names belonging to `scope`. + +##### Example + +```javascript +await team.lsTeams('@npm', {token: 'myregistrytoken'}) +=> +[ + 'npm:cli', + 'npm:web', + 'npm:registry', + 'npm:developers' +] +``` + +#### `> team.lsTeams.stream(scope, [opts]) -> Stream` + +Returns a stream of teams belonging to `scope`. + +For a Promise-based version of these results, see [`team.lsTeams()`](#ls-teams). + +##### Example + +```javascript +for await (let team of team.lsTeams.stream('@npm', {token: 'myregistrytoken'})) { + console.log(team) +} + +// outputs +// npm:cli +// npm:web +// npm:registry +// npm:developers +``` + +#### `> team.lsUsers(team, [opts]) -> Promise` + +Resolves to an array of usernames belonging to `team`. + +For a streamed version of these results, see [`team.lsUsers.stream()`](#ls-users-stream). + +##### Example + +```javascript +await team.lsUsers('@npm:cli', {token: 'myregistrytoken'}) +=> +[ + 'iarna', + 'zkat' +] +``` + +#### `> team.lsUsers.stream(team, [opts]) -> Stream` + +Returns a stream of usernames belonging to `team`. + +For a Promise-based version of these results, see [`team.lsUsers()`](#ls-users). + +##### Example + +```javascript +for await (let user of team.lsUsers.stream('@npm:cli', {token: 'myregistrytoken'})) { + console.log(user) +} + +// outputs +// iarna +// zkat +``` diff --git a/deps/npm/node_modules/libnpmteam/appveyor.yml b/deps/npm/node_modules/libnpmteam/appveyor.yml new file mode 100644 index 00000000000000..9cc64c58e02f96 --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/appveyor.yml @@ -0,0 +1,22 @@ +environment: + matrix: + - nodejs_version: "10" + - nodejs_version: "9" + - nodejs_version: "8" + - nodejs_version: "6" + +platform: + - x64 + +install: + - ps: Install-Product node $env:nodejs_version $env:platform + - npm config set spin false + - npm install + +test_script: + - npm test + +matrix: + fast_finish: true + +build: off diff --git a/deps/npm/node_modules/libnpmteam/index.js b/deps/npm/node_modules/libnpmteam/index.js new file mode 100644 index 00000000000000..c0bd0609aab252 --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/index.js @@ -0,0 +1,106 @@ +'use strict' + +const eu = encodeURIComponent +const figgyPudding = require('figgy-pudding') +const getStream = require('get-stream') +const npmFetch = require('npm-registry-fetch') +const validate = require('aproba') + +const TeamConfig = figgyPudding({ + description: {}, + Promise: {default: () => Promise} +}) + +const cmd = module.exports = {} + +cmd.create = (entity, opts) => { + opts = TeamConfig(opts) + return pwrap(opts, () => { + const {scope, team} = splitEntity(entity) + validate('SSO', [scope, team, opts]) + return npmFetch.json(`/-/org/${eu(scope)}/team`, opts.concat({ + method: 'PUT', + scope, + body: {name: team, description: opts.description} + })) + }) +} + +cmd.destroy = (entity, opts) => { + opts = TeamConfig(opts) + return pwrap(opts, () => { + const {scope, team} = splitEntity(entity) + validate('SSO', [scope, team, opts]) + return npmFetch.json(`/-/team/${eu(scope)}/${eu(team)}`, opts.concat({ + method: 'DELETE', + scope + })) + }) +} + +cmd.add = (user, entity, opts) => { + opts = TeamConfig(opts) + return pwrap(opts, () => { + const {scope, team} = splitEntity(entity) + validate('SSO', [scope, team, opts]) + return npmFetch.json(`/-/team/${eu(scope)}/${eu(team)}/user`, opts.concat({ + method: 'PUT', + scope, + body: {user} + })) + }) +} + +cmd.rm = (user, entity, opts) => { + opts = TeamConfig(opts) + return pwrap(opts, () => { + const {scope, team} = splitEntity(entity) + validate('SSO', [scope, team, opts]) + return npmFetch.json(`/-/team/${eu(scope)}/${eu(team)}/user`, opts.concat({ + method: 'DELETE', + scope, + body: {user} + })) + }) +} + +cmd.lsTeams = (scope, opts) => { + opts = TeamConfig(opts) + return pwrap(opts, () => getStream.array(cmd.lsTeams.stream(scope, opts))) +} +cmd.lsTeams.stream = (scope, opts) => { + opts = TeamConfig(opts) + validate('SO', [scope, opts]) + return npmFetch.json.stream(`/-/org/${eu(scope)}/team`, '.*', opts.concat({ + query: {format: 'cli'} + })) +} + +cmd.lsUsers = (entity, opts) => { + opts = TeamConfig(opts) + return pwrap(opts, () => getStream.array(cmd.lsUsers.stream(entity, opts))) +} +cmd.lsUsers.stream = (entity, opts) => { + opts = TeamConfig(opts) + const {scope, team} = splitEntity(entity) + validate('SSO', [scope, team, opts]) + const uri = `/-/team/${eu(scope)}/${eu(team)}/user` + return npmFetch.json.stream(uri, '.*', opts.concat({ + query: {format: 'cli'} + })) +} + +cmd.edit = () => { + throw new Error('edit is not implemented yet') +} + +function splitEntity (entity = '') { + let [, scope, team] = entity.match(/^@?([^:]+):(.*)$/) || [] + return {scope, team} +} + +function pwrap (opts, fn) { + return new opts.Promise((resolve, reject) => { + fn().then(resolve, reject) + }) +} diff --git a/deps/npm/node_modules/libnpmteam/node_modules/aproba/CHANGELOG.md b/deps/npm/node_modules/libnpmteam/node_modules/aproba/CHANGELOG.md new file mode 100644 index 00000000000000..bab30ecb7e625d --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/node_modules/aproba/CHANGELOG.md @@ -0,0 +1,4 @@ +2.0.0 + * Drop support for 0.10 and 0.12. They haven't been in travis but still, + since we _know_ we'll break with them now it's only polite to do a + major bump. diff --git a/deps/npm/node_modules/libnpmteam/node_modules/aproba/LICENSE b/deps/npm/node_modules/libnpmteam/node_modules/aproba/LICENSE new file mode 100644 index 00000000000000..2a4982dc40cb69 --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/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/libnpmteam/node_modules/aproba/README.md b/deps/npm/node_modules/libnpmteam/node_modules/aproba/README.md new file mode 100644 index 00000000000000..e94799201ce046 --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/node_modules/aproba/README.md @@ -0,0 +1,93 @@ +aproba +====== + +A ridiculously 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 | `Array.isArray` 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` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### 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/libnpmteam/node_modules/aproba/index.js b/deps/npm/node_modules/libnpmteam/node_modules/aproba/index.js new file mode 100644 index 00000000000000..fd947481ba5575 --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' +module.exports = validate + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +const types = { + '*': {label: 'any', check: () => true}, + A: {label: 'array', check: _ => Array.isArray(_) || isArguments(_)}, + S: {label: 'string', check: _ => typeof _ === 'string'}, + N: {label: 'number', check: _ => typeof _ === 'number'}, + F: {label: 'function', check: _ => typeof _ === 'function'}, + O: {label: 'object', check: _ => typeof _ === 'object' && _ != null && !types.A.check(_) && !types.E.check(_)}, + B: {label: 'boolean', check: _ => typeof _ === 'boolean'}, + E: {label: 'error', check: _ => _ instanceof Error}, + Z: {label: 'null', check: _ => _ == null} +} + +function addSchema (schema, arity) { + const group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +function validate (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + const schemas = rawSchemas.split('|') + const arity = {} + + schemas.forEach(schema => { + for (let ii = 0; ii < schema.length; ++ii) { + const type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + let matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (let ii = 0; ii < args.length; ++ii) { + let newMatching = matching.filter(schema => { + const type = schema[ii] + const typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + const labels = matching.map(_ => types[_[ii]].label).filter(_ => _ != null) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +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, expectedTypes, value) { + let valueType + Object.keys(types).forEach(typeCode => { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + const english = englishList(expected) + const args = expected.every(ex => ex.length === 1) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + const err = new Error(msg) + err.code = code + /* istanbul ignore else */ + if (Error.captureStackTrace) Error.captureStackTrace(err, validate) + return err +} diff --git a/deps/npm/node_modules/libnpmteam/node_modules/aproba/package.json b/deps/npm/node_modules/libnpmteam/node_modules/aproba/package.json new file mode 100644 index 00000000000000..d941c6159ffe36 --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/node_modules/aproba/package.json @@ -0,0 +1,66 @@ +{ + "_args": [ + [ + "aproba@2.0.0", + "/Users/zkat/Documents/code/work/npm" + ] + ], + "_from": "aproba@2.0.0", + "_id": "aproba@2.0.0", + "_inBundle": false, + "_integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "_location": "/libnpmteam/aproba", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "aproba@2.0.0", + "name": "aproba", + "escapedName": "aproba", + "rawSpec": "2.0.0", + "saveSpec": null, + "fetchSpec": "2.0.0" + }, + "_requiredBy": [ + "/libnpmteam" + ], + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "_spec": "2.0.0", + "_where": "/Users/zkat/Documents/code/work/npm", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "dependencies": {}, + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "devDependencies": { + "standard": "^11.0.1", + "tap": "^12.0.1" + }, + "directories": { + "test": "test" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "name": "aproba", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "pretest": "standard", + "test": "tap --100 -J test/*.js" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/libnpmteam/package.json b/deps/npm/node_modules/libnpmteam/package.json new file mode 100644 index 00000000000000..8b9fcd60ea31cf --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/package.json @@ -0,0 +1,69 @@ +{ + "_args": [ + [ + "libnpmteam@1.0.1", + "/Users/zkat/Documents/code/work/npm" + ] + ], + "_from": "libnpmteam@1.0.1", + "_id": "libnpmteam@1.0.1", + "_inBundle": false, + "_integrity": "sha512-gDdrflKFCX7TNwOMX1snWojCoDE5LoRWcfOC0C/fqF7mBq8Uz9zWAX4B2RllYETNO7pBupBaSyBDkTAC15cAMg==", + "_location": "/libnpmteam", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "libnpmteam@1.0.1", + "name": "libnpmteam", + "escapedName": "libnpmteam", + "rawSpec": "1.0.1", + "saveSpec": null, + "fetchSpec": "1.0.1" + }, + "_requiredBy": [ + "/libnpm" + ], + "_resolved": "https://registry.npmjs.org/libnpmteam/-/libnpmteam-1.0.1.tgz", + "_spec": "1.0.1", + "_where": "/Users/zkat/Documents/code/work/npm", + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech" + }, + "bugs": { + "url": "https://github.com/npm/libnpmteam/issues" + }, + "dependencies": { + "aproba": "^2.0.0", + "figgy-pudding": "^3.4.1", + "get-stream": "^4.0.0", + "npm-registry-fetch": "^3.8.0" + }, + "description": "npm Team management APIs", + "devDependencies": { + "nock": "^9.6.1", + "standard": "*", + "standard-version": "*", + "tap": "*", + "weallbehave": "*", + "weallcontribute": "*" + }, + "homepage": "https://npmjs.com/package/libnpmteam", + "license": "ISC", + "name": "libnpmteam", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/libnpmteam.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --100 test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "1.0.1" +} diff --git a/deps/npm/node_modules/libnpmteam/test/index.js b/deps/npm/node_modules/libnpmteam/test/index.js new file mode 100644 index 00000000000000..2271c28840dc3b --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/test/index.js @@ -0,0 +1,138 @@ +'use strict' + +const figgyPudding = require('figgy-pudding') +const getStream = require('get-stream') +const {test} = require('tap') +const tnock = require('./util/tnock.js') + +const team = require('../index.js') + +const REG = 'http://localhost:1337' +const OPTS = figgyPudding({})({ + registry: REG +}) + +test('create', t => { + tnock(t, REG).put( + '/-/org/foo/team', {name: 'cli'} + ).reply(201, {name: 'cli'}) + return team.create('@foo:cli', OPTS).then(ret => { + t.deepEqual(ret, {name: 'cli'}, 'request succeeded') + }) +}) + +test('create bad entity name', t => { + return team.create('go away', OPTS).then( + () => { throw new Error('should not succeed') }, + err => { t.ok(err, 'error on bad entity name') } + ) +}) + +test('create empty entity', t => { + return team.create(undefined, OPTS).then( + () => { throw new Error('should not succeed') }, + err => { t.ok(err, 'error on bad entity name') } + ) +}) + +test('create w/ description', t => { + tnock(t, REG).put('/-/org/foo/team', { + name: 'cli', + description: 'just some cool folx' + }).reply(201, {name: 'cli'}) + return team.create('@foo:cli', OPTS.concat({ + description: 'just some cool folx' + })).then(ret => { + t.deepEqual(ret, {name: 'cli'}, 'no desc in return') + }) +}) + +test('destroy', t => { + tnock(t, REG).delete( + '/-/team/foo/cli' + ).reply(204, {}) + return team.destroy('@foo:cli', OPTS).then(ret => { + t.deepEqual(ret, {}, 'request succeeded') + }) +}) + +test('add', t => { + tnock(t, REG).put( + '/-/team/foo/cli/user', {user: 'zkat'} + ).reply(201, {}) + return team.add('zkat', '@foo:cli', OPTS).then(ret => { + t.deepEqual(ret, {}, 'request succeeded') + }) +}) + +test('rm', t => { + tnock(t, REG).delete( + '/-/team/foo/cli/user', {user: 'zkat'} + ).reply(204, {}) + return team.rm('zkat', '@foo:cli', OPTS).then(ret => { + t.deepEqual(ret, {}, 'request succeeded') + }) +}) + +test('lsTeams', t => { + tnock(t, REG).get( + '/-/org/foo/team?format=cli' + ).reply(200, ['foo:bar', 'foo:cli']) + return team.lsTeams('foo', OPTS).then(ret => { + t.deepEqual(ret, ['foo:bar', 'foo:cli'], 'got teams') + }) +}) + +test('lsTeams error', t => { + tnock(t, REG).get( + '/-/org/foo/team?format=cli' + ).reply(500) + return team.lsTeams('foo', OPTS).then( + () => { throw new Error('should not succeed') }, + err => { t.equal(err.code, 'E500', 'got error code') } + ) +}) + +test('lsTeams.stream', t => { + tnock(t, REG).get( + '/-/org/foo/team?format=cli' + ).reply(200, ['foo:bar', 'foo:cli']) + return getStream.array(team.lsTeams.stream('foo', OPTS)).then(ret => { + t.deepEqual(ret, ['foo:bar', 'foo:cli'], 'got teams') + }) +}) + +test('lsUsers', t => { + tnock(t, REG).get( + '/-/team/foo/cli/user?format=cli' + ).reply(500) + return team.lsUsers('@foo:cli', OPTS).then( + () => { throw new Error('should not succeed') }, + err => { t.equal(err.code, 'E500', 'got error code') } + ) +}) + +test('lsUsers error', t => { + tnock(t, REG).get( + '/-/team/foo/cli/user?format=cli' + ).reply(200, ['iarna', 'zkat']) + return team.lsUsers('@foo:cli', OPTS).then(ret => { + t.deepEqual(ret, ['iarna', 'zkat'], 'got team members') + }) +}) + +test('lsUsers.stream', t => { + tnock(t, REG).get( + '/-/team/foo/cli/user?format=cli' + ).reply(200, ['iarna', 'zkat']) + return getStream.array(team.lsUsers.stream('@foo:cli', OPTS)).then(ret => { + t.deepEqual(ret, ['iarna', 'zkat'], 'got team members') + }) +}) + +test('edit', t => { + t.throws(() => { + team.edit() + }, /not implemented/) + t.done() +}) diff --git a/deps/npm/node_modules/libnpmteam/test/util/tnock.js b/deps/npm/node_modules/libnpmteam/test/util/tnock.js new file mode 100644 index 00000000000000..00b6e160e10192 --- /dev/null +++ b/deps/npm/node_modules/libnpmteam/test/util/tnock.js @@ -0,0 +1,12 @@ +'use strict' + +const nock = require('nock') + +module.exports = tnock +function tnock (t, host) { + const server = nock(host) + t.tearDown(function () { + server.done() + }) + return server +} diff --git a/deps/npm/node_modules/lru-cache/index.js b/deps/npm/node_modules/lru-cache/index.js index 3f047f8ca78aea..bd35b53589381c 100644 --- a/deps/npm/node_modules/lru-cache/index.js +++ b/deps/npm/node_modules/lru-cache/index.js @@ -11,7 +11,7 @@ var util = require('util') var Yallist = require('yallist') // use symbols if possible, otherwise just _props -var hasSymbol = typeof Symbol === 'function' +var hasSymbol = typeof Symbol === 'function' && process.env._nodeLRUCacheForceNoSymbol !== '1' var makeSymbol if (hasSymbol) { makeSymbol = function (key) { @@ -221,6 +221,7 @@ LRUCache.prototype.dumpLru = function () { return this[LRU_LIST] } +/* istanbul ignore next */ LRUCache.prototype.inspect = function (n, opts) { var str = 'LRUCache {' var extras = false @@ -434,7 +435,7 @@ function isStale (self, hit) { function trim (self) { if (self[LENGTH] > self[MAX]) { for (var walker = self[LRU_LIST].tail; - self[LENGTH] > self[MAX] && walker !== null;) { + self[LENGTH] > self[MAX] && walker !== null;) { // We know that we're about to delete this one, and also // what the next least recently used key will be, so just // go ahead and set it now. diff --git a/deps/npm/node_modules/lru-cache/package.json b/deps/npm/node_modules/lru-cache/package.json index 238a6894e929f4..14760df46579f5 100644 --- a/deps/npm/node_modules/lru-cache/package.json +++ b/deps/npm/node_modules/lru-cache/package.json @@ -1,43 +1,32 @@ { - "_args": [ - [ - "lru-cache@4.1.3", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lru-cache@4.1.3", - "_id": "lru-cache@4.1.3", + "_from": "lru-cache@4.1.5", + "_id": "lru-cache@4.1.5", "_inBundle": false, - "_integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "_integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "_location": "/lru-cache", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "lru-cache@4.1.3", + "raw": "lru-cache@4.1.5", "name": "lru-cache", "escapedName": "lru-cache", - "rawSpec": "4.1.3", + "rawSpec": "4.1.5", "saveSpec": null, - "fetchSpec": "4.1.3" + "fetchSpec": "4.1.5" }, "_requiredBy": [ + "#USER", "/", - "/cacache", "/cross-spawn", "/foreground-child/cross-spawn", - "/libnpmhook/npm-registry-fetch", "/make-fetch-happen", - "/npm-profile/cacache", - "/npm-profile/make-fetch-happen", - "/npm-registry-fetch", - "/npm-registry-fetch/cacache", - "/npm-registry-fetch/make-fetch-happen", - "/pacote" + "/npm-registry-fetch" ], - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "_spec": "4.1.3", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "_shasum": "8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd", + "_spec": "lru-cache@4.1.5", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me" @@ -45,15 +34,17 @@ "bugs": { "url": "https://github.com/isaacs/node-lru-cache/issues" }, + "bundleDependencies": false, "dependencies": { "pseudomap": "^1.0.2", "yallist": "^2.1.2" }, + "deprecated": false, "description": "A cache object that deletes the least-recently-used items.", "devDependencies": { "benchmark": "^2.1.4", - "standard": "^5.4.1", - "tap": "^11.1.4" + "standard": "^12.0.1", + "tap": "^12.1.0" }, "files": [ "index.js" @@ -72,11 +63,14 @@ "url": "git://github.com/isaacs/node-lru-cache.git" }, "scripts": { + "coveragerport": "tap --coverage-report=html", + "lintfix": "standard --fix test/*.js index.js", "postpublish": "git push origin --all; git push origin --tags", "posttest": "standard test/*.js index.js", - "postversion": "npm publish", + "postversion": "npm publish --tag=legacy", "preversion": "npm test", + "snap": "TAP_SNAPSHOT=1 tap test/*.js -J", "test": "tap test/*.js --100 -J" }, - "version": "4.1.3" + "version": "4.1.5" } diff --git a/deps/npm/node_modules/move-concurrently/node_modules/aproba/LICENSE b/deps/npm/node_modules/move-concurrently/node_modules/aproba/LICENSE new file mode 100644 index 00000000000000..2a4982dc40cb69 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/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/move-concurrently/node_modules/aproba/README.md b/deps/npm/node_modules/move-concurrently/node_modules/aproba/README.md new file mode 100644 index 00000000000000..e94799201ce046 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/aproba/README.md @@ -0,0 +1,93 @@ +aproba +====== + +A ridiculously 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 | `Array.isArray` 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` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### 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/move-concurrently/node_modules/aproba/index.js b/deps/npm/node_modules/move-concurrently/node_modules/aproba/index.js new file mode 100644 index 00000000000000..6f3f797c09a750 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +var types = { + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} + +function addSchema (schema, arity) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} + + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +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, expectedTypes, value) { + var valueType + Object.keys(types).forEach(function (typeCode) { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + var e = new Error(msg) + e.code = code + if (Error.captureStackTrace) Error.captureStackTrace(e, validate) + return e +} diff --git a/deps/npm/node_modules/move-concurrently/node_modules/aproba/package.json b/deps/npm/node_modules/move-concurrently/node_modules/aproba/package.json new file mode 100644 index 00000000000000..eba0d3e6ea8f57 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/aproba/package.json @@ -0,0 +1,62 @@ +{ + "_from": "aproba@^1.1.1", + "_id": "aproba@1.2.0", + "_inBundle": false, + "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "_location": "/move-concurrently/aproba", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aproba@^1.1.1", + "name": "aproba", + "escapedName": "aproba", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/move-concurrently" + ], + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", + "_spec": "aproba@^1.1.1", + "_where": "/Users/aeschright/code/cli/node_modules/move-concurrently", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "devDependencies": { + "standard": "^10.0.3", + "tap": "^10.0.2" + }, + "directories": { + "test": "test" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "name": "aproba", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "test": "standard && tap -j3 test/*.js" + }, + "version": "1.2.0" +} diff --git a/deps/npm/node_modules/npm-audit-report/CHANGELOG.md b/deps/npm/node_modules/npm-audit-report/CHANGELOG.md index 4cf6a1acda0a30..941a18741b6006 100644 --- a/deps/npm/node_modules/npm-audit-report/CHANGELOG.md +++ b/deps/npm/node_modules/npm-audit-report/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [1.3.2](https://github.com/npm/npm-audit-report/compare/v1.3.1...v1.3.2) (2018-12-18) + + +### Bug Fixes + +* **parseable:** add support for critical vulns and more resolves on update/install action ([#28](https://github.com/npm/npm-audit-report/issues/28)) ([5e27893](https://github.com/npm/npm-audit-report/commit/5e27893)) +* **security:** audit fix ([ff9faf3](https://github.com/npm/npm-audit-report/commit/ff9faf3)) +* **urls:** Replace hardcoded URL to advisory with a URL from audit response ([#34](https://github.com/npm/npm-audit-report/issues/34)) ([e2fe95b](https://github.com/npm/npm-audit-report/commit/e2fe95b)) + + + ## [1.3.1](https://github.com/npm/npm-audit-report/compare/v1.3.0...v1.3.1) (2018-07-10) diff --git a/deps/npm/node_modules/npm-audit-report/package.json b/deps/npm/node_modules/npm-audit-report/package.json index 0f76601e270204..905c0ce33da3db 100644 --- a/deps/npm/node_modules/npm-audit-report/package.json +++ b/deps/npm/node_modules/npm-audit-report/package.json @@ -1,27 +1,27 @@ { - "_from": "npm-audit-report@^1.2.1", - "_id": "npm-audit-report@1.3.1", + "_from": "npm-audit-report@1.3.2", + "_id": "npm-audit-report@1.3.2", "_inBundle": false, - "_integrity": "sha512-SjTF8ZP4rOu3JiFrTMi4M1CmVo2tni2sP4TzhyCMHwnMGf6XkdGLZKt9cdZ12esKf0mbQqFyU9LtY0SoeahL7g==", + "_integrity": "sha512-abeqS5ONyXNaZJPGAf6TOUMNdSe1Y6cpc9MLBRn+CuUoYbfdca6AxOyXVlfIv9OgKX+cacblbG5w7A6ccwoTPw==", "_location": "/npm-audit-report", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "npm-audit-report@^1.2.1", + "raw": "npm-audit-report@1.3.2", "name": "npm-audit-report", "escapedName": "npm-audit-report", - "rawSpec": "^1.2.1", + "rawSpec": "1.3.2", "saveSpec": null, - "fetchSpec": "^1.2.1" + "fetchSpec": "1.3.2" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-audit-report/-/npm-audit-report-1.3.1.tgz", - "_shasum": "e79ea1fcb5ffaf3031102b389d5222c2b0459632", - "_spec": "npm-audit-report@^1.2.1", + "_resolved": "https://registry.npmjs.org/npm-audit-report/-/npm-audit-report-1.3.2.tgz", + "_shasum": "303bc78cd9e4c226415076a4f7e528c89fc77018", + "_spec": "npm-audit-report@1.3.2", "_where": "/Users/zkat/Documents/code/work/npm", "author": { "name": "Adam Baldwin" @@ -76,5 +76,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "1.3.1" + "version": "1.3.2" } diff --git a/deps/npm/node_modules/npm-audit-report/reporters/detail.js b/deps/npm/node_modules/npm-audit-report/reporters/detail.js index 2cbb8fea50b258..f6e822eb7ae6f7 100644 --- a/deps/npm/node_modules/npm-audit-report/reporters/detail.js +++ b/deps/npm/node_modules/npm-audit-report/reporters/detail.js @@ -117,7 +117,7 @@ const report = function (data, options) { {'Package': advisory.module_name}, {'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}`}, {'Path': `${resolution.path.split('>').join(Utils.color(' > ', 'grey', config.withColor))}`}, - {'More info': `https://nodesecurity.io/advisories/${advisory.id}`} + {'More info': advisory.url || `https://www.npmjs.com/advisories/${advisory.id}`} ) log(table.toString() + '\n\n') @@ -160,7 +160,7 @@ const report = function (data, options) { {'Patched in': patchedIn}, {'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}`}, {'Path': `${resolution.path.split('>').join(Utils.color(' > ', 'grey', config.withColor))}`}, - {'More info': `https://nodesecurity.io/advisories/${advisory.id}`} + {'More info': advisory.url || `https://www.npmjs.com/advisories/${advisory.id}`} ) log(table.toString()) }) diff --git a/deps/npm/node_modules/npm-audit-report/reporters/parseable.js b/deps/npm/node_modules/npm-audit-report/reporters/parseable.js index 363359772916c3..1d46ef22716cd4 100644 --- a/deps/npm/node_modules/npm-audit-report/reporters/parseable.js +++ b/deps/npm/node_modules/npm-audit-report/reporters/parseable.js @@ -11,6 +11,7 @@ const report = function (data, options) { const actions = function (data, config) { let accumulator = { + critical: '', high: '', moderate: '', low: '' @@ -25,16 +26,18 @@ const report = function (data, options) { l.recommendation = recommendation.cmd l.breaking = recommendation.isBreaking ? 'Y' : 'N' - // TODO: Verify: The advisory seems to repeat and be the same for all the 'resolves'. Is it true? - const advisory = data.advisories[action.resolves[0].id] - l.sevLevel = advisory.severity - l.severity = advisory.title - l.package = advisory.module_name - l.moreInfo = `https://nodesecurity.io/advisories/${advisory.id}` - l.path = action.resolves[0].path + action.resolves.forEach((resolution) => { + const advisory = data.advisories[resolution.id] + + l.sevLevel = advisory.severity + l.severity = advisory.title + l.package = advisory.module_name + l.moreInfo = advisory.url || `https://www.npmjs.com/advisories/${advisory.id}` + l.path = resolution.path - accumulator[advisory.severity] += [action.action, l.package, l.sevLevel, l.recommendation, l.severity, l.moreInfo, l.path, l.breaking] - .join('\t') + '\n' + accumulator[advisory.severity] += [action.action, l.package, l.sevLevel, l.recommendation, l.severity, l.moreInfo, l.path, l.breaking] + .join('\t') + '\n' + }) // forEach resolves } if (action.action === 'review') { @@ -44,7 +47,7 @@ const report = function (data, options) { l.sevLevel = advisory.severity l.severity = advisory.title l.package = advisory.module_name - l.moreInfo = `https://nodesecurity.io/advisories/${advisory.id}` + l.moreInfo = advisory.url || `https://www.npmjs.com/advisories/${advisory.id}` l.patchedIn = advisory.patched_versions.replace(' ', '') === '<0.0.0' ? 'No patch available' : advisory.patched_versions l.path = resolution.path @@ -53,7 +56,7 @@ const report = function (data, options) { } // is review }) // forEach actions } - return accumulator['high'] + accumulator['moderate'] + accumulator['low'] + return accumulator['critical'] + accumulator['high'] + accumulator['moderate'] + accumulator['low'] } const exitCode = function (metadata) { diff --git a/deps/npm/node_modules/npm-packlist/index.js b/deps/npm/node_modules/npm-packlist/index.js index 2cdd37ec3df06b..110a344cb04d96 100644 --- a/deps/npm/node_modules/npm-packlist/index.js +++ b/deps/npm/node_modules/npm-packlist/index.js @@ -57,7 +57,11 @@ const npmWalker = Class => class Walker extends Class { opt.includeEmpty = false opt.path = opt.path || process.cwd() - opt.follow = path.basename(opt.path) === 'node_modules' + const dirName = path.basename(opt.path) + const parentName = path.basename(path.dirname(opt.path)) + opt.follow = + dirName === 'node_modules' || + (parentName === 'node_modules' && /^@/.test(dirName)) super(opt) // ignore a bunch of things by default at the root level. diff --git a/deps/npm/node_modules/npm-packlist/package.json b/deps/npm/node_modules/npm-packlist/package.json index f1188c393f2c99..d37a7bd1bb4f61 100644 --- a/deps/npm/node_modules/npm-packlist/package.json +++ b/deps/npm/node_modules/npm-packlist/package.json @@ -1,29 +1,29 @@ { - "_from": "npm-packlist@1.1.12", - "_id": "npm-packlist@1.1.12", + "_from": "npm-packlist@1.2.0", + "_id": "npm-packlist@1.2.0", "_inBundle": false, - "_integrity": "sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g==", + "_integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", "_location": "/npm-packlist", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "npm-packlist@1.1.12", + "raw": "npm-packlist@1.2.0", "name": "npm-packlist", "escapedName": "npm-packlist", - "rawSpec": "1.1.12", + "rawSpec": "1.2.0", "saveSpec": null, - "fetchSpec": "1.1.12" + "fetchSpec": "1.2.0" }, "_requiredBy": [ "#USER", "/", "/pacote" ], - "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.12.tgz", - "_shasum": "22bde2ebc12e72ca482abd67afc51eb49377243a", - "_spec": "npm-packlist@1.1.12", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz", + "_shasum": "55a60e793e272f00862c7089274439a4cc31fc7f", + "_spec": "npm-packlist@1.2.0", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -64,5 +64,5 @@ "preversion": "npm test", "test": "tap test/*.js --100 -J" }, - "version": "1.1.12" + "version": "1.2.0" } diff --git a/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md b/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md index 5f53e8fce591f7..2112665f7572eb 100644 --- a/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md +++ b/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md @@ -2,6 +2,46 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [2.2.3](https://github.com/zkat/npm-pick-manifest/compare/v2.2.2...v2.2.3) (2018-10-31) + + +### Bug Fixes + +* **enjoyBy:** rework semantics for enjoyBy again ([5e89b62](https://github.com/zkat/npm-pick-manifest/commit/5e89b62)) + + + + +## [2.2.2](https://github.com/zkat/npm-pick-manifest/compare/v2.2.1...v2.2.2) (2018-10-31) + + +### Bug Fixes + +* **enjoyBy:** rework semantics for enjoyBy ([5684f45](https://github.com/zkat/npm-pick-manifest/commit/5684f45)) + + + + +## [2.2.1](https://github.com/zkat/npm-pick-manifest/compare/v2.2.0...v2.2.1) (2018-10-30) + + + + +# [2.2.0](https://github.com/zkat/npm-pick-manifest/compare/v2.1.0...v2.2.0) (2018-10-30) + + +### Bug Fixes + +* **audit:** npm audit fix --force ([d5ae6c4](https://github.com/zkat/npm-pick-manifest/commit/d5ae6c4)) + + +### Features + +* **enjoyBy:** add opts.enjoyBy option to filter versions by date ([0b8a790](https://github.com/zkat/npm-pick-manifest/commit/0b8a790)) + + + # [2.1.0](https://github.com/zkat/npm-pick-manifest/compare/v2.0.1...v2.1.0) (2017-10-18) diff --git a/deps/npm/node_modules/npm-pick-manifest/README.md b/deps/npm/node_modules/npm-pick-manifest/README.md index 206af2f317f82a..a9a027bfcb4600 100644 --- a/deps/npm/node_modules/npm-pick-manifest/README.md +++ b/deps/npm/node_modules/npm-pick-manifest/README.md @@ -74,3 +74,11 @@ The function will throw `ETARGET` if there was no matching manifest, and If `opts.defaultTag` is provided, it will be used instead of `latest`. That is, if that tag matches the selector, it will be used, even if a higher available version matches the range. + +If `opts.enjoyBy` is provided, it should be something that can be passed to `new +Date(x)`, such as a `Date` object or a timestamp string. It will be used to +filter the selected versions such that only versions less than or equal to +`enjoyBy` are considered. + +If `opts.includeDeprecated` passed in as true, deprecated versions will be +selected. By default, deprecated versions other than `defaultTag` are ignored. diff --git a/deps/npm/node_modules/npm-pick-manifest/index.js b/deps/npm/node_modules/npm-pick-manifest/index.js index 133b62723457ba..d9a8373e57f142 100644 --- a/deps/npm/node_modules/npm-pick-manifest/index.js +++ b/deps/npm/node_modules/npm-pick-manifest/index.js @@ -1,19 +1,35 @@ 'use strict' +const figgyPudding = require('figgy-pudding') const npa = require('npm-package-arg') const semver = require('semver') +const PickerOpts = figgyPudding({ + defaultTag: { default: 'latest' }, + enjoyBy: {}, + includeDeprecated: { default: false } +}) + module.exports = pickManifest function pickManifest (packument, wanted, opts) { - opts = opts || {} + opts = PickerOpts(opts) + const time = opts.enjoyBy && packument.time && +(new Date(opts.enjoyBy)) const spec = npa.resolve(packument.name, wanted) const type = spec.type if (type === 'version' || type === 'range') { wanted = semver.clean(wanted, true) || wanted } const distTags = packument['dist-tags'] || {} - const versions = Object.keys(packument.versions || {}).filter(v => semver.valid(v, true)) - const undeprecated = versions.filter(v => !packument.versions[v].deprecated) + const versions = Object.keys(packument.versions || {}).filter(v => { + return semver.valid(v, true) + }) + + function enjoyableBy (v) { + return !time || ( + packument.time[v] && time >= +(new Date(packument.time[v])) + ) + } + let err if (!versions.length) { @@ -27,43 +43,69 @@ function pickManifest (packument, wanted, opts) { let target - if (type === 'tag') { + if (type === 'tag' && enjoyableBy(distTags[wanted])) { target = distTags[wanted] } else if (type === 'version') { target = wanted - } else if (type !== 'range') { + } else if (type !== 'range' && enjoyableBy(distTags[wanted])) { throw new Error('Only tag, version, and range are supported') } - const tagVersion = distTags[opts.defaultTag || 'latest'] + const tagVersion = distTags[opts.defaultTag] if ( !target && tagVersion && packument.versions[tagVersion] && + enjoyableBy(tagVersion) && semver.satisfies(tagVersion, wanted, true) ) { target = tagVersion } if (!target && !opts.includeDeprecated) { + const undeprecated = versions.filter(v => !packument.versions[v].deprecated && enjoyableBy(v) + ) target = semver.maxSatisfying(undeprecated, wanted, true) } if (!target) { - target = semver.maxSatisfying(versions, wanted, true) + const stillFresh = versions.filter(enjoyableBy) + target = semver.maxSatisfying(stillFresh, wanted, true) } - if (!target && wanted === '*') { + if (!target && wanted === '*' && enjoyableBy(tagVersion)) { // This specific corner is meant for the case where // someone is using `*` as a selector, but all versions // are pre-releases, which don't match ranges at all. target = tagVersion } - const manifest = target && packument.versions[target] + if ( + !target && + time && + type === 'tag' && + distTags[wanted] && + !enjoyableBy(distTags[wanted]) + ) { + const stillFresh = versions.filter(v => + enjoyableBy(v) && semver.lte(v, distTags[wanted], true) + ).sort(semver.rcompare) + target = stillFresh[0] + } + + const manifest = ( + target && + packument.versions[target] + ) if (!manifest) { err = new Error( - `No matching version found for ${packument.name}@${wanted}` + `No matching version found for ${packument.name}@${wanted}${ + opts.enjoyBy + ? ` with an Enjoy By date of ${ + new Date(opts.enjoyBy).toLocaleString() + }. Maybe try a different date?` + : '' + }` ) err.code = 'ETARGET' err.name = packument.name diff --git a/deps/npm/node_modules/npm-pick-manifest/package.json b/deps/npm/node_modules/npm-pick-manifest/package.json index 4cf8bf1a13c6c0..a80c76d372d015 100644 --- a/deps/npm/node_modules/npm-pick-manifest/package.json +++ b/deps/npm/node_modules/npm-pick-manifest/package.json @@ -1,33 +1,28 @@ { - "_args": [ - [ - "npm-pick-manifest@2.1.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "npm-pick-manifest@2.1.0", - "_id": "npm-pick-manifest@2.1.0", + "_from": "npm-pick-manifest@2.2.3", + "_id": "npm-pick-manifest@2.2.3", "_inBundle": false, - "_integrity": "sha512-q9zLP8cTr8xKPmMZN3naxp1k/NxVFsjxN6uWuO1tiw9gxg7wZWQ/b5UTfzD0ANw2q1lQxdLKTeCCksq+bPSgbQ==", + "_integrity": "sha512-+IluBC5K201+gRU85vFlUwX3PFShZAbAgDNp2ewJdWMVSppdo/Zih0ul2Ecky/X7b51J7LrrUAP+XOmOCvYZqA==", "_location": "/npm-pick-manifest", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "npm-pick-manifest@2.1.0", + "raw": "npm-pick-manifest@2.2.3", "name": "npm-pick-manifest", "escapedName": "npm-pick-manifest", - "rawSpec": "2.1.0", + "rawSpec": "2.2.3", "saveSpec": null, - "fetchSpec": "2.1.0" + "fetchSpec": "2.2.3" }, "_requiredBy": [ - "/", - "/pacote" + "#USER", + "/" ], - "_resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-2.1.0.tgz", - "_spec": "2.1.0", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-2.2.3.tgz", + "_shasum": "32111d2a9562638bb2c8f2bf27f7f3092c8fae40", + "_spec": "npm-pick-manifest@2.2.3", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -35,6 +30,7 @@ "bugs": { "url": "https://github.com/zkat/npm-pick-manifest/issues" }, + "bundleDependencies": false, "config": { "nyc": { "exclude": [ @@ -44,15 +40,17 @@ } }, "dependencies": { + "figgy-pudding": "^3.5.1", "npm-package-arg": "^6.0.0", "semver": "^5.4.1" }, + "deprecated": false, "description": "Resolves a matching manifest from a package metadata document according to standard npm semver resolution rules.", "devDependencies": { - "nyc": "^11.2.1", + "nyc": "^13.1.0", "standard": "^10.0.3", - "standard-version": "^4.2.0", - "tap": "^10.7.0", + "standard-version": "^4.4.0", + "tap": "^12.0.1", "weallbehave": "^1.2.0", "weallcontribute": "^1.0.8" }, @@ -81,5 +79,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "2.1.0" + "version": "2.2.3" } diff --git a/deps/npm/node_modules/npm-profile/CHANGELOG.md b/deps/npm/node_modules/npm-profile/CHANGELOG.md index cc36c3857054bf..6d937580c307b0 100644 --- a/deps/npm/node_modules/npm-profile/CHANGELOG.md +++ b/deps/npm/node_modules/npm-profile/CHANGELOG.md @@ -1,3 +1,14 @@ +# v4.0.1 (2018-08-29) + +- `opts.password` needs to be base64-encoded when passed in for login +- Bump `npm-registry-fetch` dep because we depend on `opts.forceAuth` + +# v4.0.0 (2018-08-28) + +## BREAKING CHANGES: + +- Networking and auth-related options now use the latest [`npm-registry-fetch` config format](https://www.npmjs.com/package/npm-registry-fetch#fetch-opts). + # v3.0.2 (2018-06-07) - Allow newer make-fetch-happen. diff --git a/deps/npm/node_modules/npm-profile/README.md b/deps/npm/node_modules/npm-profile/README.md index 1937e23f7228af..7a80a729e8996d 100644 --- a/deps/npm/node_modules/npm-profile/README.md +++ b/deps/npm/node_modules/npm-profile/README.md @@ -4,9 +4,8 @@ Provides functions for fetching and updating an npmjs.com profile. ```js const profile = require('npm-profile') -profile.get(registry, {token}).then(result => { - // … -}) +const result = await profile.get(registry, {token}) +//... ``` The API that this implements is documented here: @@ -14,22 +13,37 @@ The API that this implements is documented here: * [authentication](https://github.com/npm/registry/blob/master/docs/user/authentication.md) * [profile editing](https://github.com/npm/registry/blob/master/docs/user/profile.md) (and two-factor authentication) -## Functions +## Table of Contents + +* [API](#api) + * Login and Account Creation + * [`adduser()`](#adduser) + * [`login()`](#login) + * [`adduserWeb()`](#adduser-web) + * [`loginWeb()`](#login-web) + * [`adduserCouch()`](#adduser-couch) + * [`loginCouch()`](#login-couch) + * Profile Data Management + * [`get()`](#get) + * [`set()`](#set) + * Token Management + * [`listTokens()`](#list-tokens) + * [`removeToken()`](#remove-token) + * [`createToken()`](#create-token) -### profile.adduser(opener, prompter, config) → Promise +## API + +### `> profile.adduser(opener, prompter, [opts]) → Promise` Tries to create a user new web based login, if that fails it falls back to using the legacy CouchDB APIs. * `opener` Function (url) → Promise, returns a promise that resolves after a browser has been opened for the user at `url`. * `prompter` Function (creds) → Promise, returns a promise that resolves to an object with `username`, `email` and `password` properties. -* `config` Object +* [`opts`](#opts) Object (optional) plus extra keys: * `creds` Object, passed through to prompter, common values are: * `username` String, default value for username * `email` String, default value for email - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. #### **Promise Value** @@ -50,21 +64,16 @@ on this account isn't allowed from then the `code` will be set to `EAUTHIP`. Otherwise the code will be `'E'` followed by the HTTP response code, for example a Forbidden response would be `E403`. -### profile.login(opener, prompter, config) → Promise +### `> profile.login(opener, prompter, [opts]) → Promise` Tries to login using new web based login, if that fails it falls back to using the legacy CouchDB APIs. * `opener` Function (url) → Promise, returns a promise that resolves after a browser has been opened for the user at `url`. * `prompter` Function (creds) → Promise, returns a promise that resolves to an object with `username`, and `password` properties. -* `config` Object +* [`opts`](#opts) Object (optional) plus extra keys: * `creds` Object, passed through to prompter, common values are: * `name` String, default value for username - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `auth` Object, properties: `otp` - the one-time password from a two-factor authentication device. - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. #### **Promise Value** @@ -89,16 +98,13 @@ on this account isn't allowed from then the `code` will be set to `EAUTHIP`. Otherwise the code will be `'E'` followed by the HTTP response code, for example a Forbidden response would be `E403`. -### profile.adduserWeb(opener, config) → Promise +### `> profile.adduserWeb(opener, [opts]) → Promise` Tries to create a user new web based login, if that fails it falls back to using the legacy CouchDB APIs. * `opener` Function (url) → Promise, returns a promise that resolves after a browser has been opened for the user at `url`. -* `config` Object - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. +* [`opts`](#opts) Object #### **Promise Value** @@ -123,16 +129,13 @@ on this account isn't allowed from then the `code` will be set to `EAUTHIP`. Otherwise the code will be `'E'` followed by the HTTP response code, for example a Forbidden response would be `E403`. -### profile.loginWeb(opener, config) → Promise +### `> profile.loginWeb(opener, [opts]) → Promise` Tries to login using new web based login, if that fails it falls back to using the legacy CouchDB APIs. * `opener` Function (url) → Promise, returns a promise that resolves after a browser has been opened for the user at `url`. -* `config` Object - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. +* [`opts`](#opts) Object (optional) #### **Promise Value** @@ -151,19 +154,17 @@ If the registry does not support web-login then an error will be thrown with its `code` property set to `ENYI` . You should retry with `loginCouch`. If you use `login` then this fallback will be done automatically. - If the action was denied because it came from an IP address that this action on this account isn't allowed from then the `code` will be set to `EAUTHIP`. Otherwise the code will be `'E'` followed by the HTTP response code, for example a Forbidden response would be `E403`. -### profile.adduserCouch(username, email, password, config) → Promise +### `> profile.adduserCouch(username, email, password, [opts]) → Promise` ```js -profile.adduser(username, email, password, {registry}).then(result => { - // do something with result.token -}) +const {token} = await profile.adduser(username, email, password, {registry}) +// `token` can be passed in through `opts` for authentication. ``` Creates a new user on the server along with a fresh bearer token for future @@ -176,10 +177,7 @@ this is registry specific and not guaranteed. * `username` String * `email` String * `password` String -* `config` Object - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. +* [`opts`](#opts) Object (optional) #### **Promise Value** @@ -203,18 +201,19 @@ on this account isn't allowed from then the `code` will be set to `EAUTHIP`. Otherwise the code will be `'E'` followed by the HTTP response code, for example a Forbidden response would be `E403`. -### profile.loginCouch(username, password, config) → Promise +### `> profile.loginCouch(username, password, [opts]) → Promise` ```js -profile.login(username, password, {registry}).catch(err => { +let token +try { + {token} = await profile.login(username, password, {registry}) +} catch (err) { if (err.code === 'otp') { - return getOTPFromSomewhere().then(otp => { - return profile.login(username, password, {registry, auth: {otp}}) - }) + const otp = await getOTPFromSomewhere() + {token} = await profile.login(username, password, {otp}) } -}).then(result => { - // do something with result.token -}) +} +// `token` can now be passed in through `opts` for authentication. ``` Logs you into an existing user. Does not create the user if they do not @@ -224,12 +223,7 @@ future authentication. This is what you use as an `authToken` in an `.npmrc`. * `username` String * `email` String * `password` String -* `config` Object - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `auth` Object, properties: `otp` — the one-time password from a two-factor - authentication device. - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. +* [`opts`](#opts) Object (optional) #### **Promise Value** @@ -254,24 +248,16 @@ If the error was neither of these then the error object will have a `code` property set to the HTTP response code and a `headers` property with the HTTP headers in the response. -### profile.get(config) → Promise +### `> profile.get([opts]) → Promise` ```js -profile.get(registry, {auth: {token}}).then(userProfile => { - // do something with userProfile -}) +const {name, email} = await profile.get({token}) +console.log(`${token} belongs to https://npm.im/~${name}, (mailto:${email})`) ``` Fetch profile information for the authenticated user. -* `config` Object - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `auth` Object, properties: `token` — a bearer token returned from - `adduser`, `login` or `createToken`, or, `username`, `password` (and - optionally `otp`). Authenticating for this command via a username and - password will likely not be supported in the future. - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. +* [`opts`](#opts) Object #### **Promise Value** @@ -313,24 +299,17 @@ on this account isn't allowed from then the `code` will be set to `EAUTHIP`. Otherwise the code will be the HTTP response code. -### profile.set(profileData, config) → Promise +### `> profile.set(profileData, [opts]) → Promise` ```js -profile.set({github: 'great-github-account-name'}, {registry, auth: {token}}) +await profile.set({github: 'great-github-account-name'}, {token}) ``` Update profile information for the authenticated user. * `profileData` An object, like that returned from `profile.get`, but see below for caveats relating to `password`, `tfa` and `cidr_whitelist`. -* `config` Object - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `auth` Object, properties: `token` — a bearer token returned from - `adduser`, `login` or `createToken`, or, `username`, `password` (and - optionally `otp`). Authenticating for this command via a username and - password will likely not be supported in the future. - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. +* [`opts`](#opts) Object (optional) #### **SETTING `password`** @@ -340,7 +319,12 @@ and `new` properties, where the former has the user's current password and the latter has the desired new password. For example ```js -profile.set({password: {old: 'abc123', new: 'my new (more secure) password'}}, {registry, auth: {token}}) +await profile.set({ + password: { + old: 'abc123', + new: 'my new (more secure) password' + } +}, {token}) ``` #### **SETTING `cidr_whitelist`** @@ -350,7 +334,9 @@ Be very careful as it's possible to lock yourself out of your account with this. This is not currently exposed in `npm` itself. ```js -profile.set({cidr_whitelist: [ '8.8.8.8/32' ], {registry, auth: {token}}) +await profile.set({ + cidr_whitelist: [ '8.8.8.8/32' ] +}, {token}) // ↑ only one of google's dns servers can now access this account. ``` @@ -360,7 +346,7 @@ Enabling two-factor authentication is a multi-step process. 1. Call `profile.get` and check the status of `tfa`. If `pending` is true then you'll need to disable it with `profile.set({tfa: {password, mode: 'disable'}, …)`. -2. `profile.set({tfa: {password, mode}}, {registry, auth: {token}})` +2. `profile.set({tfa: {password, mode}}, {registry, token})` * Note that the user's `password` is required here in the `tfa` object, regardless of how you're authenticating. * `mode` is either `auth-only` which requires an `otp` when calling `login` @@ -381,7 +367,7 @@ Enabling two-factor authentication is a multi-step process. and they can type or copy paste that in. 4. To complete setting up two factor auth you need to make a second call to `profile.set` with `tfa` set to an array of TWO codes from the user's - authenticator, eg: `profile.set(tfa: [otp1, otp2]}, registry, {token})` + authenticator, eg: `profile.set(tfa: [otp1, otp2]}, {registry, token})` 5. On success you'll get a result object with a `tfa` property that has an array of one-time-use recovery codes. These are used to authenticate later if the second factor is lost and generally should be printed and @@ -391,7 +377,7 @@ Disabling two-factor authentication is more straightforward, set the `tfa` attribute to an object with a `password` property and a `mode` of `disable`. ```js -profile.set({tfa: {password, mode: 'disable'}, {registry, auth: {token}}} +await profile.set({tfa: {password, mode: 'disable'}}, {token}) ``` #### **Promise Value** @@ -412,24 +398,16 @@ on this account isn't allowed from then the `code` will be set to `EAUTHIP`. Otherwise the code will be the HTTP response code. -### profile.listTokens(config) → Promise +### `> profile.listTokens([opts]) → Promise` ```js -profile.listTokens(registry, {token}).then(tokens => { - // do something with tokens -}) +const tokens = await profile.listTokens({registry, token}) +console.log(`Number of tokens in your accounts: ${tokens.length}`) ``` Fetch a list of all of the authentication tokens the authenticated user has. -* `config` Object - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `auth` Object, properties: `token` — a bearer token returned from - `adduser`, `login` or `createToken`, or, `username`, `password` (and - optionally `otp`). Authenticating for this command via a username and - password will likely not be supported in the future. - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. +* [`opts`](#opts) Object (optional) #### **Promise Value** @@ -456,25 +434,17 @@ on this account isn't allowed from then the `code` will be set to `EAUTHIP`. Otherwise the code will be the HTTP response code. -### profile.removeToken(token|key, config) → Promise +### `> profile.removeToken(token|key, opts) → Promise` ```js -profile.removeToken(key, registry, {token}).then(() => { - // token is gone! -}) +await profile.removeToken(key, {token}) +// token is gone! ``` Remove a specific authentication token. * `token|key` String, either a complete authentication token or the key returned by `profile.listTokens`. -* `config` Object - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `auth` Object, properties: `token` — a bearer token returned from - `adduser`, `login` or `createToken`, or, `username`, `password` (and - optionally `otp`). Authenticating for this command via a username and - password will likely not be supported in the future. - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. +* [`opts`](#opts) Object (optional) #### **Promise Value** @@ -494,12 +464,13 @@ on this account isn't allowed from then the `code` will be set to `EAUTHIP`. Otherwise the code will be the HTTP response code. -### profile.createToken(password, readonly, cidr_whitelist, config) → Promise +### `> profile.createToken(password, readonly, cidr_whitelist, [opts]) → Promise` ```js -profile.createToken(password, readonly, cidr_whitelist, registry, {token, otp}).then(newToken => { - // do something with the newToken -}) +const newToken = await profile.createToken( + password, readonly, cidr_whitelist, {token, otp} +) +// do something with the newToken ``` Create a new authentication token, possibly with restrictions. @@ -507,21 +478,14 @@ Create a new authentication token, possibly with restrictions. * `password` String * `readonly` Boolean * `cidr_whitelist` Array -* `config` Object - * `registry` String (for reference, the npm registry is `https://registry.npmjs.org`) - * `auth` Object, properties: `token` — a bearer token returned from - `adduser`, `login` or `createToken`, or, `username`, `password` (and - optionally `otp`). Authenticating for this command via a username and - password will likely not be supported in the future. - * `opts` Object, [make-fetch-happen options](https://www.npmjs.com/package/make-fetch-happen#extra-options) for setting - things like cache, proxy, SSL CA and retry rules. +* [`opts`](#opts) Object Optional #### **Promise Value** The promise will resolve with an object very much like the one's returned by `profile.listTokens`. The only difference is that `token` is not truncated. -``` +```js { token: String, key: String, // sha512 hash of the token UUID @@ -545,12 +509,28 @@ on this account isn't allowed from then the `code` will be set to `EAUTHIP`. Otherwise the code will be the HTTP response code. -## Logging +### options objects + +The various API functions accept an optional `opts` object as a final +argument. This opts object can either be a regular Object, or a +[`figgy-pudding`](https://npm.im/figgy-pudding) options object instance. + +Unless otherwise noted, the options accepted are the same as the +[`npm-registry-fetch` +options](https://www.npmjs.com/package/npm-registry-fetch#fetch-opts). + +Of particular note are `opts.registry`, and the auth-related options: + +* `opts.token` - used for Bearer auth +* `opts.username` and `opts.password` - used for Basic auth +* `opts.otp` - the 2fa OTP token + +## Logging This modules logs by emitting `log` events on the global `process` object. These events look like this: -``` +```js process.emit('log', 'loglevel', 'feature', 'message part 1', 'part 2', 'part 3', 'etc') ``` @@ -562,13 +542,13 @@ The remaining arguments are evaluated like `console.log` and joined together wit A real world example of this is: -``` - process.emit('log', 'http', 'request', '→',conf.method || 'GET', conf.target) +```js + process.emit('log', 'http', 'request', '→', conf.method || 'GET', conf.target) ``` To handle the log events, you would do something like this: -``` +```js const log = require('npmlog') process.on('log', function (level) { return log[level].apply(log, [].slice.call(arguments, 1)) diff --git a/deps/npm/node_modules/npm-profile/index.js b/deps/npm/node_modules/npm-profile/index.js index 023ddae40c8c6f..b7f753fb4d41da 100644 --- a/deps/npm/node_modules/npm-profile/index.js +++ b/deps/npm/node_modules/npm-profile/index.js @@ -1,8 +1,10 @@ 'use strict' -const fetch = require('make-fetch-happen').defaults({retry: false}) -const validate = require('aproba') -const url = require('url') + +const fetch = require('npm-registry-fetch') +const {HttpErrorBase} = require('npm-registry-fetch/errors.js') const os = require('os') +const pudding = require('figgy-pudding') +const validate = require('aproba') exports.adduserCouch = adduserCouch exports.loginCouch = loginCouch @@ -16,99 +18,83 @@ exports.listTokens = listTokens exports.removeToken = removeToken exports.createToken = createToken +const ProfileConfig = pudding({ + creds: {}, + hostname: {}, + otp: {} +}) + // try loginWeb, catch the "not supported" message and fall back to couch -function login (opener, prompter, conf) { +function login (opener, prompter, opts) { validate('FFO', arguments) - return loginWeb(opener, conf).catch(er => { + opts = ProfileConfig(opts) + return loginWeb(opener, opts).catch(er => { if (er instanceof WebLoginNotSupported) { process.emit('log', 'verbose', 'web login not supported, trying couch') - return prompter(conf.creds) - .then(data => loginCouch(data.username, data.password, conf)) + return prompter(opts.creds) + .then(data => loginCouch(data.username, data.password, opts)) } else { throw er } }) } -function adduser (opener, prompter, conf) { +function adduser (opener, prompter, opts) { validate('FFO', arguments) - return adduserWeb(opener, conf).catch(er => { + opts = ProfileConfig(opts) + return adduserWeb(opener, opts).catch(er => { if (er instanceof WebLoginNotSupported) { process.emit('log', 'verbose', 'web adduser not supported, trying couch') - return prompter(conf.creds) - .then(data => adduserCouch(data.username, data.email, data.password, conf)) + return prompter(opts.creds) + .then(data => adduserCouch(data.username, data.email, data.password, opts)) } else { throw er } }) } -function adduserWeb (opener, conf) { +function adduserWeb (opener, opts) { validate('FO', arguments) const body = { create: true } process.emit('log', 'verbose', 'web adduser', 'before first POST') - return webAuth(opener, conf, body) + return webAuth(opener, opts, body) } -function loginWeb (opener, conf) { +function loginWeb (opener, opts) { validate('FO', arguments) process.emit('log', 'verbose', 'web login', 'before first POST') - return webAuth(opener, conf, {}) + return webAuth(opener, opts, {}) } -function webAuth (opener, conf, body) { - if (!conf.opts) conf.opts = {} - const target = url.resolve(conf.registry, '-/v1/login') - body.hostname = conf.hostname || os.hostname() - return fetchJSON({ - target: target, +function webAuth (opener, opts, body) { + opts = ProfileConfig(opts) + body.hostname = opts.hostname || os.hostname() + const target = '/-/v1/login' + return fetch(target, opts.concat({ method: 'POST', - body: body, - opts: conf.opts, - saveResponse: true - }).then(result => { - const res = result[0] - const content = result[1] + body + })).then(res => { + return Promise.all([res, res.json()]) + }).then(([res, content]) => { + const {doneUrl, loginUrl} = content process.emit('log', 'verbose', 'web auth', 'got response', content) - const doneUrl = content.doneUrl - const loginUrl = content.loginUrl - if (typeof doneUrl !== 'string' || - typeof loginUrl !== 'string' || - !doneUrl || !loginUrl) { - throw new WebLoginInvalidResponse('POST', target, res, content) + if ( + typeof doneUrl !== 'string' || + typeof loginUrl !== 'string' || + !doneUrl || + !loginUrl + ) { + throw new WebLoginInvalidResponse('POST', res, content) } + return content + }).then(({doneUrl, loginUrl}) => { process.emit('log', 'verbose', 'web auth', 'opening url pair') - const doneConf = { - target: doneUrl, - method: 'GET', - opts: conf.opts, - saveResponse: true - } - return opener(loginUrl).then(() => fetchJSON(doneConf)).then(onDone) - function onDone (result) { - const res = result[0] - const content = result[1] - if (res.status === 200) { - if (!content.token) { - throw new WebLoginInvalidResponse('GET', doneUrl, res, content) - } else { - return content - } - } else if (res.status === 202) { - const retry = +res.headers.get('retry-after') - if (retry > 0) { - return new Promise(resolve => setTimeout(resolve, 1000 * retry)) - .then(() => fetchJSON(doneConf)).then(onDone) - } else { - return fetchJSON(doneConf).then(onDone) - } - } else { - throw new WebLoginInvalidResponse('GET', doneUrl, res, content) - } - } + return opener(loginUrl).then( + () => webAuthCheckLogin(doneUrl, opts.concat({cache: false})) + ) }).catch(er => { if ((er.statusCode >= 400 && er.statusCode <= 499) || er.statusCode === 500) { - throw new WebLoginNotSupported('POST', target, { + throw new WebLoginNotSupported('POST', { status: er.statusCode, headers: { raw: () => er.headers } }, er.body) @@ -118,10 +104,33 @@ function webAuth (opener, conf, body) { }) } -function adduserCouch (username, email, password, conf) { +function webAuthCheckLogin (doneUrl, opts) { + return fetch(doneUrl, opts).then(res => { + return Promise.all([res, res.json()]) + }).then(([res, content]) => { + if (res.status === 200) { + if (!content.token) { + throw new WebLoginInvalidResponse('GET', res, content) + } else { + return content + } + } else if (res.status === 202) { + const retry = +res.headers.get('retry-after') * 1000 + if (retry > 0) { + return sleep(retry).then(() => webAuthCheckLogin(doneUrl, opts)) + } else { + return webAuthCheckLogin(doneUrl, opts) + } + } else { + throw new WebLoginInvalidResponse('GET', res, content) + } + }) +} + +function adduserCouch (username, email, password, opts) { validate('SSSO', arguments) - if (!conf.opts) conf.opts = {} - const userobj = { + opts = ProfileConfig(opts) + const body = { _id: 'org.couchdb.user:' + username, name: username, password: password, @@ -131,23 +140,25 @@ function adduserCouch (username, email, password, conf) { date: new Date().toISOString() } const logObj = {} - Object.keys(userobj).forEach(k => { - logObj[k] = k === 'password' ? 'XXXXX' : userobj[k] + Object.keys(body).forEach(k => { + logObj[k] = k === 'password' ? 'XXXXX' : body[k] }) process.emit('log', 'verbose', 'adduser', 'before first PUT', logObj) - const target = url.resolve(conf.registry, '-/user/org.couchdb.user:' + encodeURIComponent(username)) - - return fetchJSON({target: target, method: 'PUT', body: userobj, opts: conf.opts}) - .then(result => { - result.username = username - return result - }) + const target = '/-/user/org.couchdb.user:' + encodeURIComponent(username) + return fetch.json(target, opts.concat({ + method: 'PUT', + body + })).then(result => { + result.username = username + return result + }) } -function loginCouch (username, password, conf) { +function loginCouch (username, password, opts) { validate('SSO', arguments) - const userobj = { + opts = ProfileConfig(opts) + const body = { _id: 'org.couchdb.user:' + username, name: username, password: password, @@ -156,36 +167,38 @@ function loginCouch (username, password, conf) { date: new Date().toISOString() } const logObj = {} - Object.keys(userobj).forEach(k => { - logObj[k] = k === 'password' ? 'XXXXX' : userobj[k] + Object.keys(body).forEach(k => { + logObj[k] = k === 'password' ? 'XXXXX' : body[k] }) process.emit('log', 'verbose', 'login', 'before first PUT', logObj) - const target = url.resolve(conf.registry, '-/user/org.couchdb.user:' + encodeURIComponent(username)) - return fetchJSON(Object.assign({method: 'PUT', target: target, body: userobj}, conf)).catch(err => { + const target = '-/user/org.couchdb.user:' + encodeURIComponent(username) + return fetch.json(target, opts.concat({ + method: 'PUT', + body + })).catch(err => { if (err.code === 'E400') { err.message = `There is no user with the username "${username}".` throw err } if (err.code !== 'E409') throw err - return fetchJSON(Object.assign({method: 'GET', target: target + '?write=true'}, conf)).then(result => { + return fetch.json(target, opts.concat({ + query: {write: true} + })).then(result => { Object.keys(result).forEach(function (k) { - if (!userobj[k] || k === 'roles') { - userobj[k] = result[k] + if (!body[k] || k === 'roles') { + body[k] = result[k] } }) - const req = { + return fetch.json(`${target}/-rev/${body._rev}`, opts.concat({ method: 'PUT', - target: target + '/-rev/' + userobj._rev, - body: userobj, - auth: { - basic: { - username: username, - password: password - } + body, + forceAuth: { + username, + password: Buffer.from(password, 'utf8').toString('base64'), + otp: opts.otp } - } - return fetchJSON(Object.assign({}, conf, req)) + })) }) }).then(result => { result.username = username @@ -193,29 +206,31 @@ function loginCouch (username, password, conf) { }) } -function get (conf) { +function get (opts) { validate('O', arguments) - const target = url.resolve(conf.registry, '-/npm/v1/user') - return fetchJSON(Object.assign({target: target}, conf)) + return fetch.json('/-/npm/v1/user', opts) } -function set (profile, conf) { +function set (profile, opts) { validate('OO', arguments) - const target = url.resolve(conf.registry, '-/npm/v1/user') Object.keys(profile).forEach(key => { // profile keys can't be empty strings, but they CAN be null if (profile[key] === '') profile[key] = null }) - return fetchJSON(Object.assign({target: target, method: 'POST', body: profile}, conf)) + return fetch.json('/-/npm/v1/user', ProfileConfig(opts, { + method: 'POST', + body: profile + })) } -function listTokens (conf) { +function listTokens (opts) { validate('O', arguments) + opts = ProfileConfig(opts) - return untilLastPage(`-/npm/v1/tokens`) + return untilLastPage('/-/npm/v1/tokens') function untilLastPage (href, objects) { - return fetchJSON(Object.assign({target: url.resolve(conf.registry, href)}, conf)).then(result => { + return fetch.json(href, opts).then(result => { objects = objects ? objects.concat(result.objects) : result.objects if (result.urls.next) { return untilLastPage(result.urls.next, objects) @@ -226,174 +241,44 @@ function listTokens (conf) { } } -function removeToken (tokenKey, conf) { +function removeToken (tokenKey, opts) { validate('SO', arguments) - const target = url.resolve(conf.registry, `-/npm/v1/tokens/token/${tokenKey}`) - return fetchJSON(Object.assign({target: target, method: 'DELETE'}, conf)) + const target = `/-/npm/v1/tokens/token/${tokenKey}` + return fetch(target, ProfileConfig(opts, { + method: 'DELETE', + ignoreBody: true + })).then(() => null) } -function createToken (password, readonly, cidrs, conf) { +function createToken (password, readonly, cidrs, opts) { validate('SBAO', arguments) - const target = url.resolve(conf.registry, '-/npm/v1/tokens') - const props = { - password: password, - readonly: readonly, - cidr_whitelist: cidrs - } - return fetchJSON(Object.assign({target: target, method: 'POST', body: props}, conf)) -} - -function FetchError (err, method, target) { - err.method = method - err.href = target - return err -} - -class HttpErrorBase extends Error { - constructor (method, target, res, body) { - super() - this.headers = res.headers.raw() - this.statusCode = res.status - this.code = 'E' + res.status - this.method = method - this.target = target - this.body = body - this.pkgid = packageName(target) - } -} - -class HttpErrorGeneral extends HttpErrorBase { - constructor (method, target, res, body) { - super(method, target, res, body) - if (body && body.error) { - this.message = `Registry returned ${this.statusCode} for ${this.method} on ${this.target}: ${body.error}` - } else { - this.message = `Registry returned ${this.statusCode} for ${this.method} on ${this.target}` + return fetch.json('/-/npm/v1/tokens', ProfileConfig(opts, { + method: 'POST', + body: { + password: password, + readonly: readonly, + cidr_whitelist: cidrs } - Error.captureStackTrace(this, HttpErrorGeneral) - } + })) } class WebLoginInvalidResponse extends HttpErrorBase { - constructor (method, target, res, body) { - super(method, target, res, body) + constructor (method, res, body) { + super(method, res, body) this.message = 'Invalid response from web login endpoint' Error.captureStackTrace(this, WebLoginInvalidResponse) } } class WebLoginNotSupported extends HttpErrorBase { - constructor (method, target, res, body) { - super(method, target, res, body) + constructor (method, res, body) { + super(method, res, body) this.message = 'Web login not supported' this.code = 'ENYI' Error.captureStackTrace(this, WebLoginNotSupported) } } -class HttpErrorAuthOTP extends HttpErrorBase { - constructor (method, target, res, body) { - super(method, target, res, body) - this.message = 'OTP required for authentication' - this.code = 'EOTP' - Error.captureStackTrace(this, HttpErrorAuthOTP) - } -} - -class HttpErrorAuthIPAddress extends HttpErrorBase { - constructor (method, target, res, body) { - super(method, target, res, body) - this.message = 'Login is not allowed from your IP address' - this.code = 'EAUTHIP' - Error.captureStackTrace(this, HttpErrorAuthIPAddress) - } -} - -class HttpErrorAuthUnknown extends HttpErrorBase { - constructor (method, target, res, body) { - super(method, target, res, body) - this.message = 'Unable to authenticate, need: ' + res.headers.get('www-authenticate') - this.code = 'EAUTHUNKNOWN' - Error.captureStackTrace(this, HttpErrorAuthUnknown) - } -} - -function authHeaders (auth) { - const headers = {} - if (!auth) return headers - if (auth.otp) headers['npm-otp'] = auth.otp - if (auth.token) { - headers['Authorization'] = 'Bearer ' + auth.token - } else if (auth.basic) { - const basic = auth.basic.username + ':' + auth.basic.password - headers['Authorization'] = 'Basic ' + Buffer.from(basic).toString('base64') - } - return headers -} - -function fetchJSON (conf) { - const fetchOpts = { - method: conf.method, - headers: Object.assign({}, conf.headers || (conf.auth && authHeaders(conf.auth)) || {}) - } - if (conf.body != null) { - fetchOpts.headers['Content-Type'] = 'application/json' - fetchOpts.body = JSON.stringify(conf.body) - } - process.emit('log', 'http', 'request', '→', conf.method || 'GET', conf.target) - return fetch.defaults(conf.opts || {})(conf.target, fetchOpts).catch(err => { - throw new FetchError(err, conf.method, conf.target) - }).then(res => { - if (res.headers.has('npm-notice')) { - process.emit('warn', 'notice', res.headers.get('npm-notice')) - } - if (res.headers.get('content-type') === 'application/json') { - return res.json().then(content => [res, content]) - } else { - return res.buffer().then(content => { - try { - return [res, JSON.parse(content)] - } catch (_) { - return [res, content] - } - }) - } - }).then(result => { - const res = result[0] - const content = result[1] - const retVal = conf.saveResponse ? result : content - process.emit('log', 'http', res.status, `← ${res.statusText} (${conf.target})`) - if (res.status === 401 && res.headers.get('www-authenticate')) { - const auth = res.headers.get('www-authenticate').split(/,\s*/).map(s => s.toLowerCase()) - if (auth.indexOf('ipaddress') !== -1) { - throw new HttpErrorAuthIPAddress(conf.method, conf.target, res, content) - } else if (auth.indexOf('otp') !== -1) { - throw new HttpErrorAuthOTP(conf.method, conf.target, res, content) - } else { - throw new HttpErrorAuthUnknown(conf.method, conf.target, res, content) - } - } else if (res.status < 200 || res.status >= 300) { - throw new HttpErrorGeneral(conf.method, conf.target, res, content) - } else { - return retVal - } - }) -} - -function packageName (href) { - try { - let basePath = url.parse(href).pathname.substr(1) - if (!basePath.match(/^-/)) { - basePath = basePath.split('/') - var index = basePath.indexOf('_rewrite') - if (index === -1) { - index = basePath.length - 1 - } else { - index++ - } - return decodeURIComponent(basePath[index]) - } - } catch (_) { - // this is ok - } +function sleep (ms) { + return new Promise((resolve, reject) => setTimeout(resolve, ms)) } diff --git a/deps/npm/node_modules/npm-profile/package.json b/deps/npm/node_modules/npm-profile/package.json index d158b718632924..082da1efcaf8f9 100644 --- a/deps/npm/node_modules/npm-profile/package.json +++ b/deps/npm/node_modules/npm-profile/package.json @@ -1,28 +1,28 @@ { - "_from": "npm-profile@3.0.2", - "_id": "npm-profile@3.0.2", + "_from": "npm-profile@latest", + "_id": "npm-profile@4.0.1", "_inBundle": false, - "_integrity": "sha512-rEJOFR6PbwOvvhGa2YTNOJQKNuc6RovJ6T50xPU7pS9h/zKPNCJ+VHZY2OFXyZvEi+UQYtHRTp8O/YM3tUD20A==", + "_integrity": "sha512-NQ1I/1Q7YRtHZXkcuU1/IyHeLy6pd+ScKg4+DQHdfsm769TGq6HPrkbuNJVJS4zwE+0mvvmeULzQdWn2L2EsVA==", "_location": "/npm-profile", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "tag", "registry": true, - "raw": "npm-profile@3.0.2", + "raw": "npm-profile@latest", "name": "npm-profile", "escapedName": "npm-profile", - "rawSpec": "3.0.2", + "rawSpec": "latest", "saveSpec": null, - "fetchSpec": "3.0.2" + "fetchSpec": "latest" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-3.0.2.tgz", - "_shasum": "58d568f1b56ef769602fd0aed8c43fa0e0de0f57", - "_spec": "npm-profile@3.0.2", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-4.0.1.tgz", + "_shasum": "d350f7a5e6b60691c7168fbb8392c3603583f5aa", + "_spec": "npm-profile@latest", + "_where": "/Users/zkat/Documents/code/work/npm", "author": { "name": "Rebecca Turner", "email": "me@re-becca.org", @@ -34,7 +34,8 @@ "bundleDependencies": false, "dependencies": { "aproba": "^1.1.2 || 2", - "make-fetch-happen": "^2.5.0 || 3 || 4" + "figgy-pudding": "^3.4.1", + "npm-registry-fetch": "^3.8.0" }, "deprecated": false, "description": "Library for updating an npmjs.com profile", @@ -51,5 +52,5 @@ "type": "git", "url": "git+https://github.com/npm/npm-profile.git" }, - "version": "3.0.2" + "version": "4.0.1" } diff --git a/deps/npm/node_modules/npm-registry-client/CHANGELOG.md b/deps/npm/node_modules/npm-registry-client/CHANGELOG.md deleted file mode 100644 index 138b3be2d9e5ca..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/CHANGELOG.md +++ /dev/null @@ -1,21 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - - -# [8.6.0](https://github.com/npm/npm-registry-client/compare/v8.5.1...v8.6.0) (2018-07-13) - - -### Features - -* **access:** Add support for npm access to set per-package 2fa requirements ([8b472d2](https://github.com/npm/npm-registry-client/commit/8b472d2)) - - - - -## [8.5.1](https://github.com/npm/npm-registry-client/compare/v8.5.0...v8.5.1) (2018-03-08) - - -### Bug Fixes - -* **error:** improve `User not found` publish message ([#167](https://github.com/npm/npm-registry-client/issues/167)) ([5ebcffc](https://github.com/npm/npm-registry-client/commit/5ebcffc)) diff --git a/deps/npm/node_modules/npm-registry-client/README.md b/deps/npm/node_modules/npm-registry-client/README.md deleted file mode 100644 index e9ab77b0dc02b9..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/README.md +++ /dev/null @@ -1,357 +0,0 @@ -# npm-registry-client - -The code that npm uses to talk to the registry. - -It handles all the caching and HTTP calls. - -## Usage - -```javascript -var RegClient = require('npm-registry-client') -var client = new RegClient(config) -var uri = "https://registry.npmjs.org/npm" -var params = {timeout: 1000} - -client.get(uri, params, function (error, data, raw, res) { - // error is an error if there was a problem. - // data is the parsed data object - // raw is the json string - // res is the response from couch -}) -``` - -# Registry URLs - -The registry calls take either a full URL pointing to a resource in the -registry, or a base URL for the registry as a whole (including the registry -path – but be sure to terminate the path with `/`). `http` and `https` URLs are -the only ones supported. - -## Using the client - -Every call to the client follows the same pattern: - -* `uri` {String} The *fully-qualified* URI of the registry API method being - invoked. -* `params` {Object} Per-request parameters. -* `callback` {Function} Callback to be invoked when the call is complete. - -### Credentials - -Many requests to the registry can be authenticated, and require credentials -for authorization. These credentials always look the same: - -* `username` {String} -* `password` {String} -* `email` {String} -* `alwaysAuth` {Boolean} Whether calls to the target registry are always - authed. - -**or** - -* `token` {String} -* `alwaysAuth` {Boolean} Whether calls to the target registry are always - authed. - -## Requests - -As of `npm-registry-client@8`, all requests are made with an `Accept` header -of `application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`. - -This enables filtered document responses to requests for package metadata. -You know that you got a filtered response if the mime type is set to -`application/vnd.npm.install-v1+json` and not `application/json`. - -This filtering substantially reduces the over all data size. For example -for `https://registry.npmjs.org/npm`, the compressed metadata goes from -410kB to 21kB. - -## API - -### client.access(uri, params, cb) - -* `uri` {String} Registry URL for the package's access API endpoint. - Looks like `/-/package//access`. -* `params` {Object} Object containing per-request properties. - * `access` {String} New access level for the package. Can be either - `public` or `restricted`. Registry will raise an error if trying - to change the access level of an unscoped package. - * `auth` {Credentials} - -Set the access level for scoped packages. For now, there are only two -access levels: "public" and "restricted". - -### client.adduser(uri, params, cb) - -* `uri` {String} Base registry URL. -* `params` {Object} Object containing per-request properties. - * `auth` {Credentials} -* `cb` {Function} - * `error` {Error | null} - * `data` {Object} the parsed data object - * `raw` {String} the json - * `res` {Response Object} response from couch - -Add a user account to the registry, or verify the credentials. - -### client.deprecate(uri, params, cb) - -* `uri` {String} Full registry URI for the deprecated package. -* `params` {Object} Object containing per-request properties. - * `version` {String} Semver version range. - * `message` {String} The message to use as a deprecation warning. - * `auth` {Credentials} -* `cb` {Function} - -Deprecate a version of a package in the registry. - -### client.distTags.fetch(uri, params, cb) - -* `uri` {String} Base URL for the registry. -* `params` {Object} Object containing per-request properties. - * `package` {String} Name of the package. - * `auth` {Credentials} -* `cb` {Function} - -Fetch all of the `dist-tags` for the named package. - -### client.distTags.add(uri, params, cb) - -* `uri` {String} Base URL for the registry. -* `params` {Object} Object containing per-request properties. - * `package` {String} Name of the package. - * `distTag` {String} Name of the new `dist-tag`. - * `version` {String} Exact version to be mapped to the `dist-tag`. - * `auth` {Credentials} -* `cb` {Function} - -Add (or replace) a single dist-tag onto the named package. - -### client.distTags.set(uri, params, cb) - -* `uri` {String} Base URL for the registry. -* `params` {Object} Object containing per-request properties. - * `package` {String} Name of the package. - * `distTags` {Object} Object containing a map from tag names to package - versions. - * `auth` {Credentials} -* `cb` {Function} - -Set all of the `dist-tags` for the named package at once, creating any -`dist-tags` that do not already exist. Any `dist-tags` not included in the -`distTags` map will be removed. - -### client.distTags.update(uri, params, cb) - -* `uri` {String} Base URL for the registry. -* `params` {Object} Object containing per-request properties. - * `package` {String} Name of the package. - * `distTags` {Object} Object containing a map from tag names to package - versions. - * `auth` {Credentials} -* `cb` {Function} - -Update the values of multiple `dist-tags`, creating any `dist-tags` that do -not already exist. Any pre-existing `dist-tags` not included in the `distTags` -map will be left alone. - -### client.distTags.rm(uri, params, cb) - -* `uri` {String} Base URL for the registry. -* `params` {Object} Object containing per-request properties. - * `package` {String} Name of the package. - * `distTag` {String} Name of the new `dist-tag`. - * `auth` {Credentials} -* `cb` {Function} - -Remove a single `dist-tag` from the named package. - -### client.get(uri, params, cb) - -* `uri` {String} The complete registry URI to fetch -* `params` {Object} Object containing per-request properties. - * `timeout` {Number} Duration before the request times out. Optional - (default: never). - * `follow` {Boolean} Follow 302/301 responses. Optional (default: true). - * `staleOk` {Boolean} If there's cached data available, then return that to - the callback quickly, and update the cache the background. Optional - (default: false). - * `auth` {Credentials} Optional. - * `fullMetadata` {Boolean} If true, don't attempt to fetch filtered - ("corgi") registry metadata. (default: false) -* `cb` {Function} - -Fetches data from the registry via a GET request, saving it in the cache folder -with the ETag or the "Last Modified" timestamp. - -### client.publish(uri, params, cb) - -* `uri` {String} The registry URI for the package to publish. -* `params` {Object} Object containing per-request properties. - * `metadata` {Object} Package metadata. - * `access` {String} Access for the package. Can be `public` or `restricted` (no default). - * `body` {Stream} Stream of the package body / tarball. - * `auth` {Credentials} -* `cb` {Function} - -Publish a package to the registry. - -Note that this does not create the tarball from a folder. - -### client.sendAnonymousCLIMetrics(uri, params, cb) - -- `uri` {String} Base URL for the registry. -- `params` {Object} Object containing per-request properties. - - `metricId` {String} A uuid unique to this dataset. - - `metrics` {Object} The metrics to share with the registry, with the following properties: - - `from` {Date} When the first data in this report was collected. - - `to` {Date} When the last data in this report was collected. Usually right now. - - `successfulInstalls` {Number} The number of successful installs in this period. - - `failedInstalls` {Number} The number of installs that ended in error in this period. -- `cb` {Function} - -PUT a metrics object to the `/-/npm/anon-metrics/v1/` endpoint on the registry. - -### client.star(uri, params, cb) - -* `uri` {String} The complete registry URI for the package to star. -* `params` {Object} Object containing per-request properties. - * `starred` {Boolean} True to star the package, false to unstar it. Optional - (default: false). - * `auth` {Credentials} -* `cb` {Function} - -Star or unstar a package. - -Note that the user does not have to be the package owner to star or unstar a -package, though other writes do require that the user be the package owner. - -### client.stars(uri, params, cb) - -* `uri` {String} The base URL for the registry. -* `params` {Object} Object containing per-request properties. - * `username` {String} Name of user to fetch starred packages for. Optional - (default: user in `auth`). - * `auth` {Credentials} Optional (required if `username` is omitted). -* `cb` {Function} - -View your own or another user's starred packages. - -### client.tag(uri, params, cb) - -* `uri` {String} The complete registry URI to tag -* `params` {Object} Object containing per-request properties. - * `version` {String} Version to tag. - * `tag` {String} Tag name to apply. - * `auth` {Credentials} -* `cb` {Function} - -Mark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the -specified version. - -### client.unpublish(uri, params, cb) - -* `uri` {String} The complete registry URI of the package to unpublish. -* `params` {Object} Object containing per-request properties. - * `version` {String} version to unpublish. Optional – omit to unpublish all - versions. - * `auth` {Credentials} -* `cb` {Function} - -Remove a version of a package (or all versions) from the registry. When the -last version us unpublished, the entire document is removed from the database. - -### client.whoami(uri, params, cb) - -* `uri` {String} The base registry for the URI. -* `params` {Object} Object containing per-request properties. - * `auth` {Credentials} -* `cb` {Function} - -Simple call to see who the registry thinks you are. Especially useful with -token-based auth. - - -## PLUMBING - -The below are primarily intended for use by the rest of the API, or by the npm -caching logic directly. - -### client.request(uri, params, cb) - -* `uri` {String} URI pointing to the resource to request. -* `params` {Object} Object containing per-request properties. - * `method` {String} HTTP method. Optional (default: "GET"). - * `body` {Stream | Buffer | String | Object} The request body. Objects - that are not Buffers or Streams are encoded as JSON. Optional – body - only used for write operations. - * `etag` {String} The cached ETag. Optional. - * `lastModified` {String} The cached Last-Modified timestamp. Optional. - * `follow` {Boolean} Follow 302/301 responses. Optional (default: true). - * `streaming` {Boolean} Stream the request body as it comes, handling error - responses in a non-streaming way. - * `auth` {Credentials} Optional. -* `cb` {Function} - * `error` {Error | null} - * `data` {Object} the parsed data object - * `raw` {String} the json - * `res` {Response Object} response from couch - -Make a generic request to the registry. All the other methods are wrappers -around `client.request`. - -### client.fetch(uri, params, cb) - -* `uri` {String} The complete registry URI to upload to -* `params` {Object} Object containing per-request properties. - * `headers` {Stream} HTTP headers to be included with the request. Optional. - * `auth` {Credentials} Optional. -* `cb` {Function} - -Fetch a package from a URL, with auth set appropriately if included. Used to -cache remote tarballs as well as request package tarballs from the registry. - -# Configuration - -The client uses its own configuration, which is just passed in as a simple -nested object. The following are the supported values (with their defaults, if -any): - -* `proxy.http` {URL} The URL to proxy HTTP requests through. -* `proxy.https` {URL} The URL to proxy HTTPS requests through. Defaults to be - the same as `proxy.http` if unset. -* `proxy.localAddress` {IP} The local address to use on multi-homed systems. -* `ssl.ca` {String} Certificate signing authority certificates to trust. -* `ssl.certificate` {String} Client certificate (PEM encoded). Enable access - to servers that require client certificates. -* `ssl.key` {String} Private key (PEM encoded) for client certificate. -* `ssl.strict` {Boolean} Whether or not to be strict with SSL certificates. - Default = `true` -* `retry.count` {Number} Number of times to retry on GET failures. Default = 2. -* `retry.factor` {Number} `factor` setting for `node-retry`. Default = 10. -* `retry.minTimeout` {Number} `minTimeout` setting for `node-retry`. - Default = 10000 (10 seconds) -* `retry.maxTimeout` {Number} `maxTimeout` setting for `node-retry`. - Default = 60000 (60 seconds) -* `userAgent` {String} User agent header to send. Default = - `"node/{process.version}"` -* `log` {Object} The logger to use. Defaults to `require("npmlog")` if - that works, otherwise logs are disabled. -* `defaultTag` {String} The default tag to use when publishing new packages. - Default = `"latest"` -* `couchToken` {Object} A token for use with - [couch-login](https://npmjs.org/package/couch-login). -* `sessionToken` {String} A random identifier for this set of client requests. - Default = 8 random hexadecimal bytes. -* `maxSockets` {Number} The maximum number of connections that will be open per - origin (unique combination of protocol:host:port). Passed to the - [httpAgent](https://nodejs.org/api/http.html#http_agent_maxsockets). - Default = 50 -* `isFromCI` {Boolean} Identify to severs if this request is coming from CI (for statistics purposes). - Default = detected from environment– primarily this is done by looking for - the CI environment variable to be set to `true`. Also accepted are the - existence of the `JENKINS_URL`, `bamboo.buildKey` and `TDDIUM` environment - variables. -* `scope` {String} The scope of the project this command is being run for. This is the - top level npm module in which a command was run. - Default = none diff --git a/deps/npm/node_modules/npm-registry-client/index.js b/deps/npm/node_modules/npm-registry-client/index.js deleted file mode 100644 index 07eab3f36cfe18..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/index.js +++ /dev/null @@ -1,74 +0,0 @@ -// utilities for working with the js-registry site. - -module.exports = RegClient - -var npmlog -try { - npmlog = require('npmlog') -} catch (er) { - npmlog = { - error: noop, - warn: noop, - info: noop, - verbose: noop, - silly: noop, - http: noop, - pause: noop, - resume: noop - } -} - -function noop () {} - -function RegClient (config) { - this.config = Object.create(config || {}) - - this.config.proxy = this.config.proxy || {} - if (!this.config.proxy.https && this.config.proxy.http) { - this.config.proxy.https = this.config.proxy.http - } - - this.config.ssl = this.config.ssl || {} - if (this.config.ssl.strict === undefined) this.config.ssl.strict = true - - this.config.retry = this.config.retry || {} - if (typeof this.config.retry.retries !== 'number') this.config.retry.retries = 2 - if (typeof this.config.retry.factor !== 'number') this.config.retry.factor = 10 - if (typeof this.config.retry.minTimeout !== 'number') this.config.retry.minTimeout = 10000 - if (typeof this.config.retry.maxTimeout !== 'number') this.config.retry.maxTimeout = 60000 - if (typeof this.config.maxSockets !== 'number') this.config.maxSockets = 50 - - this.config.userAgent = this.config.userAgent || 'node/' + process.version - this.config.defaultTag = this.config.defaultTag || 'latest' - - this.log = this.config.log || npmlog - delete this.config.log - - var client = this - client.access = require('./lib/access') - client.adduser = require('./lib/adduser') - client.attempt = require('./lib/attempt') - client.authify = require('./lib/authify') - client.deprecate = require('./lib/deprecate') - client.distTags = Object.create(client) - client.distTags.add = require('./lib/dist-tags/add') - client.distTags.fetch = require('./lib/dist-tags/fetch') - client.distTags.rm = require('./lib/dist-tags/rm') - client.distTags.set = require('./lib/dist-tags/set') - client.distTags.update = require('./lib/dist-tags/update') - client.fetch = require('./lib/fetch') - client.get = require('./lib/get') - client.initialize = require('./lib/initialize') - client.logout = require('./lib/logout') - client.org = require('./lib/org') - client.ping = require('./lib/ping') - client.publish = require('./lib/publish') - client.request = require('./lib/request') - client.sendAnonymousCLIMetrics = require('./lib/send-anonymous-CLI-metrics') - client.star = require('./lib/star') - client.stars = require('./lib/stars') - client.tag = require('./lib/tag') - client.team = require('./lib/team') - client.unpublish = require('./lib/unpublish') - client.whoami = require('./lib/whoami') -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/access.js b/deps/npm/node_modules/npm-registry-client/lib/access.js deleted file mode 100644 index caa80b12191c16..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/access.js +++ /dev/null @@ -1,168 +0,0 @@ -module.exports = access - -var assert = require('assert') -var url = require('url') -var npa = require('npm-package-arg') -var subcommands = {} - -function access (sub, uri, params, cb) { - accessAssertions(sub, uri, params, cb) - return subcommands[sub].call(this, uri, params, cb) -} - -subcommands.public = function (uri, params, cb) { - return setAccess.call(this, 'public', uri, params, cb) -} -subcommands.restricted = function (uri, params, cb) { - return setAccess.call(this, 'restricted', uri, params, cb) -} -subcommands['2fa-required'] = function (uri, params, cb) { - return setRequires2fa.call(this, true, uri, params, cb) -} -subcommands['2fa-not-required'] = function (uri, params, cb) { - return setRequires2fa.call(this, false, uri, params, cb) -} - -function setAccess (access, uri, params, cb) { - return this.request(apiUri(uri, 'package', params.package, 'access'), { - method: 'POST', - auth: params.auth, - body: JSON.stringify({ access: access }) - }, cb) -} - -function setRequires2fa (requires2fa, uri, params, cb) { - return this.request(apiUri(uri, 'package', params.package, 'access'), { - method: 'POST', - auth: params.auth, - body: JSON.stringify({ publish_requires_tfa: requires2fa }) - }, cb) -} - -subcommands.grant = function (uri, params, cb) { - var reqUri = apiUri(uri, 'team', params.scope, params.team, 'package') - return this.request(reqUri, { - method: 'PUT', - auth: params.auth, - body: JSON.stringify({ - permissions: params.permissions, - package: params.package - }) - }, cb) -} - -subcommands.revoke = function (uri, params, cb) { - var reqUri = apiUri(uri, 'team', params.scope, params.team, 'package') - return this.request(reqUri, { - method: 'DELETE', - auth: params.auth, - body: JSON.stringify({ - package: params.package - }) - }, cb) -} - -subcommands['ls-packages'] = function (uri, params, cb, type) { - type = type || (params.team ? 'team' : 'org') - var client = this - var uriParams = '?format=cli' - var reqUri = apiUri(uri, type, params.scope, params.team, 'package') - return client.request(reqUri + uriParams, { - method: 'GET', - auth: params.auth - }, function (err, perms) { - if (err && err.statusCode === 404 && type === 'org') { - subcommands['ls-packages'].call(client, uri, params, cb, 'user') - } else { - cb(err, perms && translatePermissions(perms)) - } - }) -} - -subcommands['ls-collaborators'] = function (uri, params, cb) { - var uriParams = '?format=cli' - if (params.user) { - uriParams += ('&user=' + encodeURIComponent(params.user)) - } - var reqUri = apiUri(uri, 'package', params.package, 'collaborators') - return this.request(reqUri + uriParams, { - method: 'GET', - auth: params.auth - }, function (err, perms) { - cb(err, perms && translatePermissions(perms)) - }) -} - -subcommands.edit = function () { - throw new Error('edit subcommand is not implemented yet') -} - -function apiUri (registryUri) { - var path = Array.prototype.slice.call(arguments, 1) - .filter(function (x) { return x }) - .map(encodeURIComponent) - .join('/') - return url.resolve(registryUri, '-/' + path) -} - -function accessAssertions (subcommand, uri, params, cb) { - assert(subcommands.hasOwnProperty(subcommand), - 'access subcommand must be one of ' + - Object.keys(subcommands).join(', ')) - typeChecks({ - 'uri': [uri, 'string'], - 'params': [params, 'object'], - 'auth': [params.auth, 'object'], - 'callback': [cb, 'function'] - }) - if (contains([ - 'public', 'restricted' - ], subcommand)) { - typeChecks({ 'package': [params.package, 'string'] }) - assert(!!npa(params.package).scope, - 'access commands are only accessible for scoped packages') - } - if (contains(['grant', 'revoke', 'ls-packages'], subcommand)) { - typeChecks({ 'scope': [params.scope, 'string'] }) - } - if (contains(['grant', 'revoke'], subcommand)) { - typeChecks({ 'team': [params.team, 'string'] }) - } - if (subcommand === 'grant') { - typeChecks({ 'permissions': [params.permissions, 'string'] }) - assert(params.permissions === 'read-only' || - params.permissions === 'read-write', - 'permissions must be either read-only or read-write') - } -} - -function typeChecks (specs) { - Object.keys(specs).forEach(function (key) { - var checks = specs[key] - /* eslint valid-typeof:0 */ - assert(typeof checks[0] === checks[1], - key + ' is required and must be of type ' + checks[1]) - }) -} - -function contains (arr, item) { - return arr.indexOf(item) !== -1 -} - -function translatePermissions (perms) { - var newPerms = {} - for (var key in perms) { - if (perms.hasOwnProperty(key)) { - if (perms[key] === 'read') { - newPerms[key] = 'read-only' - } else if (perms[key] === 'write') { - newPerms[key] = 'read-write' - } else { - // This shouldn't happen, but let's not break things - // if the API starts returning different things. - newPerms[key] = perms[key] - } - } - } - return newPerms -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/adduser.js b/deps/npm/node_modules/npm-registry-client/lib/adduser.js deleted file mode 100644 index a31d5b0333999c..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/adduser.js +++ /dev/null @@ -1,128 +0,0 @@ -module.exports = adduser - -var url = require('url') -var assert = require('assert') - -function adduser (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to adduser') - assert( - params && typeof params === 'object', - 'must pass params to adduser' - ) - assert(typeof cb === 'function', 'must pass callback to adduser') - - assert(params.auth && typeof params.auth, 'must pass auth to adduser') - var auth = params.auth - assert(typeof auth.username === 'string', 'must include username in auth') - assert(typeof auth.password === 'string', 'must include password in auth') - assert(typeof auth.email === 'string', 'must include email in auth') - - // normalize registry URL - if (uri.slice(-1) !== '/') uri += '/' - - var username = auth.username.trim() - var password = auth.password.trim() - var email = auth.email.trim() - - // validation - if (!username) return cb(new Error('No username supplied.')) - if (!password) return cb(new Error('No password supplied.')) - if (!email) return cb(new Error('No email address supplied.')) - if (!email.match(/^[^@]+@[^.]+\.[^.]+/)) { - return cb(new Error('Please use a real email address.')) - } - - var userobj = { - _id: 'org.couchdb.user:' + username, - name: username, - password: password, - email: email, - type: 'user', - roles: [], - date: new Date().toISOString() - } - - var token = this.config.couchToken - if (this.couchLogin) this.couchLogin.token = null - - cb = done.call(this, token, cb) - - var logObj = Object.keys(userobj).map(function (k) { - if (k === 'password') return [k, 'XXXXX'] - return [k, userobj[k]] - }).reduce(function (s, kv) { - s[kv[0]] = kv[1] - return s - }, {}) - - this.log.verbose('adduser', 'before first PUT', logObj) - - var client = this - - uri = url.resolve(uri, '-/user/org.couchdb.user:' + encodeURIComponent(username)) - var options = { - method: 'PUT', - body: userobj, - auth: auth - } - this.request( - uri, - Object.assign({}, options), - function (error, data, json, response) { - if (!error || !response || response.statusCode !== 409) { - return cb(error, data, json, response) - } - - client.log.verbose('adduser', 'update existing user') - return client.request( - uri + '?write=true', - { auth: auth }, - function (er, data, json, response) { - if (er || data.error) { - return cb(er, data, json, response) - } - Object.keys(data).forEach(function (k) { - if (!userobj[k] || k === 'roles') { - userobj[k] = data[k] - } - }) - client.log.verbose('adduser', 'userobj', logObj) - client.request(uri + '/-rev/' + userobj._rev, options, cb) - } - ) - } - ) - - function done (token, cb) { - return function (error, data, json, response) { - if (!error && (!response || response.statusCode === 201)) { - return cb(error, data, json, response) - } - - // there was some kind of error, reinstate previous auth/token/etc. - if (client.couchLogin) { - client.couchLogin.token = token - if (client.couchLogin.tokenSet) { - client.couchLogin.tokenSet(token) - } - } - - client.log.verbose('adduser', 'back', [error, data, json]) - if (!error) { - error = new Error( - ((response && response.statusCode) || '') + ' ' + - 'Could not create user\n' + JSON.stringify(data) - ) - } - - if (response && (response.statusCode === 401 || response.statusCode === 403)) { - client.log.warn('adduser', 'Incorrect username or password\n' + - 'You can reset your account by visiting:\n' + - '\n' + - ' https://npmjs.org/forgot\n') - } - - return cb(error) - } - } -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/attempt.js b/deps/npm/node_modules/npm-registry-client/lib/attempt.js deleted file mode 100644 index d41bbc4fae8257..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/attempt.js +++ /dev/null @@ -1,20 +0,0 @@ -var retry = require('retry') - -module.exports = attempt - -function attempt (cb) { - // Tuned to spread 3 attempts over about a minute. - // See formula at . - var operation = retry.operation(this.config.retry) - - var client = this - operation.attempt(function (currentAttempt) { - client.log.info( - 'attempt', - 'registry request try #' + currentAttempt + - ' at ' + (new Date()).toLocaleTimeString() - ) - - cb(operation) - }) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/authify.js b/deps/npm/node_modules/npm-registry-client/lib/authify.js deleted file mode 100644 index 9b38a30a928305..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/authify.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = authify - -function authify (authed, parsed, headers, credentials) { - if (credentials && credentials.otp) { - this.log.verbose('request', 'passing along npm otp') - headers['npm-otp'] = credentials.otp - } - if (credentials && credentials.token) { - this.log.verbose('request', 'using bearer token for auth') - headers.authorization = 'Bearer ' + credentials.token - - return null - } - - if (authed) { - if (credentials && credentials.username && credentials.password) { - var username = encodeURIComponent(credentials.username) - var password = encodeURIComponent(credentials.password) - parsed.auth = username + ':' + password - } else { - return new Error( - 'This request requires auth credentials. Run `npm login` and repeat the request.' - ) - } - } -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js deleted file mode 100644 index 5ff3a8891f5e2d..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = deprecate - -var assert = require('assert') -var semver = require('semver') - -function deprecate (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to deprecate') - assert(params && typeof params === 'object', 'must pass params to deprecate') - assert(typeof cb === 'function', 'must pass callback to deprecate') - - assert(typeof params.version === 'string', 'must pass version to deprecate') - assert(typeof params.message === 'string', 'must pass message to deprecate') - assert( - params.auth && typeof params.auth === 'object', - 'must pass auth to deprecate' - ) - - var version = params.version - var message = params.message - var auth = params.auth - - if (semver.validRange(version) === null) { - return cb(new Error('invalid version range: ' + version)) - } - - this.get(uri + '?write=true', { auth: auth }, function (er, data) { - if (er) return cb(er) - // filter all the versions that match - Object.keys(data.versions).filter(function (v) { - return semver.satisfies(v, version) - }).forEach(function (v) { - data.versions[v].deprecated = message - }) - // now update the doc on the registry - var options = { - method: 'PUT', - body: data, - auth: auth - } - this.request(uri, options, cb) - }.bind(this)) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/add.js b/deps/npm/node_modules/npm-registry-client/lib/dist-tags/add.js deleted file mode 100644 index 924199ad1e01d1..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/add.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = add - -var assert = require('assert') -var url = require('url') - -var npa = require('npm-package-arg') - -function add (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to distTags.add') - assert( - params && typeof params === 'object', - 'must pass params to distTags.add' - ) - assert(typeof cb === 'function', 'muss pass callback to distTags.add') - - assert( - typeof params.package === 'string', - 'must pass package name to distTags.add' - ) - assert( - typeof params.distTag === 'string', - 'must pass package distTag name to distTags.add' - ) - assert( - typeof params.version === 'string', - 'must pass version to be mapped to distTag to distTags.add' - ) - assert( - params.auth && typeof params.auth === 'object', - 'must pass auth to distTags.add' - ) - - var p = npa(params.package) - var pkg = p.scope ? params.package.replace('/', '%2f') : params.package - var rest = '-/package/' + pkg + '/dist-tags/' + params.distTag - - var options = { - method: 'PUT', - body: JSON.stringify(params.version), - auth: params.auth - } - this.request(url.resolve(uri, rest), options, cb) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/fetch.js b/deps/npm/node_modules/npm-registry-client/lib/dist-tags/fetch.js deleted file mode 100644 index 69a126d1f45b4c..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/fetch.js +++ /dev/null @@ -1,37 +0,0 @@ -module.exports = fetch - -var assert = require('assert') -var url = require('url') - -var npa = require('npm-package-arg') - -function fetch (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to distTags.fetch') - assert( - params && typeof params === 'object', - 'must pass params to distTags.fetch' - ) - assert(typeof cb === 'function', 'must pass callback to distTags.fetch') - - assert( - typeof params.package === 'string', - 'must pass package name to distTags.fetch' - ) - assert( - params.auth && typeof params.auth === 'object', - 'must pass auth to distTags.fetch' - ) - - var p = npa(params.package) - var pkg = p.scope ? params.package.replace('/', '%2f') : params.package - var rest = '-/package/' + pkg + '/dist-tags' - - var options = { - method: 'GET', - auth: params.auth - } - this.request(url.resolve(uri, rest), options, function (er, data) { - if (data && typeof data === 'object') delete data._etag - cb(er, data) - }) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/rm.js b/deps/npm/node_modules/npm-registry-client/lib/dist-tags/rm.js deleted file mode 100644 index d2bdda05dac3df..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/rm.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = rm - -var assert = require('assert') -var url = require('url') - -var npa = require('npm-package-arg') - -function rm (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to distTags.rm') - assert( - params && typeof params === 'object', - 'must pass params to distTags.rm' - ) - assert(typeof cb === 'function', 'muss pass callback to distTags.rm') - - assert( - typeof params.package === 'string', - 'must pass package name to distTags.rm' - ) - assert( - typeof params.distTag === 'string', - 'must pass package distTag name to distTags.rm' - ) - assert( - params.auth && typeof params.auth === 'object', - 'must pass auth to distTags.rm' - ) - - var p = npa(params.package) - var pkg = p.scope ? params.package.replace('/', '%2f') : params.package - var rest = '-/package/' + pkg + '/dist-tags/' + params.distTag - - var options = { - method: 'DELETE', - auth: params.auth - } - this.request(url.resolve(uri, rest), options, cb) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/set.js b/deps/npm/node_modules/npm-registry-client/lib/dist-tags/set.js deleted file mode 100644 index 7af351d6359e8e..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/set.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = set - -var assert = require('assert') -var url = require('url') - -var npa = require('npm-package-arg') - -function set (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to distTags.set') - assert( - params && typeof params === 'object', - 'must pass params to distTags.set' - ) - assert(typeof cb === 'function', 'muss pass callback to distTags.set') - - assert( - typeof params.package === 'string', - 'must pass package name to distTags.set' - ) - assert( - params.distTags && typeof params.distTags === 'object', - 'must pass distTags map to distTags.set' - ) - assert( - params.auth && typeof params.auth === 'object', - 'must pass auth to distTags.set' - ) - - var p = npa(params.package) - var pkg = p.scope ? params.package.replace('/', '%2f') : params.package - var rest = '-/package/' + pkg + '/dist-tags' - - var options = { - method: 'PUT', - body: JSON.stringify(params.distTags), - auth: params.auth - } - this.request(url.resolve(uri, rest), options, cb) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/update.js b/deps/npm/node_modules/npm-registry-client/lib/dist-tags/update.js deleted file mode 100644 index 07ec3e5e75f0f6..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/dist-tags/update.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = update - -var assert = require('assert') -var url = require('url') - -var npa = require('npm-package-arg') - -function update (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to distTags.update') - assert( - params && typeof params === 'object', - 'must pass params to distTags.update' - ) - assert(typeof cb === 'function', 'muss pass callback to distTags.update') - - assert( - typeof params.package === 'string', - 'must pass package name to distTags.update' - ) - assert( - params.distTags && typeof params.distTags === 'object', - 'must pass distTags map to distTags.update' - ) - assert( - params.auth && typeof params.auth === 'object', - 'must pass auth to distTags.update' - ) - - var p = npa(params.package) - var pkg = p.scope ? params.package.replace('/', '%2f') : params.package - var rest = '-/package/' + pkg + '/dist-tags' - - var options = { - method: 'POST', - body: JSON.stringify(params.distTags), - auth: params.auth - } - this.request(url.resolve(uri, rest), options, cb) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/fetch.js b/deps/npm/node_modules/npm-registry-client/lib/fetch.js deleted file mode 100644 index 5ab8587780f206..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/fetch.js +++ /dev/null @@ -1,85 +0,0 @@ -var assert = require('assert') -var url = require('url') - -var request = require('request') -var once = require('once') - -module.exports = fetch - -function fetch (uri, params, cb) { - assert(typeof uri === 'string', 'must pass uri to request') - assert(params && typeof params === 'object', 'must pass params to request') - assert(typeof cb === 'function', 'must pass callback to request') - - cb = once(cb) - - var client = this - this.attempt(function (operation) { - makeRequest.call(client, uri, params, function (er, req) { - if (er) return cb(er) - - req.once('error', retryOnError) - - function retryOnError (er) { - if (operation.retry(er)) { - client.log.info('retry', 'will retry, error on last attempt: ' + er) - } else { - cb(er) - } - } - - req.on('response', function (res) { - client.log.http('fetch', '' + res.statusCode, uri) - req.removeListener('error', retryOnError) - - var er - var statusCode = res && res.statusCode - if (statusCode === 200) { - res.resume() - - req.once('error', function (er) { - res.emit('error', er) - }) - - return cb(null, res) - // Only retry on 408, 5xx or no `response`. - } else if (statusCode === 408) { - er = new Error('request timed out') - } else if (statusCode >= 500) { - er = new Error('server error ' + statusCode) - } - - if (er && operation.retry(er)) { - client.log.info('retry', 'will retry, error on last attempt: ' + er) - } else { - cb(new Error('fetch failed with status code ' + statusCode)) - } - }) - }) - }) -} - -function makeRequest (remote, params, cb) { - var parsed = url.parse(remote) - this.log.http('fetch', 'GET', parsed.href) - - var headers = params.headers || {} - var er = this.authify( - params.auth && params.auth.alwaysAuth, - parsed, - headers, - params.auth - ) - if (er) return cb(er) - - var opts = this.initialize( - parsed, - 'GET', - 'application/x-tar, application/vnd.github+json; q=0.1', - headers - ) - // always want to follow redirects for fetch - opts.followRedirect = true - - cb(null, request(opts)) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/get.js b/deps/npm/node_modules/npm-registry-client/lib/get.js deleted file mode 100644 index ab0eae10f01218..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/get.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = get - -var assert = require('assert') -var url = require('url') - -/* - * This is meant to be overridden in specific implementations if you - * want specialized behavior for metadata (i.e. caching). - */ -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') - - var parsed = url.parse(uri) - assert( - parsed.protocol === 'http:' || parsed.protocol === 'https:', - 'must have a URL that starts with http: or https:' - ) - - this.request(uri, params, cb) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/initialize.js b/deps/npm/node_modules/npm-registry-client/lib/initialize.js deleted file mode 100644 index a25077eae5524d..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/initialize.js +++ /dev/null @@ -1,91 +0,0 @@ -var crypto = require('crypto') -var HttpAgent = require('http').Agent -var HttpsAgent = require('https').Agent - -var pkg = require('../package.json') - -module.exports = initialize - -function initialize (uri, method, accept, headers) { - if (!this.config.sessionToken) { - this.config.sessionToken = crypto.randomBytes(8).toString('hex') - this.log.verbose('request id', this.config.sessionToken) - } - if (this.config.isFromCI == null) { - this.config.isFromCI = Boolean( - process.env['CI'] === 'true' || process.env['TDDIUM'] || - process.env['JENKINS_URL'] || process.env['bamboo.buildKey'] || - process.env['GO_PIPELINE_NAME']) - } - - var opts = { - url: uri, - method: method, - headers: headers, - localAddress: this.config.proxy.localAddress, - strictSSL: this.config.ssl.strict, - cert: this.config.ssl.certificate, - key: this.config.ssl.key, - ca: this.config.ssl.ca, - agent: getAgent.call(this, uri.protocol) - } - - // allow explicit disabling of proxy in environment via CLI - // - // how false gets here is the CLI's problem (it's gross) - if (this.config.proxy.http === false) { - opts.proxy = null - } else { - // request will not pay attention to the NOPROXY environment variable if a - // config value named proxy is passed in, even if it's set to null. - var proxy - if (uri.protocol === 'https:') { - proxy = this.config.proxy.https - } else { - proxy = this.config.proxy.http - } - if (typeof proxy === 'string') opts.proxy = proxy - } - - headers.version = this.version || pkg.version - headers.accept = accept - - if (this.refer) headers.referer = this.refer - - headers['npm-session'] = this.config.sessionToken - headers['npm-in-ci'] = String(this.config.isFromCI) - headers['user-agent'] = this.config.userAgent - if (this.config.scope) { - headers['npm-scope'] = this.config.scope - } - - return opts -} - -function getAgent (protocol) { - if (protocol === 'https:') { - if (!this.httpsAgent) { - this.httpsAgent = new HttpsAgent({ - keepAlive: true, - maxSockets: this.config.maxSockets, - localAddress: this.config.proxy.localAddress, - rejectUnauthorized: this.config.ssl.strict, - ca: this.config.ssl.ca, - cert: this.config.ssl.certificate, - key: this.config.ssl.key - }) - } - - return this.httpsAgent - } else { - if (!this.httpAgent) { - this.httpAgent = new HttpAgent({ - keepAlive: true, - maxSockets: this.config.maxSockets, - localAddress: this.config.proxy.localAddress - }) - } - - return this.httpAgent - } -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/logout.js b/deps/npm/node_modules/npm-registry-client/lib/logout.js deleted file mode 100644 index e66e9b78ac5dde..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/logout.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = logout - -var assert = require('assert') -var url = require('url') - -function logout (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to logout') - assert(params && typeof params === 'object', 'must pass params to logout') - assert(typeof cb === 'function', 'must pass callback to star') - - var auth = params.auth - assert(auth && typeof auth === 'object', 'must pass auth to logout') - assert(typeof auth.token === 'string', 'can only log out for token auth') - - uri = url.resolve(uri, '-/user/token/' + auth.token) - var options = { - method: 'DELETE', - auth: auth - } - - this.log.verbose('logout', 'invalidating session token for user') - this.request(uri, options, cb) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/org.js b/deps/npm/node_modules/npm-registry-client/lib/org.js deleted file mode 100644 index 3072b3817a8cfe..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/org.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict' - -module.exports = org - -var assert = require('assert') -var url = require('url') - -var subcommands = {} - -function org (subcommand, uri, params, cb) { - orgAssertions(subcommand, uri, params, cb) - return subcommands[subcommand].call(this, uri, params, cb) -} - -subcommands.set = subcommands.add = function (uri, params, cb) { - return this.request(apiUri(uri, 'org', params.org, 'user'), { - method: 'PUT', - auth: params.auth, - body: JSON.stringify({ - user: params.user, - role: params.role - }) - }, cb) -} - -subcommands.rm = function (uri, params, cb) { - return this.request(apiUri(uri, 'org', params.org, 'user'), { - method: 'DELETE', - auth: params.auth, - body: JSON.stringify({ - user: params.user - }) - }, cb) -} - -subcommands.ls = function (uri, params, cb) { - return this.request(apiUri(uri, 'org', params.org, 'user'), { - method: 'GET', - auth: params.auth - }, cb) -} - -function apiUri (registryUri) { - var path = Array.prototype.slice.call(arguments, 1) - .map(encodeURIComponent) - .join('/') - return url.resolve(registryUri, '-/' + path) -} - -function orgAssertions (subcommand, uri, params, cb) { - assert(subcommand, 'subcommand is required') - assert(subcommands.hasOwnProperty(subcommand), - 'org subcommand must be one of ' + Object.keys(subcommands)) - assert(typeof uri === 'string', 'registry URI is required') - assert(typeof params === 'object', 'params are required') - assert(typeof params.auth === 'object', 'auth is required') - assert(!cb || typeof cb === 'function', 'callback must be a function') - assert(typeof params.org === 'string', 'org name is required') - if (subcommand === 'rm' || subcommand === 'add' || subcommand === 'set') { - assert(typeof params.user === 'string', 'user is required') - } -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/ping.js b/deps/npm/node_modules/npm-registry-client/lib/ping.js deleted file mode 100644 index 5ab98c52d2c751..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/ping.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = ping - -var url = require('url') -var assert = require('assert') - -function ping (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to ping') - assert(params && typeof params === 'object', 'must pass params to ping') - assert(typeof cb === 'function', 'must pass callback to ping') - - var auth = params.auth - assert(auth && typeof auth === 'object', 'must pass auth to ping') - - this.request(url.resolve(uri, '-/ping?write=true'), { auth: auth }, function (er, fullData, data, response) { - if (er || fullData) { - cb(er, fullData, data, response) - } else { - cb(new Error('No data received')) - } - }) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/publish.js b/deps/npm/node_modules/npm-registry-client/lib/publish.js deleted file mode 100644 index fd3adce126e819..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/publish.js +++ /dev/null @@ -1,194 +0,0 @@ -module.exports = publish - -var url = require('url') -var semver = require('semver') -var Stream = require('stream').Stream -var assert = require('assert') -var fixer = require('normalize-package-data').fixer -var concat = require('concat-stream') -var ssri = require('ssri') - -function escaped (name) { - return name.replace('/', '%2f') -} - -function publish (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to publish') - assert(params && typeof params === 'object', 'must pass params to publish') - assert(typeof cb === 'function', 'must pass callback to publish') - - var access = params.access - assert( - (!access) || ['public', 'restricted'].indexOf(access) !== -1, - "if present, access level must be either 'public' or 'restricted'" - ) - - var auth = params.auth - assert(auth && typeof auth === 'object', 'must pass auth to publish') - if (!(auth.token || - (auth.password && auth.username && auth.email))) { - var er = new Error('auth required for publishing') - er.code = 'ENEEDAUTH' - return cb(er) - } - - var metadata = params.metadata - assert( - metadata && typeof metadata === 'object', - 'must pass package metadata to publish' - ) - try { - fixer.fixNameField(metadata, {strict: true, allowLegacyCase: true}) - } catch (er) { - return cb(er) - } - var version = semver.clean(metadata.version) - if (!version) return cb(new Error('invalid semver: ' + metadata.version)) - metadata.version = version - - var body = params.body - assert(body, 'must pass package body to publish') - assert(body instanceof Stream, 'package body passed to publish must be a stream') - var client = this - var sink = concat(function (tarbuffer) { - putFirst.call(client, uri, metadata, tarbuffer, access, auth, cb) - }) - sink.on('error', cb) - body.pipe(sink) -} - -function putFirst (registry, data, tarbuffer, access, auth, cb) { - // optimistically try to PUT all in one single atomic thing. - // If 409, then GET and merge, try again. - // If other error, then fail. - - var root = { - _id: data.name, - name: data.name, - description: data.description, - 'dist-tags': {}, - versions: {}, - readme: data.readme || '' - } - - if (access) root.access = access - - if (!auth.token) { - root.maintainers = [{ name: auth.username, email: auth.email }] - data.maintainers = JSON.parse(JSON.stringify(root.maintainers)) - } - - root.versions[ data.version ] = data - var tag = data.tag || this.config.defaultTag - root['dist-tags'][tag] = data.version - - var tbName = data.name + '-' + data.version + '.tgz' - var tbURI = data.name + '/-/' + tbName - var integrity = ssri.fromData(tarbuffer, { - algorithms: ['sha1', 'sha512'] - }) - - data._id = data.name + '@' + data.version - data.dist = data.dist || {} - // Don't bother having sha1 in the actual integrity field - data.dist.integrity = integrity['sha512'][0].toString() - // Legacy shasum support - data.dist.shasum = integrity['sha1'][0].hexDigest() - data.dist.tarball = url.resolve(registry, tbURI) - .replace(/^https:\/\//, 'http://') - - root._attachments = {} - root._attachments[ tbName ] = { - 'content_type': 'application/octet-stream', - 'data': tarbuffer.toString('base64'), - 'length': tarbuffer.length - } - - var fixed = url.resolve(registry, escaped(data.name)) - var client = this - var options = { - method: 'PUT', - body: root, - auth: auth - } - this.request(fixed, options, function (er, parsed, json, res) { - var r409 = 'must supply latest _rev to update existing package' - var r409b = 'Document update conflict.' - var conflict = res && res.statusCode === 409 - if (parsed && (parsed.reason === r409 || parsed.reason === r409b)) { - conflict = true - } - - // a 409 is typical here. GET the data and merge in. - if (er && !conflict) { - client.log.error('publish', 'Failed PUT ' + (res && res.statusCode)) - return cb(er) - } - - if (!er && !conflict) return cb(er, parsed, json, res) - - // let's see what versions are already published. - client.request(fixed + '?write=true', { auth: auth }, function (er, current) { - if (er) return cb(er) - - putNext.call(client, registry, data.version, root, current, auth, cb) - }) - }) -} - -function putNext (registry, newVersion, root, current, auth, cb) { - // already have the tardata on the root object - // just merge in existing stuff - var curVers = Object.keys(current.versions || {}).map(function (v) { - return semver.clean(v, true) - }).concat(Object.keys(current.time || {}).map(function (v) { - if (semver.valid(v, true)) return semver.clean(v, true) - }).filter(function (v) { - return v - })) - - if (curVers.indexOf(newVersion) !== -1) { - return cb(conflictError(root.name, newVersion)) - } - - current.versions[newVersion] = root.versions[newVersion] - current._attachments = current._attachments || {} - for (var i in root) { - switch (i) { - // objects that copy over the new stuffs - case 'dist-tags': - case 'versions': - case '_attachments': - for (var j in root[i]) { - current[i][j] = root[i][j] - } - break - - // ignore these - case 'maintainers': - break - - // copy - default: - current[i] = root[i] - } - } - var maint = JSON.parse(JSON.stringify(root.maintainers)) - root.versions[newVersion].maintainers = maint - - var uri = url.resolve(registry, escaped(root.name)) - var options = { - method: 'PUT', - body: current, - auth: auth - } - this.request(uri, options, cb) -} - -function conflictError (pkgid, version) { - var e = new Error('cannot modify pre-existing version') - e.code = 'EPUBLISHCONFLICT' - e.pkgid = pkgid - e.version = version - return e -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js deleted file mode 100644 index 5987bfa6fb0e42..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/request.js +++ /dev/null @@ -1,336 +0,0 @@ -module.exports = regRequest - -// npm: means -// 1. https -// 2. send authorization -// 3. content-type is 'application/json' -- metadata -// -var assert = require('assert') -var url = require('url') -var zlib = require('zlib') -var Stream = require('stream').Stream -var STATUS_CODES = require('http').STATUS_CODES - -var request = require('request') -var once = require('once') - -function regRequest (uri, params, cb_) { - assert(typeof uri === 'string', 'must pass uri to request') - assert(params && typeof params === 'object', 'must pass params to request') - assert(typeof cb_ === 'function', 'must pass callback to request') - - params.method = params.method || 'GET' - this.log.verbose('request', 'uri', uri) - - // Since there are multiple places where an error could occur, - // don't let the cb be called more than once. - var cb = once(cb_) - - if (uri.match(/^\/?favicon.ico/)) { - return cb(new Error("favicon.ico isn't a package, it's a picture.")) - } - - var adduserChange = /\/?-\/user\/org\.couchdb\.user:([^/]+)\/-rev/ - var isUserChange = uri.match(adduserChange) - var adduserNew = /\/?-\/user\/org\.couchdb\.user:([^/?]+)$/ - var isNewUser = uri.match(adduserNew) - var alwaysAuth = params.auth && params.auth.alwaysAuth - var isDelete = params.method === 'DELETE' - var isWrite = params.body || isDelete - - if (isUserChange && !isWrite) { - return cb(new Error('trying to change user document without writing(?!)')) - } - - if (params.authed == null) { - // new users can *not* use auth, because they don't *have* auth yet - if (isUserChange) { - this.log.verbose('request', 'updating existing user; sending authorization') - params.authed = true - } else if (isNewUser) { - this.log.verbose('request', "new user, so can't send auth") - params.authed = false - } else if (alwaysAuth) { - this.log.verbose('request', 'always-auth set; sending authorization') - params.authed = true - } else if (isWrite) { - this.log.verbose('request', 'sending authorization for write operation') - params.authed = true - } else { - // most of the time we don't want to auth - this.log.verbose('request', 'no auth needed') - params.authed = false - } - } - - var self = this - this.attempt(function (operation) { - makeRequest.call(self, uri, params, function (er, parsed, raw, response) { - if (response) { - self.log.verbose('headers', response.headers) - if (response.headers['npm-notice']) { - self.log.warn('notice', response.headers['npm-notice']) - } - } - - if (!er || (er.message && er.message.match(/^SSL Error/))) { - if (er) er.code = 'ESSL' - return cb(er, parsed, raw, response) - } - - // Only retry on 408, 5xx or no `response`. - var statusCode = response && response.statusCode - - var timeout = statusCode === 408 - var serverError = statusCode >= 500 - var statusRetry = !statusCode || timeout || serverError - if (er && statusRetry && operation.retry(er)) { - self.log.info('retry', 'will retry, error on last attempt: ' + er) - return undefined - } - cb.apply(null, arguments) - }) - }) -} - -function makeRequest (uri, params, cb_) { - var socket - var cb = once(function (er, parsed, raw, response) { - if (socket) { - // The socket might be returned to a pool for re-use, so don’t keep - // the 'error' listener from here attached. - socket.removeListener('error', cb) - } - - return cb_(er, parsed, raw, response) - }) - - var parsed = url.parse(uri) - var headers = {} - - // metadata should be compressed - headers['accept-encoding'] = 'gzip' - - // metadata should be minified, if the registry supports it - - var er = this.authify(params.authed, parsed, headers, params.auth) - if (er) return cb_(er) - - var useCorgi = params.fullMetadata == null ? false : !params.fullMetadata - - var opts = this.initialize( - parsed, - params.method, - useCorgi ? 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' : 'application/json', - headers - ) - - opts.followRedirect = (typeof params.follow === 'boolean' ? params.follow : true) - opts.encoding = null // tell request let body be Buffer instance - - if (params.etag) { - this.log.verbose('etag', params.etag) - headers[params.method === 'GET' ? 'if-none-match' : 'if-match'] = params.etag - } - - if (params.lastModified && params.method === 'GET') { - this.log.verbose('lastModified', params.lastModified) - headers['if-modified-since'] = params.lastModified - } - - // figure out wth body is - if (params.body) { - if (Buffer.isBuffer(params.body)) { - opts.body = params.body - headers['content-type'] = 'application/json' - headers['content-length'] = params.body.length - } else if (typeof params.body === 'string') { - opts.body = params.body - headers['content-type'] = 'application/json' - headers['content-length'] = Buffer.byteLength(params.body) - } else if (params.body instanceof Stream) { - headers['content-type'] = 'application/octet-stream' - if (params.body.size) headers['content-length'] = params.body.size - } else { - delete params.body._etag - delete params.body._lastModified - opts.json = params.body - } - } - - this.log.http('request', params.method, parsed.href || '/') - - var done = requestDone.call(this, params.method, uri, cb) - var req = request(opts, params.streaming ? undefined : decodeResponseBody(done)) - - req.on('error', cb) - - // This should not be necessary, as the HTTP implementation in Node - // passes errors occurring on the socket to the request itself. Being overly - // cautious comes at a low cost, though. - req.on('socket', function (s) { - socket = s - socket.on('error', cb) - }) - - if (params.streaming) { - req.on('response', function (response) { - if (response.statusCode >= 400) { - var parts = [] - response.on('data', function (data) { - parts.push(data) - }) - response.on('end', function () { - decodeResponseBody(done)(null, response, Buffer.concat(parts)) - }) - } else { - response.on('end', function () { - // don't ever re-use connections that had server errors. - // those sockets connect to the Bad Place! - if (response.socket && response.statusCode > 500) { - response.socket.destroy() - } - }) - - return cb(null, response) - } - }) - } - - if (params.body && (params.body instanceof Stream)) { - params.body.pipe(req) - } -} - -function decodeResponseBody (cb) { - return function (er, response, data) { - if (er) return cb(er, response, data) - - // don't ever re-use connections that had server errors. - // those sockets connect to the Bad Place! - if (response.socket && response.statusCode > 500) { - response.socket.destroy() - } - - if (response.headers['content-encoding'] !== 'gzip') { - return cb(er, response, data) - } - - zlib.gunzip(data, function (er, buf) { - if (er) return cb(er, response, data) - - cb(null, response, buf) - }) - } -} - -// cb(er, parsed, raw, response) -function requestDone (method, where, cb) { - return function (er, response, data) { - if (er) return cb(er) - - var urlObj = url.parse(where) - if (urlObj.auth) urlObj.auth = '***' - this.log.http(response.statusCode, url.format(urlObj)) - - if (Buffer.isBuffer(data)) { - data = data.toString() - } - - var parsed - if (data && typeof data === 'string' && response.statusCode !== 304) { - try { - parsed = JSON.parse(data) - } catch (ex) { - ex.message += '\n' + data - this.log.verbose('bad json', data) - this.log.error('registry', 'error parsing json') - return cb(ex, null, data, response) - } - } else if (data) { - parsed = data - data = JSON.stringify(parsed) - } - - // expect data with any error codes - if (!data && response.statusCode >= 400) { - var code = response.statusCode - return cb( - makeError(code + ' ' + STATUS_CODES[code], null, code), - null, - data, - response - ) - } - - er = null - if (parsed && response.headers.etag) { - parsed._etag = response.headers.etag - } - - if (parsed && response.headers['last-modified']) { - parsed._lastModified = response.headers['last-modified'] - } - - // for the search endpoint, the 'error' property can be an object - if ((parsed && parsed.error && typeof parsed.error !== 'object') || - response.statusCode >= 400) { - var w = url.parse(where).pathname.substr(1) - var name - if (!w.match(/^-/)) { - w = w.split('/') - var index = w.indexOf('_rewrite') - if (index === -1) { - index = w.length - 1 - } else { - index++ - } - name = decodeURIComponent(w[index]) - } - - if (!parsed.error) { - if (response.statusCode === 401 && response.headers['www-authenticate']) { - const auth = response.headers['www-authenticate'].split(/,\s*/).map(s => s.toLowerCase()) - if (auth.indexOf('ipaddress') !== -1) { - er = makeError('Login is not allowed from your IP address', name, response.statusCode, 'EAUTHIP') - } else if (auth.indexOf('otp') !== -1) { - er = makeError('OTP required for this operation', name, response.statusCode, 'EOTP') - } else { - er = makeError('Unable to authenticate, need: ' + response.headers['www-authenticate'], name, response.statusCode, 'EAUTHUNKNOWN') - } - } else { - const msg = parsed.message ? ': ' + parsed.message : '' - er = makeError( - 'Registry returned ' + response.statusCode + - ' for ' + method + - ' on ' + where + - msg, - name, - response.statusCode - ) - } - } else if (name && parsed.error === 'not_found') { - er = makeError('404 Not Found: ' + name, name, response.statusCode) - } else if (name && parsed.error === 'User not found') { - er = makeError('User not found. Check `npm whoami` and make sure you have a NPM account.', name, response.statusCode) - } else { - er = makeError( - parsed.error + ' ' + (parsed.reason || '') + ': ' + (name || w), - name, - response.statusCode - ) - } - } - return cb(er, parsed, data, response) - }.bind(this) -} - -function makeError (message, name, statusCode, code) { - var er = new Error(message) - if (name) er.pkgid = name - if (statusCode) { - er.statusCode = statusCode - er.code = code || 'E' + statusCode - } - return er -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/send-anonymous-CLI-metrics.js b/deps/npm/node_modules/npm-registry-client/lib/send-anonymous-CLI-metrics.js deleted file mode 100644 index b5b7a1dca15e7f..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/send-anonymous-CLI-metrics.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = send - -var assert = require('assert') -var url = require('url') - -function send (registryUrl, params, cb) { - assert(typeof registryUrl === 'string', 'must pass registry URI') - assert(params && typeof params === 'object', 'must pass params') - assert(typeof cb === 'function', 'must pass callback') - - var uri = url.resolve(registryUrl, '-/npm/anon-metrics/v1/' + - encodeURIComponent(params.metricId)) - - this.request(uri, { - method: 'PUT', - body: JSON.stringify(params.metrics), - authed: false - }, cb) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/star.js b/deps/npm/node_modules/npm-registry-client/lib/star.js deleted file mode 100644 index 5c9224eaa21a72..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/star.js +++ /dev/null @@ -1,51 +0,0 @@ -module.exports = star - -var assert = require('assert') - -function star (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to star') - assert(params && typeof params === 'object', 'must pass params to star') - assert(typeof cb === 'function', 'must pass callback to star') - - var starred = !!params.starred - - var auth = params.auth - assert(auth && typeof auth === 'object', 'must pass auth to star') - if (!(auth.token || (auth.password && auth.username && auth.email))) { - var er = new Error('Must be logged in to star/unstar packages') - er.code = 'ENEEDAUTH' - return cb(er) - } - - var client = this - this.request(uri + '?write=true', { auth: auth }, function (er, fullData) { - if (er) return cb(er) - - client.whoami(uri, params, function (er, username) { - if (er) return cb(er) - - var data = { - _id: fullData._id, - _rev: fullData._rev, - users: fullData.users || {} - } - - if (starred) { - client.log.info('starring', data._id) - data.users[username] = true - client.log.verbose('starring', data) - } else { - delete data.users[username] - client.log.info('unstarring', data._id) - client.log.verbose('unstarring', data) - } - - var options = { - method: 'PUT', - body: data, - auth: auth - } - return client.request(uri, options, cb) - }) - }) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/stars.js b/deps/npm/node_modules/npm-registry-client/lib/stars.js deleted file mode 100644 index ba47f2c1efc463..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/stars.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = stars - -var assert = require('assert') -var url = require('url') - -function stars (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to stars') - assert(params && typeof params === 'object', 'must pass params to stars') - assert(typeof cb === 'function', 'must pass callback to stars') - - var auth = params.auth - var name = params.username || (auth && auth.username) - if (!name) return cb(new Error('must pass either username or auth to stars')) - var encoded = encodeURIComponent(name) - var path = '-/_view/starredByUser?key="' + encoded + '"' - - this.request(url.resolve(uri, path), { auth: auth }, cb) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/tag.js b/deps/npm/node_modules/npm-registry-client/lib/tag.js deleted file mode 100644 index 3b6dad1df26ca8..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/tag.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = tag - -var assert = require('assert') - -function tag (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to tag') - assert(params && typeof params === 'object', 'must pass params to tag') - assert(typeof cb === 'function', 'must pass callback to tag') - - assert(typeof params.version === 'string', 'must pass version to tag') - assert(typeof params.tag === 'string', 'must pass tag name to tag') - assert( - params.auth && typeof params.auth === 'object', - 'must pass auth to tag' - ) - - var options = { - method: 'PUT', - body: JSON.stringify(params.version), - auth: params.auth - } - this.request(uri + '/' + params.tag, options, cb) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/team.js b/deps/npm/node_modules/npm-registry-client/lib/team.js deleted file mode 100644 index 327fa9cd5abf1a..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/team.js +++ /dev/null @@ -1,105 +0,0 @@ -module.exports = team - -var assert = require('assert') -var url = require('url') - -var subcommands = {} - -function team (sub, uri, params, cb) { - teamAssertions(sub, uri, params, cb) - return subcommands[sub].call(this, uri, params, cb) -} - -subcommands.create = function (uri, params, cb) { - return this.request(apiUri(uri, 'org', params.scope, 'team'), { - method: 'PUT', - auth: params.auth, - body: JSON.stringify({ - name: params.team - }) - }, cb) -} - -subcommands.destroy = function (uri, params, cb) { - return this.request(apiUri(uri, 'team', params.scope, params.team), { - method: 'DELETE', - auth: params.auth - }, cb) -} - -subcommands.add = function (uri, params, cb) { - return this.request(apiUri(uri, 'team', params.scope, params.team, 'user'), { - method: 'PUT', - auth: params.auth, - body: JSON.stringify({ - user: params.user - }) - }, cb) -} - -subcommands.rm = function (uri, params, cb) { - return this.request(apiUri(uri, 'team', params.scope, params.team, 'user'), { - method: 'DELETE', - auth: params.auth, - body: JSON.stringify({ - user: params.user - }) - }, cb) -} - -subcommands.ls = function (uri, params, cb) { - var uriParams = '?format=cli' - if (params.team) { - var reqUri = apiUri( - uri, 'team', params.scope, params.team, 'user') + uriParams - return this.request(reqUri, { - method: 'GET', - auth: params.auth - }, cb) - } else { - return this.request(apiUri(uri, 'org', params.scope, 'team') + uriParams, { - method: 'GET', - auth: params.auth - }, cb) - } -} - -// TODO - we punted this to v2 -// subcommands.edit = function (uri, params, cb) { -// return this.request(apiUri(uri, 'team', params.scope, params.team, 'user'), { -// method: 'POST', -// auth: params.auth, -// body: JSON.stringify({ -// users: params.users -// }) -// }, cb) -// } - -function apiUri (registryUri) { - var path = Array.prototype.slice.call(arguments, 1) - .map(encodeURIComponent) - .join('/') - return url.resolve(registryUri, '-/' + path) -} - -function teamAssertions (subcommand, uri, params, cb) { - assert(subcommand, 'subcommand is required') - assert(subcommands.hasOwnProperty(subcommand), - 'team subcommand must be one of ' + Object.keys(subcommands)) - assert(typeof uri === 'string', 'registry URI is required') - assert(typeof params === 'object', 'params are required') - assert(typeof params.auth === 'object', 'auth is required') - assert(typeof params.scope === 'string', 'scope is required') - assert(!cb || typeof cb === 'function', 'callback must be a function') - if (subcommand !== 'ls') { - assert(typeof params.team === 'string', 'team name is required') - } - if (subcommand === 'rm' || subcommand === 'add') { - assert(typeof params.user === 'string', 'user is required') - } - if (subcommand === 'edit') { - assert(typeof params.users === 'object' && - params.users.length != null, - 'users is required') - } -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js deleted file mode 100644 index 05c5a4b6110069..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js +++ /dev/null @@ -1,120 +0,0 @@ -module.exports = unpublish - -// fetch the data -// modify to remove the version in question -// If no versions remaining, then DELETE -// else, PUT the modified data -// delete the tarball - -var semver = require('semver') -var url = require('url') -var chain = require('slide').chain -var assert = require('assert') - -function unpublish (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to unpublish') - assert(params && typeof params === 'object', 'must pass params to unpublish') - assert(typeof cb === 'function', 'must pass callback to unpublish') - - var ver = params.version - var auth = params.auth - assert(auth && typeof auth === 'object', 'must pass auth to unpublish') - - var options = { - timeout: -1, - follow: false, - auth: auth - } - this.get(uri + '?write=true', options, function (er, data) { - if (er) { - this.log.info('unpublish', uri + ' not published') - return cb() - } - // remove all if no version specified - if (!ver) { - this.log.info('unpublish', 'No version specified, removing all') - return this.request(uri + '/-rev/' + data._rev, { method: 'DELETE', auth: auth }, cb) - } - - var versions = data.versions || {} - var versionPublic = versions.hasOwnProperty(ver) - - var dist - if (!versionPublic) { - this.log.info('unpublish', uri + '@' + ver + ' not published') - } else { - dist = versions[ver].dist - this.log.verbose('unpublish', 'removing attachments', dist) - } - - delete versions[ver] - // if it was the only version, then delete the whole package. - if (!Object.keys(versions).length) { - this.log.info('unpublish', 'No versions remain, removing entire package') - return this.request(uri + '/-rev/' + data._rev, { method: 'DELETE', auth: auth }, cb) - } - - if (!versionPublic) return cb() - - var latestVer = data['dist-tags'].latest - for (var tag in data['dist-tags']) { - if (data['dist-tags'][tag] === ver) delete data['dist-tags'][tag] - } - - if (latestVer === ver) { - data['dist-tags'].latest = - Object.getOwnPropertyNames(versions).sort(semver.compareLoose).pop() - } - - var rev = data._rev - delete data._revisions - delete data._attachments - var cb_ = detacher.call(this, uri, data, dist, auth, cb) - - this.request(uri + '/-rev/' + rev, { method: 'PUT', body: data, auth: auth }, function (er) { - if (er) { - this.log.error('unpublish', 'Failed to update data') - } - cb_(er) - }.bind(this)) - }.bind(this)) -} - -function detacher (uri, data, dist, credentials, cb) { - return function (er) { - if (er) return cb(er) - this.get(escape(uri, data.name), { auth: credentials }, function (er, data) { - if (er) return cb(er) - - var tb = url.parse(dist.tarball) - - detach.call(this, uri, data, tb.pathname, data._rev, credentials, function (er) { - if (er || !dist.bin) return cb(er) - chain(Object.keys(dist.bin).map(function (bt) { - return function (cb) { - var d = dist.bin[bt] - detach.call(this, uri, data, url.parse(d.tarball).pathname, null, credentials, cb) - }.bind(this) - }, this), cb) - }.bind(this)) - }.bind(this)) - }.bind(this) -} - -function detach (uri, data, path, rev, credentials, cb) { - if (rev) { - path += '/-rev/' + rev - this.log.info('detach', path) - return this.request(url.resolve(uri, path), { method: 'DELETE', auth: credentials }, cb) - } - this.get(escape(uri, data.name), { auth: credentials }, function (er, data) { - rev = data._rev - if (!rev) return cb(new Error('No _rev found in ' + data._id)) - detach.call(this, data, path, rev, cb) - }.bind(this)) -} - -function escape (base, name) { - var escaped = name.replace(/\//, '%2f') - return url.resolve(base, escaped) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/whoami.js b/deps/npm/node_modules/npm-registry-client/lib/whoami.js deleted file mode 100644 index 68db49e59a402a..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/whoami.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = whoami - -var url = require('url') -var assert = require('assert') - -function whoami (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to whoami') - assert(params && typeof params === 'object', 'must pass params to whoami') - assert(typeof cb === 'function', 'must pass callback to whoami') - - var auth = params.auth - assert(auth && typeof auth === 'object', 'must pass auth to whoami') - - if (auth.username) return process.nextTick(cb.bind(this, null, auth.username)) - - this.request(url.resolve(uri, '-/whoami'), { auth: auth }, function (er, userdata) { - if (er) return cb(er) - - cb(null, userdata.username) - }) -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore deleted file mode 100644 index e7726a071b7f39..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules/* -npm-debug.log diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/License b/deps/npm/node_modules/npm-registry-client/node_modules/retry/License deleted file mode 100644 index 0b58de379fb308..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/License +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011: -Tim Koschützki (tim@debuggable.com) -Felix Geisendörfer (felix@debuggable.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/npm-registry-client/node_modules/retry/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile deleted file mode 100644 index 98e7167bbe359f..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -SHELL := /bin/bash - -test: - @node test/runner.js - -release-major: test - npm version major -m "Release %s" - git push - npm publish - -release-minor: test - npm version minor -m "Release %s" - git push - npm publish - -release-patch: test - npm version patch -m "Release %s" - git push - npm publish - -.PHONY: test diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md deleted file mode 100644 index eee05f7bb61537..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md +++ /dev/null @@ -1,215 +0,0 @@ -# retry - -Abstraction for exponential and custom retry strategies for failed operations. - -## Installation - - npm install retry - -## Current Status - -This module has been tested and is ready to be used. - -## Tutorial - -The example below will retry a potentially failing `dns.resolve` operation -`10` times using an exponential backoff strategy. With the default settings, this -means the last attempt is made after `17 minutes and 3 seconds`. - -``` javascript -var dns = require('dns'); -var retry = require('retry'); - -function faultTolerantResolve(address, cb) { - var operation = retry.operation(); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(err ? operation.mainError() : null, addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, addresses) { - console.log(err, addresses); -}); -``` - -Of course you can also configure the factors that go into the exponential -backoff. See the API documentation below for all available settings. -currentAttempt is an int representing the number of attempts so far. - -``` javascript -var operation = retry.operation({ - retries: 5, - factor: 3, - minTimeout: 1 * 1000, - maxTimeout: 60 * 1000, - randomize: true, -}); -``` - -## API - -### retry.operation([options]) - -Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: - -* `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. - -### retry.timeouts([options]) - -Returns an array of timeouts. All time `options` and return values are in -milliseconds. If `options` is an array, a copy of that array is returned. - -`options` is a JS object that can contain any of the following keys: - -* `retries`: The maximum amount of times to retry the operation. Default is `10`. -* `factor`: The exponential factor to use. Default is `2`. -* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. -* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. -* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. - -The formula used to calculate the individual timeouts is: - -``` -Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) -``` - -Have a look at [this article][article] for a better explanation of approach. - -If you want to tune your `factor` / `times` settings to attempt the last retry -after a certain amount of time, you can use wolfram alpha. For example in order -to tune for `10` attempts in `5 minutes`, you can use this equation: - -![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) - -Explaining the various values from left to right: - -* `k = 0 ... 9`: The `retries` value (10) -* `1000`: The `minTimeout` value in ms (1000) -* `x^k`: No need to change this, `x` will be your resulting factor -* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) - -To make this a little easier for you, use wolfram alpha to do the calculations: - - - -[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html - -### retry.createTimeout(attempt, opts) - -Returns a new `timeout` (integer in milliseconds) based on the given parameters. - -`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). - -`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. - -`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). - -### retry.wrap(obj, [options], [methodNames]) - -Wrap all functions of the `obj` with retry. Optionally you can pass operation options and -an array of method names which need to be wrapped. - -``` -retry.wrap(obj) - -retry.wrap(obj, ['method1', 'method2']) - -retry.wrap(obj, {retries: 3}) - -retry.wrap(obj, {retries: 3}, ['method1', 'method2']) -``` -The `options` object can take any options that the usual call to `retry.operation` can take. - -### new RetryOperation(timeouts, [options]) - -Creates a new `RetryOperation` where `timeouts` is an array where each value is -a timeout given in milliseconds. - -Available options: -* `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. - -If `forever` is true, the following changes happen: -* `RetryOperation.errors()` will only output an array of one item: the last error. -* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. - -#### retryOperation.errors() - -Returns an array of all errors that have been passed to -`retryOperation.retry()` so far. - -#### retryOperation.mainError() - -A reference to the error object that occured most frequently. Errors are -compared using the `error.message` property. - -If multiple error messages occured the same amount of time, the last error -object with that message is returned. - -If no errors occured so far, the value is `null`. - -#### retryOperation.attempt(fn, timeoutOps) - -Defines the function `fn` that is to be retried and executes it for the first -time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. - -Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. -Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. - - -#### retryOperation.try(fn) - -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. - -#### retryOperation.start(fn) - -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. - -#### retryOperation.retry(error) - -Returns `false` when no `error` value is given, or the maximum amount of retries -has been reached. - -Otherwise it returns `true`, and retries the operation after the timeout for -the current attempt number. - -#### retryOperation.stop() - -Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. - -#### retryOperation.attempts() - -Returns an int representing the number of attempts it took to call `fn` before it was successful. - -## License - -retry is licensed under the MIT license. - - -# Changelog - -0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. - -0.9.0 Adding `unref` functionality, thanks to @satazor. - -0.8.0 Implementing retry.wrap. - -0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). - -0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. - -0.5.0 Some minor refactoring. - -0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. - -0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). - -0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif b/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif deleted file mode 100644 index 97107237ba19f51997d8d76135bc7d1486d856f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1209 zcmV;q1V;NuNk%w1VXpu&0M!5h000001ONyK2nY-a5D*X$6c88~7#JKFARr(hBp@j$ zDJd)|F)%SPG%-0iIXOHzK|n!4L_tbON=i&hQczM-RZ?16T3TINVqs!pWnyY+YHDq2 zb8&NXb#r@pdwYF*gMovCg@cQUi;Inml#!H_m6V*BoSdDUq@kpwrKGH?tgNoAw6e6c zwzR#vy}iD@#lpqK#>LIb&CSlu)za0~*45tH-rnBc=Hlk&=H~9|?(XjH_VV`j_V)k! z|NsC0EC2ui0IvWs000L6z@KnPEENVOfMTEH9c0Z7p9z3<`87kr4n!IH|Ew$buF^Tr6-3^@midQKv4UFk?fCD@~8E z@HgbfvLPrU7IV4gfp|8%C^H$l;qq zLJ;`y;|7BS2YlpEz->xcBQ#7@yHNtNkOmwQ1ek!X@sGzuLXR#jx2fyLw;309jQGe6 zL`?+$umPZ&50}J^BQGxGIN%{G2=u5hqw|pm*t2Ul0ssMk0vb%GI^lz~c)})l{~Qc?h2kCMJmBf=4KTfq+A}mV<6G&6wD3KiFu51s1j8f&fS0 zFaiqI41q&$@ZBIIl0*neBoe|cd1H+<3Zdf>DJ(#i62j@_f)Fj-_2my?IyGjQMd%>G z07WXH-J3lkxMd6n7?DE>JIL@P5d*{^#0>(>vA~&p4RL3ldlu2^8P z!OlGQ%z<|`+iWomtGr?~EJ7!(^wLZ>?ex=7N4-QZ)=BNMGD+xg!3P&;Y_%-ZByj;I zEWG$NFy8zC&JhLd@WT!ToDGaV{P^?c4^0Iv_b4i{ghbnK$GtZyTzMtL-DCey_TZ>w XwprD$S>S;MUNdg_<(OxVL=XTw-hl|W diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js deleted file mode 100644 index 446729b6f9af6b..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js +++ /dev/null @@ -1,31 +0,0 @@ -var dns = require('dns'); -var retry = require('../lib/retry'); - -function faultTolerantResolve(address, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, errors, addresses) { - console.warn('err:'); - console.log(err); - - console.warn('addresses:'); - console.log(addresses); -}); \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js deleted file mode 100644 index e1ceafeebafc51..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js +++ /dev/null @@ -1,40 +0,0 @@ -var retry = require('../lib/retry'); - -function attemptAsyncOperation(someInput, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - failingAsyncOperation(someInput, function(err, result) { - - if (err && err.message === 'A fatal error') { - operation.stop(); - return cb(err); - } - - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), result); - }); - }); -} - -attemptAsyncOperation('test input', function(err, errors, result) { - console.warn('err:'); - console.log(err); - - console.warn('result:'); - console.log(result); -}); - -function failingAsyncOperation(input, cb) { - return setImmediate(cb.bind(null, new Error('A fatal error'))); -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js deleted file mode 100644 index ee62f3a112c28b..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/retry'); \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js deleted file mode 100644 index 77428cfd0006fa..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js +++ /dev/null @@ -1,99 +0,0 @@ -var RetryOperation = require('./retry_operation'); - -exports.operation = function(options) { - var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts, { - forever: options && options.forever, - unref: options && options.unref - }); -}; - -exports.timeouts = function(options) { - if (options instanceof Array) { - return [].concat(options); - } - - var opts = { - retries: 10, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: Infinity, - randomize: false - }; - for (var key in options) { - opts[key] = options[key]; - } - - if (opts.minTimeout > opts.maxTimeout) { - throw new Error('minTimeout is greater than maxTimeout'); - } - - var timeouts = []; - for (var i = 0; i < opts.retries; i++) { - timeouts.push(this.createTimeout(i, opts)); - } - - if (options && options.forever && !timeouts.length) { - timeouts.push(this.createTimeout(i, opts)); - } - - // sort the array numerically ascending - timeouts.sort(function(a,b) { - return a - b; - }); - - return timeouts; -}; - -exports.createTimeout = function(attempt, opts) { - var random = (opts.randomize) - ? (Math.random() + 1) - : 1; - - var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); - timeout = Math.min(timeout, opts.maxTimeout); - - return timeout; -}; - -exports.wrap = function(obj, options, methods) { - if (options instanceof Array) { - methods = options; - options = null; - } - - if (!methods) { - methods = []; - for (var key in obj) { - if (typeof obj[key] === 'function') { - methods.push(key); - } - } - } - - for (var i = 0; i < methods.length; i++) { - var method = methods[i]; - var original = obj[method]; - - obj[method] = function retryWrapper() { - var op = exports.operation(options); - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - - args.push(function(err) { - if (op.retry(err)) { - return; - } - if (err) { - arguments[0] = op.mainError(); - } - callback.apply(this, arguments); - }); - - op.attempt(function() { - original.apply(obj, args); - }); - }; - obj[method].options = options; - } -}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js deleted file mode 100644 index 2b3db8e1776973..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js +++ /dev/null @@ -1,143 +0,0 @@ -function RetryOperation(timeouts, options) { - // Compatibility for the old (timeouts, retryForever) signature - if (typeof options === 'boolean') { - options = { forever: options }; - } - - this._timeouts = timeouts; - this._options = options || {}; - this._fn = null; - this._errors = []; - this._attempts = 1; - this._operationTimeout = null; - this._operationTimeoutCb = null; - this._timeout = null; - - if (this._options.forever) { - this._cachedTimeouts = this._timeouts.slice(0); - } -} -module.exports = RetryOperation; - -RetryOperation.prototype.stop = function() { - if (this._timeout) { - clearTimeout(this._timeout); - } - - this._timeouts = []; - this._cachedTimeouts = null; -}; - -RetryOperation.prototype.retry = function(err) { - if (this._timeout) { - clearTimeout(this._timeout); - } - - if (!err) { - return false; - } - - this._errors.push(err); - - var timeout = this._timeouts.shift(); - if (timeout === undefined) { - if (this._cachedTimeouts) { - // retry forever, only keep last error - this._errors.splice(this._errors.length - 1, this._errors.length); - this._timeouts = this._cachedTimeouts.slice(0); - timeout = this._timeouts.shift(); - } else { - return false; - } - } - - var self = this; - var timer = setTimeout(function() { - self._attempts++; - - if (self._operationTimeoutCb) { - self._timeout = setTimeout(function() { - self._operationTimeoutCb(self._attempts); - }, self._operationTimeout); - - if (this._options.unref) { - self._timeout.unref(); - } - } - - self._fn(self._attempts); - }, timeout); - - if (this._options.unref) { - timer.unref(); - } - - return true; -}; - -RetryOperation.prototype.attempt = function(fn, timeoutOps) { - this._fn = fn; - - if (timeoutOps) { - if (timeoutOps.timeout) { - this._operationTimeout = timeoutOps.timeout; - } - if (timeoutOps.cb) { - this._operationTimeoutCb = timeoutOps.cb; - } - } - - var self = this; - if (this._operationTimeoutCb) { - this._timeout = setTimeout(function() { - self._operationTimeoutCb(); - }, self._operationTimeout); - } - - this._fn(this._attempts); -}; - -RetryOperation.prototype.try = function(fn) { - console.log('Using RetryOperation.try() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = function(fn) { - console.log('Using RetryOperation.start() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = RetryOperation.prototype.try; - -RetryOperation.prototype.errors = function() { - return this._errors; -}; - -RetryOperation.prototype.attempts = function() { - return this._attempts; -}; - -RetryOperation.prototype.mainError = function() { - if (this._errors.length === 0) { - return null; - } - - var counts = {}; - var mainError = null; - var mainErrorCount = 0; - - for (var i = 0; i < this._errors.length; i++) { - var error = this._errors[i]; - var message = error.message; - var count = (counts[message] || 0) + 1; - - counts[message] = count; - - if (count >= mainErrorCount) { - mainError = error; - mainErrorCount = count; - } - } - - return mainError; -}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json deleted file mode 100644 index 26f1daa8ca1368..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "retry@^0.10.0", - "_id": "retry@0.10.1", - "_inBundle": false, - "_integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", - "_location": "/npm-registry-client/retry", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "retry@^0.10.0", - "name": "retry", - "escapedName": "retry", - "rawSpec": "^0.10.0", - "saveSpec": null, - "fetchSpec": "^0.10.0" - }, - "_requiredBy": [ - "/npm-registry-client" - ], - "_resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", - "_shasum": "e76388d217992c252750241d3d3956fed98d8ff4", - "_spec": "retry@^0.10.0", - "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client", - "author": { - "name": "Tim Koschützki", - "email": "tim@debuggable.com", - "url": "http://debuggable.com/" - }, - "bugs": { - "url": "https://github.com/tim-kos/node-retry/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Abstraction for exponential and custom retry strategies for failed operations.", - "devDependencies": { - "fake": "0.2.0", - "far": "0.0.1" - }, - "directories": { - "lib": "./lib" - }, - "engines": { - "node": "*" - }, - "homepage": "https://github.com/tim-kos/node-retry", - "license": "MIT", - "main": "index", - "name": "retry", - "repository": { - "type": "git", - "url": "git://github.com/tim-kos/node-retry.git" - }, - "version": "0.10.1" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js deleted file mode 100644 index 224720696ebac8..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js +++ /dev/null @@ -1,10 +0,0 @@ -var common = module.exports; -var path = require('path'); - -var rootDir = path.join(__dirname, '..'); -common.dir = { - lib: rootDir + '/lib' -}; - -common.assert = require('assert'); -common.fake = require('fake'); \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js deleted file mode 100644 index b41307cb529f12..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js +++ /dev/null @@ -1,24 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var retry = require(common.dir.lib + '/retry'); - -(function testForeverUsesFirstTimeout() { - var operation = retry.operation({ - retries: 0, - minTimeout: 100, - maxTimeout: 100, - forever: true - }); - - operation.attempt(function(numAttempt) { - console.log('>numAttempt', numAttempt); - var err = new Error("foo"); - if (numAttempt == 10) { - operation.stop(); - } - - if (operation.retry(err)) { - return; - } - }); -})(); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js deleted file mode 100644 index 916936424f073b..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js +++ /dev/null @@ -1,176 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var retry = require(common.dir.lib + '/retry'); - -(function testErrors() { - var operation = retry.operation(); - - var error = new Error('some error'); - var error2 = new Error('some other error'); - operation._errors.push(error); - operation._errors.push(error2); - - assert.deepEqual(operation.errors(), [error, error2]); -})(); - -(function testMainErrorReturnsMostFrequentError() { - var operation = retry.operation(); - var error = new Error('some error'); - var error2 = new Error('some other error'); - - operation._errors.push(error); - operation._errors.push(error2); - operation._errors.push(error); - - assert.strictEqual(operation.mainError(), error); -})(); - -(function testMainErrorReturnsLastErrorOnEqualCount() { - var operation = retry.operation(); - var error = new Error('some error'); - var error2 = new Error('some other error'); - - operation._errors.push(error); - operation._errors.push(error2); - - assert.strictEqual(operation.mainError(), error2); -})(); - -(function testAttempt() { - var operation = retry.operation(); - var fn = new Function(); - - var timeoutOpts = { - timeout: 1, - cb: function() {} - }; - operation.attempt(fn, timeoutOpts); - - assert.strictEqual(fn, operation._fn); - assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout); - assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb); -})(); - -(function testRetry() { - var times = 3; - var error = new Error('some error'); - var operation = retry.operation([1, 2, 3]); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (operation.retry(error)) { - return; - } - - assert.strictEqual(attempts, 4); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testRetryForever() { - var error = new Error('some error'); - var operation = retry.operation({ retries: 3, forever: true }); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (attempts !== 6 && operation.retry(error)) { - return; - } - - assert.strictEqual(attempts, 6); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testRetryForeverNoRetries() { - var error = new Error('some error'); - var delay = 50 - var operation = retry.operation({ - retries: null, - forever: true, - minTimeout: delay, - maxTimeout: delay - }); - - var attempts = 0; - var startTime = new Date().getTime(); - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (attempts !== 4 && operation.retry(error)) { - return; - } - - var endTime = new Date().getTime(); - var minTime = startTime + (delay * 3); - var maxTime = minTime + 20 // add a little headroom for code execution time - assert(endTime > minTime) - assert(endTime < maxTime) - assert.strictEqual(attempts, 4); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testStop() { - var error = new Error('some error'); - var operation = retry.operation([1, 2, 3]); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - - if (attempts === 2) { - operation.stop(); - - assert.strictEqual(attempts, 2); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - } - - if (operation.retry(error)) { - return; - } - }); - }; - - fn(); -})(); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js deleted file mode 100644 index 7ca8bc7eb596b5..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js +++ /dev/null @@ -1,77 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var retry = require(common.dir.lib + '/retry'); - -function getLib() { - return { - fn1: function() {}, - fn2: function() {}, - fn3: function() {} - }; -} - -(function wrapAll() { - var lib = getLib(); - retry.wrap(lib); - assert.equal(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); -}()); - -(function wrapAllPassOptions() { - var lib = getLib(); - retry.wrap(lib, {retries: 2}); - assert.equal(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); - assert.equal(lib.fn1.options.retries, 2); - assert.equal(lib.fn2.options.retries, 2); - assert.equal(lib.fn3.options.retries, 2); -}()); - -(function wrapDefined() { - var lib = getLib(); - retry.wrap(lib, ['fn2', 'fn3']); - assert.notEqual(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); -}()); - -(function wrapDefinedAndPassOptions() { - var lib = getLib(); - retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']); - assert.notEqual(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); - assert.equal(lib.fn2.options.retries, 2); - assert.equal(lib.fn3.options.retries, 2); -}()); - -(function runWrappedWithoutError() { - var callbackCalled; - var lib = {method: function(a, b, callback) { - assert.equal(a, 1); - assert.equal(b, 2); - assert.equal(typeof callback, 'function'); - callback(); - }}; - retry.wrap(lib); - lib.method(1, 2, function() { - callbackCalled = true; - }); - assert.ok(callbackCalled); -}()); - -(function runWrappedWithError() { - var callbackCalled; - var lib = {method: function(callback) { - callback(new Error('Some error')); - }}; - retry.wrap(lib, {retries: 1}); - lib.method(function(err) { - callbackCalled = true; - assert.ok(err instanceof Error); - }); - assert.ok(!callbackCalled); -}()); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js deleted file mode 100644 index 7206b0fb0b01d0..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js +++ /dev/null @@ -1,69 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var retry = require(common.dir.lib + '/retry'); - -(function testDefaultValues() { - var timeouts = retry.timeouts(); - - assert.equal(timeouts.length, 10); - assert.equal(timeouts[0], 1000); - assert.equal(timeouts[1], 2000); - assert.equal(timeouts[2], 4000); -})(); - -(function testDefaultValuesWithRandomize() { - var minTimeout = 5000; - var timeouts = retry.timeouts({ - minTimeout: minTimeout, - randomize: true - }); - - assert.equal(timeouts.length, 10); - assert.ok(timeouts[0] > minTimeout); - assert.ok(timeouts[1] > timeouts[0]); - assert.ok(timeouts[2] > timeouts[1]); -})(); - -(function testPassedTimeoutsAreUsed() { - var timeoutsArray = [1000, 2000, 3000]; - var timeouts = retry.timeouts(timeoutsArray); - assert.deepEqual(timeouts, timeoutsArray); - assert.notStrictEqual(timeouts, timeoutsArray); -})(); - -(function testTimeoutsAreWithinBoundaries() { - var minTimeout = 1000; - var maxTimeout = 10000; - var timeouts = retry.timeouts({ - minTimeout: minTimeout, - maxTimeout: maxTimeout - }); - for (var i = 0; i < timeouts; i++) { - assert.ok(timeouts[i] >= minTimeout); - assert.ok(timeouts[i] <= maxTimeout); - } -})(); - -(function testTimeoutsAreIncremental() { - var timeouts = retry.timeouts(); - var lastTimeout = timeouts[0]; - for (var i = 0; i < timeouts; i++) { - assert.ok(timeouts[i] > lastTimeout); - lastTimeout = timeouts[i]; - } -})(); - -(function testTimeoutsAreIncrementalForFactorsLessThanOne() { - var timeouts = retry.timeouts({ - retries: 3, - factor: 0.5 - }); - - var expected = [250, 500, 1000]; - assert.deepEqual(expected, timeouts); -})(); - -(function testRetries() { - var timeouts = retry.timeouts({retries: 2}); - assert.strictEqual(timeouts.length, 2); -})(); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js deleted file mode 100644 index e0ee2f570fe3c0..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js +++ /dev/null @@ -1,5 +0,0 @@ -var far = require('far').create(); - -far.add(__dirname); -far.include(/\/test-.*\.js$/); -far.execute(); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/ssri/CHANGELOG.md b/deps/npm/node_modules/npm-registry-client/node_modules/ssri/CHANGELOG.md deleted file mode 100644 index 5c068948814ede..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/ssri/CHANGELOG.md +++ /dev/null @@ -1,256 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - - -# [5.3.0](https://github.com/zkat/ssri/compare/v5.2.4...v5.3.0) (2018-03-13) - - -### Features - -* **checkData:** optionally throw when checkData fails ([bf26b84](https://github.com/zkat/ssri/commit/bf26b84)) - - - - -## [5.2.4](https://github.com/zkat/ssri/compare/v5.2.3...v5.2.4) (2018-02-16) - - - - -## [5.2.3](https://github.com/zkat/ssri/compare/v5.2.2...v5.2.3) (2018-02-16) - - -### Bug Fixes - -* **hashes:** filter hash priority list by available hashes ([2fa30b8](https://github.com/zkat/ssri/commit/2fa30b8)) -* **integrityStream:** dedupe algorithms to generate ([d56c654](https://github.com/zkat/ssri/commit/d56c654)) - - - - -## [5.2.2](https://github.com/zkat/ssri/compare/v5.2.1...v5.2.2) (2018-02-14) - - -### Bug Fixes - -* **security:** tweak strict SRI regex ([#10](https://github.com/zkat/ssri/issues/10)) ([d0ebcdc](https://github.com/zkat/ssri/commit/d0ebcdc)) - - - - -## [5.2.1](https://github.com/zkat/ssri/compare/v5.2.0...v5.2.1) (2018-02-06) - - - - -# [5.2.0](https://github.com/zkat/ssri/compare/v5.1.0...v5.2.0) (2018-02-06) - - -### Features - -* **match:** add integrity.match() ([3c49cc4](https://github.com/zkat/ssri/commit/3c49cc4)) - - - - -# [5.1.0](https://github.com/zkat/ssri/compare/v5.0.0...v5.1.0) (2018-01-18) - - -### Bug Fixes - -* **checkStream:** integrityStream now takes opts.integrity algos into account ([d262910](https://github.com/zkat/ssri/commit/d262910)) - - -### Features - -* **sha3:** do some guesswork about upcoming sha3 ([7fdd9df](https://github.com/zkat/ssri/commit/7fdd9df)) - - - - -# [5.0.0](https://github.com/zkat/ssri/compare/v4.1.6...v5.0.0) (2017-10-23) - - -### Features - -* **license:** relicense to ISC (#9) ([c82983a](https://github.com/zkat/ssri/commit/c82983a)) - - -### BREAKING CHANGES - -* **license:** the license has been changed from CC0-1.0 to ISC. - - - - -## [4.1.6](https://github.com/zkat/ssri/compare/v4.1.5...v4.1.6) (2017-06-07) - - -### Bug Fixes - -* **checkStream:** make sure to pass all opts through ([0b1bcbe](https://github.com/zkat/ssri/commit/0b1bcbe)) - - - - -## [4.1.5](https://github.com/zkat/ssri/compare/v4.1.4...v4.1.5) (2017-06-05) - - -### Bug Fixes - -* **integrityStream:** stop crashing if opts.algorithms and opts.integrity have an algo mismatch ([fb1293e](https://github.com/zkat/ssri/commit/fb1293e)) - - - - -## [4.1.4](https://github.com/zkat/ssri/compare/v4.1.3...v4.1.4) (2017-05-31) - - -### Bug Fixes - -* **node:** older versions of node[@4](https://github.com/4) do not support base64buffer string parsing ([513df4e](https://github.com/zkat/ssri/commit/513df4e)) - - - - -## [4.1.3](https://github.com/zkat/ssri/compare/v4.1.2...v4.1.3) (2017-05-24) - - -### Bug Fixes - -* **check:** handle various bad hash corner cases better ([c2c262b](https://github.com/zkat/ssri/commit/c2c262b)) - - - - -## [4.1.2](https://github.com/zkat/ssri/compare/v4.1.1...v4.1.2) (2017-04-18) - - -### Bug Fixes - -* **stream:** _flush can be called multiple times. use on("end") ([b1c4805](https://github.com/zkat/ssri/commit/b1c4805)) - - - - -## [4.1.1](https://github.com/zkat/ssri/compare/v4.1.0...v4.1.1) (2017-04-12) - - -### Bug Fixes - -* **pickAlgorithm:** error if pickAlgorithm() is used in an empty Integrity ([fab470e](https://github.com/zkat/ssri/commit/fab470e)) - - - - -# [4.1.0](https://github.com/zkat/ssri/compare/v4.0.0...v4.1.0) (2017-04-07) - - -### Features - -* adding ssri.create for a crypto style interface (#2) ([96f52ad](https://github.com/zkat/ssri/commit/96f52ad)) - - - - -# [4.0.0](https://github.com/zkat/ssri/compare/v3.0.2...v4.0.0) (2017-04-03) - - -### Bug Fixes - -* **integrity:** should have changed the error code before. oops ([8381afa](https://github.com/zkat/ssri/commit/8381afa)) - - -### BREAKING CHANGES - -* **integrity:** EBADCHECKSUM -> EINTEGRITY for verification errors - - - - -## [3.0.2](https://github.com/zkat/ssri/compare/v3.0.1...v3.0.2) (2017-04-03) - - - - -## [3.0.1](https://github.com/zkat/ssri/compare/v3.0.0...v3.0.1) (2017-04-03) - - -### Bug Fixes - -* **package.json:** really should have these in the keywords because search ([a6ac6d0](https://github.com/zkat/ssri/commit/a6ac6d0)) - - - - -# [3.0.0](https://github.com/zkat/ssri/compare/v2.0.0...v3.0.0) (2017-04-03) - - -### Bug Fixes - -* **hashes:** IntegrityMetadata -> Hash ([d04aa1f](https://github.com/zkat/ssri/commit/d04aa1f)) - - -### Features - -* **check:** return IntegrityMetadata on check success ([2301e74](https://github.com/zkat/ssri/commit/2301e74)) -* **fromHex:** ssri.fromHex to make it easier to generate them from hex valus ([049b89e](https://github.com/zkat/ssri/commit/049b89e)) -* **hex:** utility function for getting hex version of digest ([a9f021c](https://github.com/zkat/ssri/commit/a9f021c)) -* **hexDigest:** added hexDigest method to Integrity objects too ([85208ba](https://github.com/zkat/ssri/commit/85208ba)) -* **integrity:** add .isIntegrity and .isIntegrityMetadata ([1b29e6f](https://github.com/zkat/ssri/commit/1b29e6f)) -* **integrityStream:** new stream that can both generate and check streamed data ([fd23e1b](https://github.com/zkat/ssri/commit/fd23e1b)) -* **parse:** allow parsing straight into a single IntegrityMetadata object ([c8ddf48](https://github.com/zkat/ssri/commit/c8ddf48)) -* **pickAlgorithm:** Intergrity#pickAlgorithm() added ([b97a796](https://github.com/zkat/ssri/commit/b97a796)) -* **size:** calculate and update stream sizes ([02ed1ad](https://github.com/zkat/ssri/commit/02ed1ad)) - - -### BREAKING CHANGES - -* **hashes:** `.isIntegrityMetadata` is now `.isHash`. Also, any references to `IntegrityMetadata` now refer to `Hash`. -* **integrityStream:** createCheckerStream has been removed and replaced with a general-purpose integrityStream. - -To convert existing createCheckerStream code, move the `sri` argument into `opts.integrity` in integrityStream. All other options should be the same. -* **check:** `checkData`, `checkStream`, and `createCheckerStream` now yield a whole IntegrityMetadata instance representing the first successful hash match. - - - - -# [2.0.0](https://github.com/zkat/ssri/compare/v1.0.0...v2.0.0) (2017-03-24) - - -### Bug Fixes - -* **strict-mode:** make regexes more rigid ([122a32c](https://github.com/zkat/ssri/commit/122a32c)) - - -### Features - -* **api:** added serialize alias for unparse ([999b421](https://github.com/zkat/ssri/commit/999b421)) -* **concat:** add Integrity#concat() ([cae12c7](https://github.com/zkat/ssri/commit/cae12c7)) -* **pickAlgo:** pick the strongest algorithm provided, by default ([58c18f7](https://github.com/zkat/ssri/commit/58c18f7)) -* **strict-mode:** strict SRI support ([3f0b64c](https://github.com/zkat/ssri/commit/3f0b64c)) -* **stringify:** replaced unparse/serialize with stringify ([4acad30](https://github.com/zkat/ssri/commit/4acad30)) -* **verification:** add opts.pickAlgorithm ([f72e658](https://github.com/zkat/ssri/commit/f72e658)) - - -### BREAKING CHANGES - -* **pickAlgo:** ssri will prioritize specific hashes now -* **stringify:** serialize and unparse have been removed. Use ssri.stringify instead. -* **strict-mode:** functions that accepted an optional `sep` argument now expect `opts.sep`. - - - - -# 1.0.0 (2017-03-23) - - -### Features - -* **api:** implemented initial api ([4fbb16b](https://github.com/zkat/ssri/commit/4fbb16b)) - - -### BREAKING CHANGES - -* **api:** Initial API established. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/ssri/LICENSE.md b/deps/npm/node_modules/npm-registry-client/node_modules/ssri/LICENSE.md deleted file mode 100644 index 8d28acf866d932..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/ssri/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -ISC License - -Copyright (c) npm, Inc. - -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 COPYRIGHT HOLDER DISCLAIMS -ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE -USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/ssri/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/ssri/README.md deleted file mode 100644 index a6c07e7409b81e..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/ssri/README.md +++ /dev/null @@ -1,488 +0,0 @@ -# ssri [![npm version](https://img.shields.io/npm/v/ssri.svg)](https://npm.im/ssri) [![license](https://img.shields.io/npm/l/ssri.svg)](https://npm.im/ssri) [![Travis](https://img.shields.io/travis/zkat/ssri.svg)](https://travis-ci.org/zkat/ssri) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/ssri?svg=true)](https://ci.appveyor.com/project/zkat/ssri) [![Coverage Status](https://coveralls.io/repos/github/zkat/ssri/badge.svg?branch=latest)](https://coveralls.io/github/zkat/ssri?branch=latest) - -[`ssri`](https://github.com/zkat/ssri), short for Standard Subresource -Integrity, is a Node.js utility for parsing, manipulating, serializing, -generating, and verifying [Subresource -Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/) hashes. - -## Install - -`$ npm install --save ssri` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [Contributing](#contributing) -* [API](#api) - * Parsing & Serializing - * [`parse`](#parse) - * [`stringify`](#stringify) - * [`Integrity#concat`](#integrity-concat) - * [`Integrity#toString`](#integrity-to-string) - * [`Integrity#toJSON`](#integrity-to-json) - * [`Integrity#match`](#integrity-match) - * [`Integrity#pickAlgorithm`](#integrity-pick-algorithm) - * [`Integrity#hexDigest`](#integrity-hex-digest) - * Integrity Generation - * [`fromHex`](#from-hex) - * [`fromData`](#from-data) - * [`fromStream`](#from-stream) - * [`create`](#create) - * Integrity Verification - * [`checkData`](#check-data) - * [`checkStream`](#check-stream) - * [`integrityStream`](#integrity-stream) - -### Example - -```javascript -const ssri = require('ssri') - -const integrity = 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo' - -// Parsing and serializing -const parsed = ssri.parse(integrity) -ssri.stringify(parsed) // === integrity (works on non-Integrity objects) -parsed.toString() // === integrity - -// Async stream functions -ssri.checkStream(fs.createReadStream('./my-file'), integrity).then(...) -ssri.fromStream(fs.createReadStream('./my-file')).then(sri => { - sri.toString() === integrity -}) -fs.createReadStream('./my-file').pipe(ssri.createCheckerStream(sri)) - -// Sync data functions -ssri.fromData(fs.readFileSync('./my-file')) // === parsed -ssri.checkData(fs.readFileSync('./my-file'), integrity) // => 'sha512' -``` - -### Features - -* Parses and stringifies SRI strings. -* Generates SRI strings from raw data or Streams. -* Strict standard compliance. -* `?foo` metadata option support. -* Multiple entries for the same algorithm. -* Object-based integrity hash manipulation. -* Small footprint: no dependencies, concise implementation. -* Full test coverage. -* Customizable algorithm picker. - -### Contributing - -The ssri team enthusiastically welcomes contributions and project participation! -There's a bunch of things you can do if you want to contribute! The [Contributor -Guide](CONTRIBUTING.md) has all the information you need for everything from -reporting bugs to contributing entire new features. Please don't hesitate to -jump in if you'd like to, or even ask us questions if something isn't clear. - -### API - -#### `> ssri.parse(sri, [opts]) -> Integrity` - -Parses `sri` into an `Integrity` data structure. `sri` can be an integrity -string, an `Hash`-like with `digest` and `algorithm` fields and an optional -`options` field, or an `Integrity`-like object. The resulting object will be an -`Integrity` instance that has this shape: - -```javascript -{ - 'sha1': [{algorithm: 'sha1', digest: 'deadbeef', options: []}], - 'sha512': [ - {algorithm: 'sha512', digest: 'c0ffee', options: []}, - {algorithm: 'sha512', digest: 'bad1dea', options: ['foo']} - ], -} -``` - -If `opts.single` is truthy, a single `Hash` object will be returned. That is, a -single object that looks like `{algorithm, digest, options}`, as opposed to a -larger object with multiple of these. - -If `opts.strict` is truthy, the resulting object will be filtered such that -it strictly follows the Subresource Integrity spec, throwing away any entries -with any invalid components. This also means a restricted set of algorithms -will be used -- the spec limits them to `sha256`, `sha384`, and `sha512`. - -Strict mode is recommended if the integrity strings are intended for use in -browsers, or in other situations where strict adherence to the spec is needed. - -##### Example - -```javascript -ssri.parse('sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo') // -> Integrity object -``` - -#### `> ssri.stringify(sri, [opts]) -> String` - -This function is identical to [`Integrity#toString()`](#integrity-to-string), -except it can be used on _any_ object that [`parse`](#parse) can handle -- that -is, a string, an `Hash`-like, or an `Integrity`-like. - -The `opts.sep` option defines the string to use when joining multiple entries -together. To be spec-compliant, this _must_ be whitespace. The default is a -single space (`' '`). - -If `opts.strict` is true, the integrity string will be created using strict -parsing rules. See [`ssri.parse`](#parse). - -##### Example - -```javascript -// Useful for cleaning up input SRI strings: -ssri.stringify('\n\rsha512-foo\n\t\tsha384-bar') -// -> 'sha512-foo sha384-bar' - -// Hash-like: only a single entry. -ssri.stringify({ - algorithm: 'sha512', - digest:'9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==', - options: ['foo'] -}) -// -> -// 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo' - -// Integrity-like: full multi-entry syntax. Similar to output of `ssri.parse` -ssri.stringify({ - 'sha512': [ - { - algorithm: 'sha512', - digest:'9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==', - options: ['foo'] - } - ] -}) -// -> -// 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo' -``` - -#### `> Integrity#concat(otherIntegrity, [opts]) -> Integrity` - -Concatenates an `Integrity` object with another IntegrityLike, or an integrity -string. - -This is functionally equivalent to concatenating the string format of both -integrity arguments, and calling [`ssri.parse`](#ssri-parse) on the new string. - -If `opts.strict` is true, the new `Integrity` will be created using strict -parsing rules. See [`ssri.parse`](#parse). - -##### Example - -```javascript -// This will combine the integrity checks for two different versions of -// your index.js file so you can use a single integrity string and serve -// either of these to clients, from a single `\n> data.parsed.open; // false\n> data.parsed.port; // 8888\n> data.parsed.name; // 'namealert(123)'; -> stripped\n> data.errors; // {}\n> data.warnings; // {}\n```\n\nWarnings and errors:\n\n```\n$ node test.js --port 888 --no-open --name name\n> data.parsed.open; // false\n> data.parsed.port; // undefined; -> error\n> data.parsed.name; // 'name'\n> data.errors; // {port: ['port < 100 which is forbidden']}\n> data.warnings; // {port: ['port < 8000 which is dangerous']}\n```\n\n\n\n\n\n\n","_id":"clean@1.1.4","dist":{"shasum":"5fe3f1d48a22842316eba0a19c51f26428015c80","tarball":"http://localhost:1337/clean/-/clean-1.1.4.tgz"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"2.1.1":{"name":"clean","version":"2.1.1","description":"clean parses and santitize argv or options for node, supporting fully extendable types, shorthands, validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git@github.com:kaelzhang/node-clean.git"},"keywords":["argv","parser","argument-vector","cleaner","simple"],"author":{"name":"Kael"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/kaelzhang/node-clean/issues"},"dependencies":{"checker":"~0.5.1","minimist":"~0.0.5"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-clean.png?branch=master)](https://travis-ci.org/kaelzhang/node-clean)\n\n# clean\n\nClean is small but powerful node.js module that parses and santitize argv or options for node, supporting:\n\n- fully extendable types\n- shorthands\n- validatiors\n- setters\n\n# Installation and Usage\n\n```sh\nnpm install clean --save\n```\n\n```js\nvar clean = require('clean')(options);\n```\n\n# Usage\n\n## Argv Shorthands\n\nWe can define shorthands with the option `options.shorthands`.\n\n```js\nvar shorthands = {\n\t// if `String`, define a shorthand for a key name\n\tc: 'cwd',\n\t// if `Array`, define a pattern slice of argv\n\tnr: ['--no-recursive'],\n\t// if `Object`, define a specific value\n\tr3: {\n\t\tretry: 3,\n\t\tstrict: false\n\t}\n};\nclean({\n\tshorthands: shorthands\n}).argv(['node', 'xxx', '-c', 'abc', '--nr', '--r3']); \n// notice that '-nr' will be considered as '-n -r'\n// The result is:\n// {\n//\t\tcwd: 'abc',\n//\t\trecursive: false,\n//\t\tretry: 3,\n//\t\tstrict: false \n// }\n```\n\n## Types\n\n```js\nclean({\n\tschema: {\n\t\tcwd: {\n\t\t\ttype: require('path')\n\t\t},\n\t\t\n\t\tretry: {\n\t\t\ttype: Boolean\n\t\t}\t\t\n\t}\n}).parseArgv(\n\t['node', 'xxx', '--cwd', 'abc', 'retry', 'false'], \n\tfunction(err, results, details){\n\t\tconsole.log(results.cwd); // the `path.resolved()`d 'abc'\n\t\tconsole.log(results.retry === false); // is a boolean, not a string\n\t}\n)\n```\n\nHow to extend a custom type ? See the \"advanced section\".\n\n## Validators and Setters\n\nValidators and setters of `clean` is implemented by `[checker](https://github.com/kaelzhang/node-checker)`, check the apis of `checker` for details.\n\nYou could check out the demo located at \"example/clean.js\". That is a very complicated situation of usage.\n\n```sh\nnode example/clean.js --username guest\n```\n\n\n\n# Programatical Details\n\n## constructor: clean(schema, options)\n\n\n### options\n\n#### options.offset `Number=`\n\nThe offset from which the parser should start to parse. Optional. Default to `2`.\n\n#### options.shorthands `Object=`\n\nThe shorthands used to parse the argv.\n\n#### options.schema `Object=`\n\nThe schema used to clean the given object or the parsred argv\n\n#### options.check_all `Boolean=false`\n\n#### options.parallel `Boolean=false`\n\n#### options.limit `Boolean=false`\n\n\n## .argv(argv)\n\nParses the argument vector, without cleaning the data.\n\n### argv `Array`\n\n### returns `Object`\n\nThe parsed object with shorthand rules applied.\n\n\n## .clean(data, callback)\n\nCleans the given data according to the `schema`.\n\n### data `Object`\n\nThe given data.\n\n### callback `function(err, results, details)`\n\n\n## .parseArgv(argv, callback)\n\nParses argument vector (argv) or something like argv, and cleans the parsed data according to the `schema`.\n\nThis method is equivalent to `c.clean(c.argv(argv), callback)`.\n\n# Advanced Section\n\n## .registerType(type, typeDef)\n\n\n\n\n\n\n","_id":"clean@2.1.1","dist":{"shasum":"f78cb9f6a9b3156e537fc2cbb7caf271636ecb09","tarball":"http://localhost:1337/clean/-/clean-2.1.1.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"2.1.2":{"name":"clean","version":"2.1.2","description":"clean parses and santitize argv or options for node, supporting fully extendable types, shorthands, validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git@github.com:kaelzhang/node-clean.git"},"keywords":["argv","parser","argument-vector","cleaner","simple"],"author":{"name":"Kael"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/kaelzhang/node-clean/issues"},"dependencies":{"checker":"~0.5.1","minimist":"~0.0.5"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"readme":"[![NPM version](https://badge.fury.io/js/clean.png)](http://badge.fury.io/js/clean)\n[![Build Status](https://travis-ci.org/kaelzhang/node-clean.png?branch=master)](https://travis-ci.org/kaelzhang/node-clean)\n[![Dependency Status](https://gemnasium.com/kaelzhang/node-clean.png)](https://gemnasium.com/kaelzhang/node-clean)\n\n# clean\n\nClean is small but powerful node.js module that parses and santitize argv or options for node, supporting:\n\n- fully extendable types\n- shorthands\n- validatiors\n- setters\n\n# Installation and Usage\n\n```sh\nnpm install clean --save\n```\n\n```js\nvar clean = require('clean')(options);\n```\n\n# Usage\n\n## Argv Shorthands\n\nWe can define shorthands with the option `options.shorthands`.\n\n```js\nvar shorthands = {\n\t// if `String`, define a shorthand for a key name\n\tc: 'cwd',\n\t// if `Array`, define a pattern slice of argv\n\tnr: ['--no-recursive'],\n\t// if `Object`, define a specific value\n\tr3: {\n\t\tretry: 3,\n\t\tstrict: false\n\t}\n};\nclean({\n\tshorthands: shorthands\n}).argv(['node', 'xxx', '-c', 'abc', '--nr', '--r3']); \n// notice that '-nr' will be considered as '-n -r'\n// The result is:\n// {\n//\t\tcwd: 'abc',\n//\t\trecursive: false,\n//\t\tretry: 3,\n//\t\tstrict: false \n// }\n```\n\n## Types\n\n```js\nclean({\n\tschema: {\n\t\tcwd: {\n\t\t\ttype: require('path')\n\t\t},\n\t\t\n\t\tretry: {\n\t\t\ttype: Boolean\n\t\t}\t\t\n\t}\n}).parseArgv(\n\t['node', 'xxx', '--cwd', 'abc', 'retry', 'false'], \n\tfunction(err, results, details){\n\t\tconsole.log(results.cwd); // the `path.resolved()`d 'abc'\n\t\tconsole.log(results.retry === false); // is a boolean, not a string\n\t}\n)\n```\n\nHow to extend a custom type ? See the \"advanced section\".\n\n## Validators and Setters\n\nValidators and setters of `clean` is implemented by `[checker](https://github.com/kaelzhang/node-checker)`, check the apis of `checker` for details.\n\nYou could check out the demo located at \"example/clean.js\". That is a very complicated situation of usage.\n\n```sh\nnode example/clean.js --username guest\n```\n\n\n\n# Programatical Details\n\n## constructor: clean(schema, options)\n\n\n### options\n\n#### options.offset `Number=`\n\nThe offset from which the parser should start to parse. Optional. Default to `2`.\n\n#### options.shorthands `Object=`\n\nThe shorthands used to parse the argv.\n\n#### options.schema `Object=`\n\nThe schema used to clean the given object or the parsred argv\n\n#### options.check_all `Boolean=false`\n\n#### options.parallel `Boolean=false`\n\n#### options.limit `Boolean=false`\n\n\n## .argv(argv)\n\nParses the argument vector, without cleaning the data.\n\n### argv `Array`\n\n### returns `Object`\n\nThe parsed object with shorthand rules applied.\n\n\n## .clean(data, callback)\n\nCleans the given data according to the `schema`.\n\n### data `Object`\n\nThe given data.\n\n### callback `function(err, results, details)`\n\n\n## .parseArgv(argv, callback)\n\nParses argument vector (argv) or something like argv, and cleans the parsed data according to the `schema`.\n\nThis method is equivalent to `c.clean(c.argv(argv), callback)`.\n\n# Advanced Section\n\n## .registerType(type, typeDef)\n\n\n\n\n\n\n","_id":"clean@2.1.2","dist":{"shasum":"1b331a23e2352a0ef4e145a72cfce1b461f36c41","tarball":"http://localhost:1337/clean/-/clean-2.1.2.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"2.1.3":{"name":"clean","version":"2.1.3","description":"clean parses and santitize argv or options for node, supporting fully extendable types, shorthands, validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git@github.com:kaelzhang/node-clean.git"},"keywords":["argv","parser","argument-vector","cleaner","simple"],"author":{"name":"Kael"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/kaelzhang/node-clean/issues"},"dependencies":{"checker":"~0.5.1","minimist":"~0.0.5"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"readme":"[![NPM version](https://badge.fury.io/js/clean.png)](http://badge.fury.io/js/clean)\n[![Build Status](https://travis-ci.org/kaelzhang/node-clean.png?branch=master)](https://travis-ci.org/kaelzhang/node-clean)\n[![Dependency Status](https://gemnasium.com/kaelzhang/node-clean.png)](https://gemnasium.com/kaelzhang/node-clean)\n\n# clean\n\nClean is small but powerful node.js module that parses and santitize argv or options for node, supporting:\n\n- fully extendable types\n- shorthands\n- validatiors\n- setters\n\n# Installation and Usage\n\n```sh\nnpm install clean --save\n```\n\n```js\nvar clean = require('clean')(options);\n```\n\n# Usage\n\n## Argv Shorthands\n\nWe can define shorthands with the option `options.shorthands`.\n\n```js\nvar shorthands = {\n\t// if `String`, define a shorthand for a key name\n\tc: 'cwd',\n\t// if `Array`, define a pattern slice of argv\n\tnr: ['--no-recursive'],\n\t// if `Object`, define a specific value\n\tr3: {\n\t\tretry: 3,\n\t\tstrict: false\n\t}\n};\nclean({\n\tshorthands: shorthands\n}).argv(['node', 'xxx', '-c', 'abc', '--nr', '--r3']); \n// notice that '-nr' will be considered as '-n -r'\n// The result is:\n// {\n//\t\tcwd: 'abc',\n//\t\trecursive: false,\n//\t\tretry: 3,\n//\t\tstrict: false \n// }\n```\n\n## Types\n\n```js\nclean({\n\tschema: {\n\t\tcwd: {\n\t\t\ttype: require('path')\n\t\t},\n\t\t\n\t\tretry: {\n\t\t\ttype: Boolean\n\t\t}\t\t\n\t}\n}).parseArgv(\n\t['node', 'xxx', '--cwd', 'abc', 'retry', 'false'], \n\tfunction(err, results, details){\n\t\tconsole.log(results.cwd); // the `path.resolved()`d 'abc'\n\t\tconsole.log(results.retry === false); // is a boolean, not a string\n\t}\n)\n```\n\nHow to extend a custom type ? See the \"advanced section\".\n\n## Validators and Setters\n\nValidators and setters of `clean` is implemented by `[checker](https://github.com/kaelzhang/node-checker)`, check the apis of `checker` for details.\n\nYou could check out the demo located at \"example/clean.js\". That is a very complicated situation of usage.\n\n```sh\nnode example/clean.js --username guest\n```\n\n\n\n# Programatical Details\n\n## constructor: clean(schema, options)\n\n\n### options\n\n#### options.offset `Number=`\n\nThe offset from which the parser should start to parse. Optional. Default to `2`.\n\n#### options.shorthands `Object=`\n\nThe shorthands used to parse the argv.\n\n#### options.schema `Object=`\n\nThe schema used to clean the given object or the parsred argv\n\n#### options.check_all `Boolean=false`\n\n#### options.parallel `Boolean=false`\n\n#### options.limit `Boolean=false`\n\n\n## .argv(argv)\n\nParses the argument vector, without cleaning the data.\n\n### argv `Array`\n\n### returns `Object`\n\nThe parsed object with shorthand rules applied.\n\n\n## .clean(data, callback)\n\nCleans the given data according to the `schema`.\n\n### data `Object`\n\nThe given data.\n\n### callback `function(err, results, details)`\n\n\n## .parseArgv(argv, callback)\n\nParses argument vector (argv) or something like argv, and cleans the parsed data according to the `schema`.\n\nThis method is equivalent to `c.clean(c.argv(argv), callback)`.\n\n# Advanced Section\n\n## .registerType(type, typeDef)\n\n\n\n\n\n\n","_id":"clean@2.1.3","dist":{"shasum":"b7cc64b5f6254daed3a285ae6845a826f1e16c71","tarball":"http://localhost:1337/clean/-/clean-2.1.3.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"2.1.4":{"name":"clean","version":"2.1.4","description":"clean parses and santitize argv or options for node, supporting fully extendable types, shorthands, validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git@github.com:kaelzhang/node-clean.git"},"keywords":["argv","parser","argument-vector","cleaner","simple"],"author":{"name":"Kael"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/kaelzhang/node-clean/issues"},"dependencies":{"checker":"~0.5.1","minimist":"~0.0.5"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"readme":"[![NPM version](https://badge.fury.io/js/clean.png)](http://badge.fury.io/js/clean)\n[![Build Status](https://travis-ci.org/kaelzhang/node-clean.png?branch=master)](https://travis-ci.org/kaelzhang/node-clean)\n[![Dependency Status](https://gemnasium.com/kaelzhang/node-clean.png)](https://gemnasium.com/kaelzhang/node-clean)\n\n# clean\n\nClean is small but powerful node.js module that parses and santitize argv or options for node, supporting:\n\n- fully extendable types\n- shorthands\n- validatiors\n- setters\n\n# Installation and Usage\n\n```sh\nnpm install clean --save\n```\n\n```js\nvar clean = require('clean')(options);\n```\n\n# Usage\n\n## Argv Shorthands\n\nWe can define shorthands with the option `options.shorthands`.\n\n```js\nvar shorthands = {\n\t// if `String`, define a shorthand for a key name\n\tc: 'cwd',\n\t// if `Array`, define a pattern slice of argv\n\tnr: ['--no-recursive'],\n\t// if `Object`, define a specific value\n\tr3: {\n\t\tretry: 3,\n\t\tstrict: false\n\t}\n};\nclean({\n\tshorthands: shorthands\n}).argv(['node', 'xxx', '-c', 'abc', '--nr', '--r3']); \n// notice that '-nr' will be considered as '-n -r'\n// The result is:\n// {\n//\t\tcwd: 'abc',\n//\t\trecursive: false,\n//\t\tretry: 3,\n//\t\tstrict: false \n// }\n```\n\n## Types\n\n```js\nclean({\n\tschema: {\n\t\tcwd: {\n\t\t\ttype: require('path')\n\t\t},\n\t\t\n\t\tretry: {\n\t\t\ttype: Boolean\n\t\t}\t\t\n\t}\n}).parseArgv(\n\t['node', 'xxx', '--cwd', 'abc', 'retry', 'false'], \n\tfunction(err, results, details){\n\t\tconsole.log(results.cwd); // the `path.resolved()`d 'abc'\n\t\tconsole.log(results.retry === false); // is a boolean, not a string\n\t}\n)\n```\n\nHow to extend a custom type ? See the \"advanced section\".\n\n## Validators and Setters\n\nValidators and setters of `clean` is implemented by `[checker](https://github.com/kaelzhang/node-checker)`, check the apis of `checker` for details.\n\nYou could check out the demo located at \"example/clean.js\". That is a very complicated situation of usage.\n\n```sh\nnode example/clean.js --username guest\n```\n\n\n\n# Programatical Details\n\n## constructor: clean(schema, options)\n\n\n### options\n\n#### options.offset `Number=`\n\nThe offset from which the parser should start to parse. Optional. Default to `2`.\n\n#### options.shorthands `Object=`\n\nThe shorthands used to parse the argv.\n\n#### options.schema `Object=`\n\nThe schema used to clean the given object or the parsred argv\n\n#### options.check_all `Boolean=false`\n\n#### options.parallel `Boolean=false`\n\n#### options.limit `Boolean=false`\n\n\n## .argv(argv)\n\nParses the argument vector, without cleaning the data.\n\n### argv `Array`\n\n### returns `Object`\n\nThe parsed object with shorthand rules applied.\n\n\n## .clean(data, callback)\n\nCleans the given data according to the `schema`.\n\n### data `Object`\n\nThe given data.\n\n### callback `function(err, results, details)`\n\n\n## .parseArgv(argv, callback)\n\nParses argument vector (argv) or something like argv, and cleans the parsed data according to the `schema`.\n\nThis method is equivalent to `c.clean(c.argv(argv), callback)`.\n\n# Advanced Section\n\n## .registerType(type, typeDef)\n\n\n\n\n\n\n","_id":"clean@2.1.4","dist":{"shasum":"4c93d479f635b64e0df1230729811030b71ed2e0","tarball":"http://localhost:1337/clean/-/clean-2.1.4.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"2.1.5":{"name":"clean","version":"2.1.5","description":"clean parses and santitize argv or options for node, supporting fully extendable types, shorthands, validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git@github.com:kaelzhang/node-clean.git"},"keywords":["argv","parser","argument-vector","cleaner","simple"],"author":{"name":"Kael"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/kaelzhang/node-clean/issues"},"dependencies":{"checker":"~0.5.1","minimist":"~0.0.5"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"readme":"[![NPM version](https://badge.fury.io/js/clean.png)](http://badge.fury.io/js/clean)\n[![Build Status](https://travis-ci.org/kaelzhang/node-clean.png?branch=master)](https://travis-ci.org/kaelzhang/node-clean)\n[![Dependency Status](https://gemnasium.com/kaelzhang/node-clean.png)](https://gemnasium.com/kaelzhang/node-clean)\n\n# clean\n\nClean is small but powerful node.js module that parses and santitize argv or options for node, supporting:\n\n- fully extendable types\n- shorthands\n- validatiors\n- setters\n\n# Installation and Usage\n\n```sh\nnpm install clean --save\n```\n\n```js\nvar clean = require('clean')(options);\n```\n\n# Usage\n\n## Argv Shorthands\n\nWe can define shorthands with the option `options.shorthands`.\n\n```js\nvar shorthands = {\n\t// if `String`, define a shorthand for a key name\n\tc: 'cwd',\n\t// if `Array`, define a pattern slice of argv\n\tnr: ['--no-recursive'],\n\t// if `Object`, define a specific value\n\tr3: {\n\t\tretry: 3,\n\t\tstrict: false\n\t}\n};\nclean({\n\tshorthands: shorthands\n}).argv(['node', 'xxx', '-c', 'abc', '--nr', '--r3']); \n// notice that '-nr' will be considered as '-n -r'\n// The result is:\n// {\n//\t\tcwd: 'abc',\n//\t\trecursive: false,\n//\t\tretry: 3,\n//\t\tstrict: false \n// }\n```\n\n## Types\n\n```js\nclean({\n\tschema: {\n\t\tcwd: {\n\t\t\ttype: require('path')\n\t\t},\n\t\t\n\t\tretry: {\n\t\t\ttype: Boolean\n\t\t}\t\t\n\t}\n}).parseArgv(\n\t['node', 'xxx', '--cwd', 'abc', 'retry', 'false'], \n\tfunction(err, results, details){\n\t\tconsole.log(results.cwd); // the `path.resolved()`d 'abc'\n\t\tconsole.log(results.retry === false); // is a boolean, not a string\n\t}\n)\n```\n\nHow to extend a custom type ? See the \"advanced section\".\n\n## Validators and Setters\n\nValidators and setters of `clean` is implemented by `[checker](https://github.com/kaelzhang/node-checker)`, check the apis of `checker` for details.\n\nYou could check out the demo located at \"example/clean.js\". That is a very complicated situation of usage.\n\n```sh\nnode example/clean.js --username guest\n```\n\n\n\n# Programatical Details\n\n## constructor: clean(schema, options)\n\n\n### options\n\n#### options.offset `Number=`\n\nThe offset from which the parser should start to parse. Optional. Default to `2`.\n\n#### options.shorthands `Object=`\n\nThe shorthands used to parse the argv.\n\n#### options.schema `Object=`\n\nThe schema used to clean the given object or the parsred argv\n\n#### options.check_all `Boolean=false`\n\n#### options.parallel `Boolean=false`\n\n#### options.limit `Boolean=false`\n\n\n## .argv(argv)\n\nParses the argument vector, without cleaning the data.\n\n### argv `Array`\n\n### returns `Object`\n\nThe parsed object with shorthand rules applied.\n\n\n## .clean(data, callback)\n\nCleans the given data according to the `schema`.\n\n### data `Object`\n\nThe given data.\n\n### callback `function(err, results, details)`\n\n\n## .parseArgv(argv, callback)\n\nParses argument vector (argv) or something like argv, and cleans the parsed data according to the `schema`.\n\nThis method is equivalent to `c.clean(c.argv(argv), callback)`.\n\n# Advanced Section\n\n## .registerType(type, typeDef)\n\n\n\n\n\n\n","_id":"clean@2.1.5","dist":{"shasum":"62c230d6c08ab4d21388b9cbdfd2519bfd43bde9","tarball":"http://localhost:1337/clean/-/clean-2.1.5.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"2.1.6":{"name":"clean","version":"2.1.6","description":"clean parses and santitize argv or options for node, supporting fully extendable types, shorthands, validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git@github.com:kaelzhang/node-clean.git"},"keywords":["argv","parser","argument-vector","cleaner","simple"],"author":{"name":"Kael"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/kaelzhang/node-clean/issues"},"dependencies":{"checker":"~0.5.1","minimist":"~0.0.5"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"readme":"[![NPM version](https://badge.fury.io/js/clean.png)](http://badge.fury.io/js/clean)\n[![Build Status](https://travis-ci.org/kaelzhang/node-clean.png?branch=master)](https://travis-ci.org/kaelzhang/node-clean)\n[![Dependency Status](https://gemnasium.com/kaelzhang/node-clean.png)](https://gemnasium.com/kaelzhang/node-clean)\n\n# clean\n\nClean is small but powerful node.js module that parses and santitize argv or options for node, supporting:\n\n- fully extendable types\n- shorthands\n- validatiors\n- setters\n\n# Installation and Usage\n\n```sh\nnpm install clean --save\n```\n\n```js\nvar clean = require('clean')(options);\n```\n\n# Usage\n\n## Argv Shorthands\n\nWe can define shorthands with the option `options.shorthands`.\n\n```js\nvar shorthands = {\n\t// if `String`, define a shorthand for a key name\n\tc: 'cwd',\n\t// if `Array`, define a pattern slice of argv\n\tnr: ['--no-recursive'],\n\t// if `Object`, define a specific value\n\tr3: {\n\t\tretry: 3,\n\t\tstrict: false\n\t}\n};\nclean({\n\tshorthands: shorthands\n}).argv(['node', 'xxx', '-c', 'abc', '--nr', '--r3']); \n// notice that '-nr' will be considered as '-n -r'\n// The result is:\n// {\n//\t\tcwd: 'abc',\n//\t\trecursive: false,\n//\t\tretry: 3,\n//\t\tstrict: false \n// }\n```\n\n## Types\n\n```js\nclean({\n\tschema: {\n\t\tcwd: {\n\t\t\ttype: require('path')\n\t\t},\n\t\t\n\t\tretry: {\n\t\t\ttype: Boolean\n\t\t}\t\t\n\t}\n}).parseArgv(\n\t['node', 'xxx', '--cwd', 'abc', 'retry', 'false'], \n\tfunction(err, results, details){\n\t\tconsole.log(results.cwd); // the `path.resolved()`d 'abc'\n\t\tconsole.log(results.retry === false); // is a boolean, not a string\n\t}\n)\n```\n\nHow to extend a custom type ? See the \"advanced section\".\n\n## Validators and Setters\n\nValidators and setters of `clean` is implemented by `[checker](https://github.com/kaelzhang/node-checker)`, check the apis of `checker` for details.\n\nYou could check out the demo located at \"example/clean.js\". That is a very complicated situation of usage.\n\n```sh\nnode example/clean.js --username guest\n```\n\n\n\n# Programatical Details\n\n## constructor: clean(schema, options)\n\n\n### options\n\n#### options.offset `Number=`\n\nThe offset from which the parser should start to parse. Optional. Default to `2`.\n\n#### options.shorthands `Object=`\n\nThe shorthands used to parse the argv.\n\n#### options.schema `Object=`\n\nThe schema used to clean the given object or the parsred argv\n\n#### options.check_all `Boolean=false`\n\n#### options.parallel `Boolean=false`\n\n#### options.limit `Boolean=false`\n\n\n## .argv(argv)\n\nParses the argument vector, without cleaning the data.\n\n### argv `Array`\n\n### returns `Object`\n\nThe parsed object with shorthand rules applied.\n\n\n## .clean(data, callback)\n\nCleans the given data according to the `schema`.\n\n### data `Object`\n\nThe given data.\n\n### callback `function(err, results, details)`\n\n\n## .parseArgv(argv, callback)\n\nParses argument vector (argv) or something like argv, and cleans the parsed data according to the `schema`.\n\nThis method is equivalent to `c.clean(c.argv(argv), callback)`.\n\n# Advanced Section\n\n## .registerType(type, typeDef)\n\n\n\n\n\n\n","_id":"clean@2.1.6","dist":{"shasum":"41c80b2b6f5432c60cddb81932ab56563b444f52","tarball":"http://localhost:1337/clean/-/clean-2.1.6.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}}},"readme":"ERROR: No README data found!","maintainers":[{"name":"kael","email":"i@kael.me"}],"time":{"modified":"2013-10-29T10:27:09.584Z","created":"2013-10-09T14:58:35.029Z","0.0.0":"2013-10-09T14:58:56.786Z","1.1.3":"2013-10-09T17:11:53.515Z","1.1.4":"2013-10-09T17:14:02.537Z","2.1.1":"2013-10-10T04:10:32.004Z","2.1.2":"2013-10-14T13:43:09.309Z","2.1.3":"2013-10-14T15:49:01.158Z","2.1.4":"2013-10-17T03:15:37.028Z","2.1.5":"2013-10-17T03:21:04.145Z","2.1.6":"2013-10-29T10:27:09.584Z"},"author":{"name":"Kael"},"repository":{"type":"git","url":"git@github.com:kaelzhang/node-clean.git"},"_attachments":{}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/83/a4/d747b806caae7385778145bcf999fae69eeb6f14343f6801b79b6b7853538961694ac8b4791c7675c27928b5495d12d2f944867db1105e424d5fa9b1e015 b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/83/a4/d747b806caae7385778145bcf999fae69eeb6f14343f6801b79b6b7853538961694ac8b4791c7675c27928b5495d12d2f944867db1105e424d5fa9b1e015 new file mode 100644 index 00000000000000..3dd7b758016759 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/83/a4/d747b806caae7385778145bcf999fae69eeb6f14343f6801b79b6b7853538961694ac8b4791c7675c27928b5495d12d2f944867db1105e424d5fa9b1e015 @@ -0,0 +1 @@ +{"_id":"minimist","_rev":"14-5a3ee715a591f6fb1267503070d3d114","name":"minimist","description":"parse argument options","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.0":{"name":"minimist","version":"0.0.0","description":"parse argument options","main":"index.js","devDependencies":{"tape":"~1.0.4","tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"testling":{"files":"test/*.js","browsers":["ie/6..latest","ff/3.6","firefox/latest","chrome/10","chrome/latest","safari/5.1","safari/latest","opera/12"]},"repository":{"type":"git","url":"git://github.com/substack/minimist.git"},"homepage":"https://github.com/substack/minimist","keywords":["argv","getopt","parser","optimist"],"author":{"name":"James Halliday","email":"mail@substack.net","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.0","dist":{"shasum":"0f62459b3333ea881e554e400243e130ef123568","tarball":"http://localhost:1337/minimist/-/minimist-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.0.1":{"name":"minimist","version":"0.0.1","description":"parse argument options","main":"index.js","devDependencies":{"tape":"~1.0.4","tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"testling":{"files":"test/*.js","browsers":["ie/6..latest","ff/3.6","firefox/latest","chrome/10","chrome/latest","safari/5.1","safari/latest","opera/12"]},"repository":{"type":"git","url":"git://github.com/substack/minimist.git"},"homepage":"https://github.com/substack/minimist","keywords":["argv","getopt","parser","optimist"],"author":{"name":"James Halliday","email":"mail@substack.net","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.1","dist":{"shasum":"fa2439fbf7da8525c51b2a74e2815b380abc8ab6","tarball":"http://localhost:1337/minimist/-/minimist-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.0.2":{"name":"minimist","version":"0.0.2","description":"parse argument options","main":"index.js","devDependencies":{"tape":"~1.0.4","tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"testling":{"files":"test/*.js","browsers":["ie/6..latest","ff/5","firefox/latest","chrome/10","chrome/latest","safari/5.1","safari/latest","opera/12"]},"repository":{"type":"git","url":"git://github.com/substack/minimist.git"},"homepage":"https://github.com/substack/minimist","keywords":["argv","getopt","parser","optimist"],"author":{"name":"James Halliday","email":"mail@substack.net","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.2","dist":{"shasum":"3297e0500be195b8fcb56668c45b925bc9bca7ab","tarball":"http://localhost:1337/minimist/-/minimist-0.0.2.tgz"},"_from":".","_npmVersion":"1.3.7","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.0.3":{"name":"minimist","version":"0.0.3","description":"parse argument options","main":"index.js","devDependencies":{"tape":"~1.0.4","tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"testling":{"files":"test/*.js","browsers":["ie/6..latest","ff/5","firefox/latest","chrome/10","chrome/latest","safari/5.1","safari/latest","opera/12"]},"repository":{"type":"git","url":"git://github.com/substack/minimist.git"},"homepage":"https://github.com/substack/minimist","keywords":["argv","getopt","parser","optimist"],"author":{"name":"James Halliday","email":"mail@substack.net","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.3","dist":{"shasum":"a7a2ef8fbafecbae6c1baa4e56ad81e77acacb94","tarball":"http://localhost:1337/minimist/-/minimist-0.0.3.tgz"},"_from":".","_npmVersion":"1.3.7","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.0.4":{"name":"minimist","version":"0.0.4","description":"parse argument options","main":"index.js","devDependencies":{"tape":"~1.0.4","tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"testling":{"files":"test/*.js","browsers":["ie/6..latest","ff/5","firefox/latest","chrome/10","chrome/latest","safari/5.1","safari/latest","opera/12"]},"repository":{"type":"git","url":"git://github.com/substack/minimist.git"},"homepage":"https://github.com/substack/minimist","keywords":["argv","getopt","parser","optimist"],"author":{"name":"James Halliday","email":"mail@substack.net","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.4","dist":{"shasum":"db41b1028484927a9425765b954075f5082f5048","tarball":"http://localhost:1337/minimist/-/minimist-0.0.4.tgz"},"_from":".","_npmVersion":"1.3.7","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.0.5":{"name":"minimist","version":"0.0.5","description":"parse argument options","main":"index.js","devDependencies":{"tape":"~1.0.4","tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"testling":{"files":"test/*.js","browsers":["ie/6..latest","ff/5","firefox/latest","chrome/10","chrome/latest","safari/5.1","safari/latest","opera/12"]},"repository":{"type":"git","url":"git://github.com/substack/minimist.git"},"homepage":"https://github.com/substack/minimist","keywords":["argv","getopt","parser","optimist"],"author":{"name":"James Halliday","email":"mail@substack.net","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.5","dist":{"shasum":"d7aa327bcecf518f9106ac6b8f003fa3bcea8566","tarball":"http://localhost:1337/minimist/-/minimist-0.0.5.tgz"},"_from":".","_npmVersion":"1.3.7","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}}},"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","maintainers":[{"name":"substack","email":"mail@substack.net"}],"time":{"0.0.0":"2013-06-25T08:17:18.123Z","0.0.1":"2013-06-25T08:22:05.384Z","0.0.2":"2013-08-28T23:00:17.595Z","0.0.3":"2013-09-12T16:27:07.340Z","0.0.4":"2013-09-17T15:13:28.184Z","0.0.5":"2013-09-19T06:45:40.016Z"},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/substack/minimist.git"},"users":{"chrisdickinson":true},"_attachments":{"minimist-0.0.5.tgz":{"content_type":"application/octet-stream","revpos":12,"digest":"md5-7fj5eF/2Az1v1uUELt0w5Q==","length":5977,"stub":true},"minimist-0.0.4.tgz":{"content_type":"application/octet-stream","revpos":10,"digest":"md5-qnJpUhb/cbsf0S5JujcKvA==","length":5952,"stub":true},"minimist-0.0.3.tgz":{"content_type":"application/octet-stream","revpos":8,"digest":"md5-2LmD2Da9atq7rqeguE/HPQ==","length":5871,"stub":true},"minimist-0.0.2.tgz":{"content_type":"application/octet-stream","revpos":6,"digest":"md5-8HHOFLuI1T4ko3lvq362pA==","length":5821,"stub":true},"minimist-0.0.1.tgz":{"content_type":"application/octet-stream","revpos":4,"digest":"md5-sEDD6p3usslEbK4/f4Rbpw==","length":5691,"stub":true},"minimist-0.0.0.tgz":{"content_type":"application/octet-stream","revpos":2,"digest":"md5-g7dzol87egGxtducC9bdFw==","length":5687,"stub":true}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/87/44/66cb46d039cc912bd3ee29bfae97ac7f4dd4051cd240c1b25548747f9f1c6fdc3a2a9e65b058ab28f0a22b4aaee58075e0c77fd00ddf656536bc543290be b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/87/44/66cb46d039cc912bd3ee29bfae97ac7f4dd4051cd240c1b25548747f9f1c6fdc3a2a9e65b058ab28f0a22b4aaee58075e0c77fd00ddf656536bc543290be new file mode 100644 index 00000000000000..b4e8a5f74ed1a4 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/87/44/66cb46d039cc912bd3ee29bfae97ac7f4dd4051cd240c1b25548747f9f1c6fdc3a2a9e65b058ab28f0a22b4aaee58075e0c77fd00ddf656536bc543290be @@ -0,0 +1 @@ +{"_id":"npm-test-peer-deps","_rev":"2-fb584f2e7674d4ae2a93f2f9086e7268","name":"npm-test-peer-deps","dist-tags":{"latest":"0.0.0"},"versions":{"0.0.0":{"author":{"name":"Domenic Denicola"},"name":"npm-test-peer-deps","version":"0.0.0","peerDependencies":{"request":"0.9.x"},"dependencies":{"underscore":"1.3.1"},"_id":"npm-test-peer-deps@0.0.0","dist":{"shasum":"82f3ccba11914dc88bcb185ee3b1b33b564272bc","tarball":"http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"domenic","email":"domenic@domenicdenicola.com"},"maintainers":[{"name":"domenic","email":"domenic@domenicdenicola.com"}],"directories":{}}},"readme":"ERROR: No README data found!","maintainers":[{"name":"domenic","email":"domenic@domenicdenicola.com"}],"time":{"0.0.0":"2014-02-08T04:56:36.743Z"},"readmeFilename":"","_attachments":{}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/88/49/914fc692dc5441fec8231a33caec98409b6d522fa46bed4a673127876224b9cb8bc35e51e251c8a897a1d71dd9d7f46b6217ec8ef30ec4d83f4b9a43098d b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/88/49/914fc692dc5441fec8231a33caec98409b6d522fa46bed4a673127876224b9cb8bc35e51e251c8a897a1d71dd9d7f46b6217ec8ef30ec4d83f4b9a43098d new file mode 100644 index 00000000000000..9de484272a7327 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/88/49/914fc692dc5441fec8231a33caec98409b6d522fa46bed4a673127876224b9cb8bc35e51e251c8a897a1d71dd9d7f46b6217ec8ef30ec4d83f4b9a43098d @@ -0,0 +1 @@ +{"name":"add-named-update-protocol-porti","versions":{"0.0.0":{"name":"add-named-update-protocol-porti","version":"0.0.0","dist":{"tarball":"http://127.0.0.1:1338/registry/add-named-update-protocol-porti/-/add-named-update-protocol-porti-0.0.0.tgz","shasum":"356a192b7913b04c54574d18c28d46e6395428ab"}}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/9d/5b/15d0ad75fc513f4a327b5e441803dd220edeb4f9660e454fe9d263b543ba356c71330a5964f864d1c24aada16bea028eb40106762b142b30d448cdc08593 b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/9d/5b/15d0ad75fc513f4a327b5e441803dd220edeb4f9660e454fe9d263b543ba356c71330a5964f864d1c24aada16bea028eb40106762b142b30d448cdc08593 new file mode 100644 index 0000000000000000000000000000000000000000..b4bac32b24d86ca4afa12aecdeaa0d9a7dc23148 GIT binary patch literal 27629 zcmV)5K*_%!iwFP!000006YPC!d)vm9@cS9RVnnBFk|sf2VrQ$?ab;Uhw3Q`4lDtk< zQbG^}DMTc|0-$AC*8cYQ+~xuhlw{X++O65tB7wQjnRB0WWY4ZO* z^JjH+_0hNAs=DX!SzG;XRsFw>hmTg*)*d}tg>vxaA(mhL+yklm%=041U?_iYJ3JX> z{{D-6t~{k0!Mr$2v&N=s?BqcZs{irTVR$x~M@5vWKgWNG-{<}``d&59iek3e>kTI9 z*yo46R-=PWB*8So2F8gL1Zol&#UxT#Vi09q=xvncQeeYh^B?ll zESjZxT%_40yucB{v*L2b9mE9{f=BagB2QpU@bB4t;D_n77vm)IUXl)@F81bQ9jJ0m zjZcF((IW+L=N_YE94Aq3yTi&@s%7xZS$?cwe7+D?jKMvXxG{)TR3dOnOZc-~mmPqKKL1tWOk zw8@*`wiV?CHU@1f{N8KhDwy(vc`}?tm0=va^HitawfB3&?bpxe`3THNMS08RH;Qx(B-+jgZU*aU{fK+`}McnlfRpQ47zI7eEp)pzwz+lqqXY!Uww!;;p_ST$A5Y~wKbb%X%L=mdc7X}r`CM+LsY2Z zEK-K(t2`?3-MX({q?wAKxS9n8@P~$Qb%WTuHe5{2iq@pe)6%PQad9o2u;9?Bvn%!brvDV2#v{j z0bYtG*J`OC8FI~FIE2>C6yp($Q04P5jG|!<-EHqZr#`X>O2(OOAct2+2Rqw`W(1=k zp5z^@VIIj8Y2vy1VR!%O;nCIszg7zVoCV0W(HeyTO!R_gfj{wJBZ%|RuzEC|6_-xk z!KIpIbDSZLIi17CKx@Ps;xlX{i}Lw|e#uC5^~z=)ulhcW@qr!igEi&*>YLNn;$Tx; zY8r0t>$f8SE?keF5vpWiR5M8nHB5_9Jc)AC5H$teASjwiK2Qa$o=Owg3mkZq6xpS% zv23{9r88_hXs#ShU{T>4jzo8M_c3<>$l*_3*++Qo%;pHzTiOZ60CDikS;bRZ(1J(^ z^Nf>uRC+fH@*KNdHdj13%XSDGdKSEmf?|`~dT5xgjAJVx`54iOZ$x{bO2yRu=p;{i--zB%g|~RqS)63Sq!FdfzX_&-vCFe z^C+5eOZ_67M}1m$SzWAq9G=CKVHPDF-}g`Ht!^&HGVr@U3Sb+lCbv|aA&y|gF-(*D z1&_z~;4@8!^GW1K?`CNRb9_wO?s;zk$VT`xi~cr;_M0U^ujO?doaq#@(i0YW=@c<< zeDf4aXaUh}!w8Mo#P+uP3RX737ydSW*`CI@w@?Z;xik#?P1WQ4d7QzUt84gy0FxDN zIer2qz0o`gQG}=ID-BGroFv#I3=Uc(SpvpuqKux7^gH$V@nhA{4K!L%6#6g~O(`4% z*I$umt@6toT2JOv)Fre;xCId%wmc}JVY5XKvZ$B?wgTZ6Tfxm6Lz_u-p?-k*)KACL z)zsL}FOyI`fiI&Jxy@j?{XT9u0)#Tw7XIXkdeQ#%3nl(uSaUWjC0nbyl=))oD^ZE8G>Rgnv8@?@j!L5Z|(s{NWDJxY8_$#sek|0K>q1 zu~th@P)2ksEL7nSp|}Fr+#vSmrwN=!+}?(+@4iTe@YqbEDcpi?fG8T^^gKnx!!QE9 zUBqyRr6^R_m842IXeRT?r1Jc_b=yXHGOlUx?s+sLG@*CSJc5#Iz|1;DccWxnEi2EU z@J=!U90tsVR6v@+6vS4r&&uNvxPNvrgu;ZV<-msY1X$D%Xo3&F2p(N@;lsJvzerwX zDR7p>B`n&-umStb?NW94*Apu4Y!<)Mt#FyT;UL=df!d{$w^7q6-cl=%b=!6(S(+A3 zv-A_@T53dh-%*WTqgAQ7SQ1~fOb1Ci1#E;RSIiQ~GYzXNntL|Wt>B(1(o|T~xA8F2 zyg@qyhXlx*fvWt;e+Erf@+QUo8_0(qKMw;CVW0>to_3*aO75S9lC56sM? z!F*hvJ3Rq-wU2ORpW|cGB(Pl-_~S>K$WEt-`Dy(eRtNXcFgZ0;Kx0aSv8Ge~!*jQi zO4*-KN^h!ef{-Wn=&U60oEcJMja}gR_O_4ADxI;Gz`Y=vS`oJ_4)au#g_-*B(w`7g zls1pftniEMZ;s;d5M{rsKO+l^#*^QtHep$u^zu5#t!e;NJ_e~GD#73*qSZVmzi_2VpY7zU99*;#4z2Q`Y zMO<26Lq{1|+OpS9p>DA7ROVnB;%4eQar@Bq z)c4Tv6Sal_2Ph7|ck#z+4Q3|tUxSw`yn&n?XZG}t1@8rHubBn6SwoVBC_|wt2Y6m9 zncheT6zfRBfkSHCO_gyP;058&99ZfOR-`1=EtITPrq2RYaiyahRq4LN@SsR|aR!`= zk%}G7CV@3qGO(Qh>G2qNNs9^$J+c!x3|b#K=Q5@=iFgQ5q@AQi8@87l^kojH6^TVz ze;?J7m!!)hJSpRxWzi^p2S0KUpn+v;CJxqty3np@^b0Ws0ONrg={%m!CX8?hwQ1pn zsp+PiKW<)G+2%JuUrmwb@WUJgSqr#qi9JC*V=j6)7XiT7qL_ve7x#0XASo|nT#e*D zv0tVr%z>s&hKeEuirdlEF92heXdZXz_QlV6a47I*TSar#pe4k7nh20=S*}`Mfis@I z5mr0$w&m2gcD|Px4upWy1vZ4AYPHf0HIKQk3gI(_`53eIb#Yv_ZTFTx;K$Jjf=0((CuCF&r)7~J+I<_eQ<3<)uf+BvaOEr8S3cYVE zJ5@|Afw@gu3q=@ktLKgvz$!Avk>)fJvy8|j6h{V~;qrU#Ng()VCKKPG>cGe05etUJ zfDe$FN)1P)7!1w8N(TeRR|dVC>GXZQmYeFnuGdlS>C(ng!-tmozMT`eufgsQzqOzX z{M9i^F{dksOfy2$^|*#BaCP+3x|$tV4io!XVC_6B_6;H7X%r-EkLg&rqv?eJt$^o8 z1p!=)sIwqJHK8(WH>p3z*Ph1uMt6mh>?{i5Sek)W2$&Tiw6(P~4>XR_G0<|1Zkk0L z!T>n1OGRcWH2_4d2GJzFux+p{4cRyA>YO{s*B_-VcjtN=;n#E+}>ybKYK^E zlWPY2mgfTO1+Z+FN%(>nP^E7L0-ZfVsYFZL@)%VM*&z`BsEnTLc4C~rDr;-;Q`U2s zBEnYU;uzMlUh82`Adh2V`|JU=C&n4HRgLJP-R?xRBa5WcA(quubh@=ikr6>@8{z2= z9x9ajlF6kwETC>yfLMD~SR#bD1koY#MU{ooH!yG*KYTCkS>h`~7pxOAXodAk`Mnx3@4NgD>IDDcKGd4sIA)}fl8j=g*+AV!gV-Fb)_^8ZbsHBG z;l-hiH<3C|2#W}Gxh zfe`*>i3FiFCN11T%>$7d1palIa)Rno8TYKPmWd;g%kh_y>?epJbwWtA zAb-?IAJGDmDbb&4#109L?x)CAN8hQ-k zn>c6RA!PMr4EJV2J5r_vJWA{5m*#mq5K;P0a7HM&p8LNezfcmsjg{bIsOF6{^Uf4g z)6422Rrhz%tWbgtKxcJU2C?bcDU9x{V8SH^=>ltukT6<2Wk%sk1#1t~$dNsas9~+< zH7zXKzPXLtWfhz*2r0)-&5pYN7#>0Mr!6xN!G%@_#;ysj%_GXhUM0rlSLh*y_BRm4 zQ#DDEsx!Q10B1wo*2ebU*30dq{r%njy&oF-rMOm&Jm>f_)RB;aFoC-Q1H`S-mZq|f z)~Khe9t@*aY0RX#S=4EdPUVbhZ!RggsIu0&AHZU|F;ZQZMNwpPYeBW6R#wUyD|gn~ zH6sCnc@&4|O;>%nShZ#us9$%FI+pAfAVcZHsllEX0iB$hu)cC=KpG@9pMy?lvm?(E zmYX+-dv)NN+mY^?RI<{7J5k%%a`T|6SUtUq!??>~W^_c>dY7sjfYE+5rTLh*SjDGJ zVQCx?_!G4b4CtC1%LRC=gFy>ao>~euWvHuJ7|rwib0IZH)nkvO?dbEMzuWPjEY1Q7 z{HMi!2cjhUObD>Xo;R|xSsB%Zjy>)!n2nw1!U`jH3r^FOO2P(N7DGG^Y#CfDX^ccI zzrDA=y?3O@WqkkW`ObmE`N)c+!)Zg_HsCZixQ;oqb zPvFnU*pw^V=uiv6t}InEq%A8jsL9mQ)=fym>^6?gqY+BQ!zdul zrLWW;3X`^%s%7SO8YnFD0vUAl2Y|TvsC@!4yz8;GdR;wg+wB5TlqQza#bq?{pdSC% z4&%<0QPv4XM$6;Z5jA(E**a)p26{T@jU@Jiw7P6{LjfzF174>K2Bb?sH%SAgc|MFad>6(Z-Rhc}|AYyohGH zjnO<~TO!_v+1}mXe+3d`meJLEt57H@3;tdu!N`(ZL?ok``$gVIi&q{jQdMvn6PnWEK21{>}O&~4EB`?8N zCcYRmVBgxqG|JohZb|KA2@17-@J768I!2PPsa2`8s{`nKp3L*Pm^Gv*ZhK?1RN0~E z?u*xZf8E=Ev)9{5}$*MIN4ZlpnKFHe*;H<6TiGp z&_ri_T=-RUX74UYA$VlSs2l~f;?Bu2iZwaI=xrQEz1Mrs(2C19B7p<}`b{r#<~+F; zy}`@fK+h)epvMewF5GiIo5aO)YU==IV-98Sm*#QMeZSTHpVQ3`$0sKzz0<4p>*HVO z+XH@}f3==8`9bSRPb5>mB8IYt+rA&Yi$a*26yhnU$5Q%ujbw`Z_l

        n%u0V7@#Qr zra63Z*1ErGD>&P-vLdanQ>)w#$4yg_EuG&579 zu|(g0{?Yj73!I_ve;;gbJ%73FPlx}2K5o4Ky}tHveSPu%_qS_b?|*-Z&pp0tMYjNZC8q^R|G^>Nx&p zimqI$h_70za1!8!)fvgJq@@@3LhI`3va?t4h11J)e*Z1|G~iN2?`F`6MbL`xp61vs zG%<+SafLjBlN77X;t6fc3a#qv98R$3_51zbV9p%yhv?IoZH4x#Dh6k2d3gC%PY@Q5 zzXH!dm-FzR3`GQTF2a?)Jop+mVLc=(_=_M1kRnRpI8=S9As5=i_v%%jy|??)vRG+( zp~RJq%U>W@fP$;A)uxkUGrUtS8D-KpU-{tuLRk(w^1bU8E(@*F3*a`8S@*ok&B|i~ zz}_$o=LYIeDcn_F8(Yd$X^|8_{&&L&@1EnX9nNQbYnY=B&^C;u`%TYltEYHpSZ%+X z0f&g}W*fd27;tIGh4ra{7mXkEy(ZOfxBK>$cNj&~SbqxB&*AjR*FoU?*idp$)jWBq zU^?*_xYP)r+1aa4m_4m*`BLYxfXyjifW&U)U0+=tlA-rnz0!`RDS)>ajD}cLDnn6r zOuxp5;Q)TW5FkY16`sLh8GuZXg=fB*HHqytQ~w;ZW{zU>@12IaaT3oEZ*3}b_tx{CAy*Cz z5nr*D^E9{=8QVmJ=$k5iMt*)B0{WpA0dY@sH{uSrvFZHo6pVG<`|Wa@M7%+Q$+;dI zVT;Qg;~cm<8W}g431}ZM|oK(xWL`uSUm%b zjx+}`oW)>aIL|mqU(+afbA@@ z0(bygHNbEmi2x2?GyqH%;e~VA2GRVY5{3|!;VJm?oWW57klK4fX$}J5&t3H+J4juH z;$jS822_$3o6GUKM@fk81VG=1z~Hu;OFqfRGXjE5OVmfVhYNvxo#n z&(b+M0RoMP^DxMU=yC*u5O@B*dYXbj8sKfam}9iyT4M+kkog!skORUU<2ub&pY%U4 z926MIcLf9(qZvg75!TlMLNr?^Fv@O})Dp$D8O%{>1zZVfp|Yrp7k%m0mbt7AjgfZB zQA?S7i8|;>?&f;+l%#d+GQ10zb)H~w+P1-gS)kTJbPfMr8_w=Fc z}Rah47l7NniSBAqdCSvqu2?aMu1 zV6-PLis6%vU^$5N5eC?^5mZQTiaJpDJ?WU~0FWGE(6j--L4KW;n&a0k0SjSr3W9(--%&B!U9RKj^C_HU+1cG-FCJ^%fDT z|7`Q5k6_F<7UoC=67_~PTz(5jExurYNS#Fw%(j(e z14vOw1~>_fDCJ%@H1Rf=05Wtq4Kk&XSFm>5L+{f_5Heu}#F@ZB4<g7r`2R z9=OmSZGmV*Gi_5=%nyKK<{`&)Bkg$-;zHt1U62<)ZXlwH6cq}@5zLb$LZ}0I-5iX* zn3D*t%&?0off6&ygymo;c>!QvoFQxv@%SMIV_DP2kz(ZpZD|HLYgod9Ji}Cm@)k4 z96H}p;=7PEcnTL{xDPg{B%1xe$U|h7vcPQTB%`x)B6?zYF>Z*bC86U4Xo*jO6C@TL z=tRdS6Cja;>X>;t*gh;2k}hc2flT+{AUB9GhOXz#$f3oBtvsZaQnniJl$`nwu~bvw z%aAZt7%I~CAP|!D+@ih&@q4PuyQ20dp*8CuwZ>*kPQ>o~X#Eq4U?S8{>&^6Znuk%O z8V88ppQQ=oioC(MD;S?L<9`Pkl5h$~D(I`7gi$o@3viXF^O>4r%)uFA%NS)BIiOON-TNJU?G!^tEnzdey#vB+~MjDLInEu5`9W8TDGz&W?mu=ujL;+7kj&4_b z<20BEZ;Fy*7QtDH;R=&TiX0pUpJGbPi{zOLr+Pqe}W|6dYOo4fCjx zfdp3c&9Ab+Z1>x?p<^!v336#Lfk8f`8&3#EsOwhW`fD8#RA>lvd(7O-K`uBRCnT}q z`QuAuf?2VsXZ&&k=Hl_b1Pz5E5OhFt?X}yzfyg?%#_;T2?-Cxe_JoS)60l8Bz1=Qz z=oIla9*rUr*oge&2vBW9Wn}d{_EDj=%jSd2`@kJPN6whFtnD^~6ClVu3}%+D(uD2h z3v2T-)XG`tjz>V};Pku%!9m`Y*l-}BNmv9JWa3e*N`MQa2e!M<<3av{B1FFn5CL^O zRuuDnt>aUW_fAgQ!O6)Jl=^73gl_iDi+-ucexn`0GY2$+^H>zFg;hu66vw2E*7_he zgrMtj7|jZg6`L66HOlEAi8Q*fj`ryD$t5;MMcP)w+O|S-2gB0&6)6aJFB+ju2+paO zY8NbCIc7_o3$rCv(>!+tSHw|X{{i5rt3j(1wyygfk?JoDBMST{3!^e)JlOAX;uKz& znJ=&1rpOxYHoJnc`i0N|wLXB&AW<8Cgsr}Yo-}u4f28sNTH(3ek)vMY;?l(WGu?H#F36EdH6m^S2iq+?>vQ9umQmad!Wc+6$SIHUg7N z0(L6RhOA%;=ZG0E5?m`51w6dyeg^en?|)1$P{ffAN!vlK8jbX`fnvEcu?0iUnu|4V#6^88=_qN!T$hIdITuF z_VwR~0KT63-|wT(KOy$jRm{sYpM7Q);O6tc4oAOw{@2$Yt$scKU*gm2v8~ReX9WSY zo6SKAATK`Av!FGG%}npeiIws-y?@`8XxHIHUv-+#Xf{56O__24a8bQww1|dkUq{MsQ3mRSrpUT5= z@60|JMMLMopcnRr`g_=mdL#J(kKz9V{cFIlPPyy+a*DR&qqKS%{MTP$RnRq$YDuvk zbtAKqXD?8=e@x*LeT>^Ali^8K!Xb~!S5lVrHzL&O!Ls^z_+ho8Dad?gk4u?KzEr$r};O~5xJ8Fn8@3NTg zWO$euR)f1}Ixya`XJy&S)UAtDvcY$qg>ly7_r|vWe4i5iNA+4&W>V)u9DMx|~`tVQWx{YQU6Qz!l5`dZ>Ei+l729>aIKh4mJbZeC1Cqq?FL z!Vp^LivaUfO(Tr+dny~aAZaeoQ%DI@ffqH#QnFI$5O!IL+G9`04vx_TG$%zf+k)|y z9h%?@<9>q99fOEsHu#=#em%oD7E4(g;I>+=+Y%CdO45THlNS)A*Kj_iv|bb^Bs@#^ z=f#XX_zkr;QuY$I2oe1&Bh_p9zSpy9Cz>bC4<{c!oU~d1sc5wQX04&`Yll;ciVc_o z1ca{5yoFb@8|s1KPVi$(Y5$8G3u!ZMT`AaTDfs<=tp91Tk?3tOQ78A&G#R6YAEQgS z6Mdi>f5L02xMb>^7{4dc$^C|&6=JRuKJxQfaFI~LF^t`K+~|gl4ov=3F9ZgEeyqc_ zGIX;sj$!SICMA`-2gg$-qwH_Fc&9wbFnc>LHI5% zO076SJ`5RYb{UcB0K*S zE!*TCl@5n!OG=O>C8ys)0`6OLG5ZucwOuD??MP6$;fzgV00pEx<;v`h6u&2Tr>&5j zVw0Q~8~7%HL-#%!`&HvKJM2E9SAC#y@S6m6CB1lZ2= z4yz-KFO%Uf^x{fQo4ZOo5#InopSTI1wgsQC0Sn8&WbtbSpqWK)u75H|G|_!n)MQs| z`5v0-;X4;aR8Rl~9<)uHXsKqL!zh|<{|$(8)0XNuSfE1~9fvGw^>C-_g*Z2 z;+IKSC)rjLoh@A2y%F>LpMo2AH;j|m-L_&;F{9@pWCDoM**rPVEnkvLmLPs!!^t4^ zf>IBF=IV)F>rjqNSJ7thbdC;lO$y|6rzV-!`C&S{Y*H$F2^dxC$-t5A=oRzC}WaQg%nxQ2hwbku!f2ks-O(0`d^^ak=E z>_z5FZ*+Gef)jZhbdY&`d<)ZYhYiK`WLmk%l>F)(HqFW(Jr_RAf)9JYV~>{N6OME84q|X5W zI3dHYzhMFe`inV$x@y(`R{lQvdS3o7er`GcyF1Ue_YSxJzCLb~{}=WD-+s6DmHvN` z&$D!P3EcZxq1IPd|JZ?l*H-D@HMN7u9@PK%>M%T;%%cKhwPUT}Bk+(DeV~UMd%2FZs;F`$1G!CT(at9c{F~X23?4GG#k*jDrFFY7MMdqV8Dsd7{ z=0hDI7`=}s@iZ3CQ1Tt+DRa1yj)&vya7Y*Y8_~38^T8y>xJ$zrn;y(D`g@KK!zjr) z5`2$>u1zM`0!5}7l}0CFmr`6C=wFtI`n@<~7kJOi1S3^qFh&fbE(v!iko8<5Bs3ZTlC;45S{(U_gIVcal~?&$z@d_P!8kY@KGM^{e24?i z6M-SrF}^%SF)dFMgUJ23tq%8J9KG2(*j77->ea#ifA2isey$o@hwvMi!Z$ldKkmOi zQc&VxYwzf1wf{nG?ftC&y0iDZ<8A-+>R|iuQ0*V6otLk6cebB*)Xv_s-Pg}|_I^-L zq2Av9k=osPxpM@K9_=gaP@3A=KJ=imm)i%=euSS}Pj_~Aj(+Z_7duCL*yampbW6S3 zIyl;S_Ih{gK)rf>@M`~X8@hk)?d|XF?7cXEUbbIu?;ZKjD|Dr{{~NQq9{#wsyGvbd zy@t^r(D>pKrs%r`s^Ht*5)&+!ajf+3wcP%Z_@!^>XWnZK|~o ztsGD>9-a5*$8CB9{cXX2&yIHX_i#;~?e85Oz|RiM^5Do+eY118-BDWyJBKh-@5RAB zG>^*(HTJ0ysJFMxt>99t(vCn8{Qde6zj{2D=i6Jm(AFVVb_@TjMZEd?aX+`ve;Wq% z?@$QbNdF&ge7m~H|F5rq)&GBy4{y02z2k&ck8R*v&+fg=w(!_yUSJEs?!jwU-k)Ui zE(IbZnY$ygxSdvg{RF*xp>lI=b(M?$u)F{C@CeYYTiSW}vhLy4HPuB;!69BKxjheO z@8smeNw0_Lv3m{grf3A5#1}XfjD|PS*B?_8no{++2&aHfB-^uu?dx%bIF6);b3KU0 z+wW#gp6lNz*)9z0_?O;kLlV@s)#LA}zhsVyaWu=s!T+clU9x&CwI8TP`-!RB=Kh9h zp%YpH+2jzJcPk;I56z4w z9|uQ^ZdVb+oq`g%^B3nL2ESOyp~e%@=>#5|Zy!D|?v$}QQwMRVLy3{}8t7XvdJtG- zp&L)qBHPV0G^4h>$#jfUg>}`JdGP*ABd4Wk*o^I2dO=9^2nugIX`5|K?Tmxc69#96 zFXjEF3rnU?y9`%4D|mhebT6D2n>yUKq%76>DE&$!z6q6$S5$T6-b&KndyUH4>GajQ z*G7W_(CUjxjfQli8{{h}k~P?Znoc8ZHx5_jrQMn8G7D_ZTBW^t>FmwYjag~R{l*&D zuT1aeK?oO6+LPaH*Oe2^ti0H=HNe3@!)XRgu@Fa2HX^B8fwm&G$MCFiIG+R=W&nvf zhnk5kOOaGL)M;jNnvz^C*%L6xEJohNu(M;}y(lLJU^a}tR1}v0i+O<=3K?^+y&W7wmr zh<6U{Pbx;~dxzW-4qvYhWfo~wLMFMJ)4`TY1K2?G%Z0j-6m$V6kHKtXc%q_!Ql3Q` zXXH^P%0rY?x}s*&0IS2T%f1Q{JK{u8l2}T>*hmAF+*b|q%hJgxWt@@GDH{1p;y0r= zmx%#k(tKE~XL46a&Ku&vdu8FKvevHxmPYZ`YuW83ub?u`euC^lpFDB+U4CFRz2wQMy=yH=V;u$lm<2Skx`z$O}s`BFbP36oKM+ z)T2qa#{Ou;Ltd@UT<5)U5i_2MrZV9SfuDBR4RZ$>KYxM}e}>nKh%^>Ny3%lpK6s$_ z$V_B~zc~+OtPdWz{E+*qwS<=Xq`l9|Wfy3v^vA;B({gr0=cOH-%1V+z28x*kNl zWyVp*(=M}BSv2B&3nW^FS@7O4V4FfO4aj${MxF8X+4Z}t%g+02-72U0)rAM|F3q?1 z@+};ihw#-rjqKCNJRO~xr|?xj9owg4d@6lg8Y9VV*kdfq3w3gZ=12)73o^_oekXj# zVcJ2qW;U6J=S-W@(TMGwn6uVqLqmhC!!uA)9cXD5VFFQ3+-3)G5m8!q&6qB-pd?UU zHJnW@QzjFl8s8Gppg~*lL2&quC|q!N883?ftz!*%g> z0BuEomzUQZbjhiE)j*13%DL^BnO2ZKOwkNc0p^H;bKShh|LUa#rj6sQB@`SOGZq1Z zcLlqW8Qmuz9NHY|?=i1!Dfmw%tf;hS0;$xTJ2MXUP>d&K)Yq&`DsGijR5n^G)U5Dv zg&mnzxA4dxC=Rc3Z4eGAK`pyZ=@JPp(aT%T=8fkV6$OOiFoBVXmmNVl*bZ_0sAIsi zX+=CSiU?xg;7DK?D?B22xbDN^i}*q%<|BLjB)uO=uR1GQpbZ++2-V=6zzQ3|h(1{Q z>RJtg@Z7MOaKbx^(~_a;9Hfs>_C1%pPthet+KYlbrX=IIH&BonrV9T3<>ac_eR90o z{p0C_)`@@OJHG%eYi@;VFFn2ueh)$le>q+|HDA|H?Wu;fxEVgA&g!Wg=_)92YSa2-u|O zomw#Gw{PI+q^RT8nWAagr3j%jSY{Ch^_%(J4wkHF$J(-9!^rSw=oM4 z=O_b>Qs5jUNn0t=s>rpKtXnRuAO?n+8?A(7|F(xwr>_L^r-$b@Cs`P+A`iD9BWqp_badpXs>iG;rUJpmHnW_LAXCST*vOT`;Y)7DMD#K{%{4HPKPv}t8|Nukxd>ms*gx20Xro!)nO@#ZEf+g(kbNSQpjH&2dx6L;ECWB5i9KN2 z3OgHm4)xTPb6`nOGakA}fixpnYtuX`bz`(sQd}}$dzA*RO7(fqAGl#GogrQ|?$F?M zO@rO8^9Uha9P03NNH|}n;7oPsWB?V(A_|D<)WyXWxCG+8T8=ZQEIc(^rRNyJm)Jev z^vto0x^%Ki1>^GEh3P;@a-LpS14@>cDJ(rV%jDFrE?K9vWaT-o-EEE^F{bMqH&Fs9 zZ`MLUSXWgK0Fej*s%L&jVq;?4cUEFl?qi}$&W*@98=|4*JIb7c!HjjRRA!i-HVDpb z-dfv~<=-pr5H7aVfMAz?#Rad$Bd@ht*jK~Y5=;Eta3zlZE;1DtCsH`%Ni4WrpgQA(0m7Zov9Xfimvf4C>lGy`{ zMu@n(UaSD<2z2CAVdgXgky);wPCT{STT5y`ofphBpMY#`d|G7(DLAKR=9sZomrzJX z=^0TG4YVaO!MpWl(~z;`mLy4@r7@ z;#xm7`LPp|j2f*wi#f8VQGljtZ0f>ENDggrMq9OzC7aDom>L$xdl9pb`=ywtupt;g zo6->fZ63c3Cb<7>z+(Bc4RwF0+Ks4uLaCM2;1XLg8N^AI79_}K>+H+u+oiMCS{0x+ zM)}Jv3)-eYo=biI(H?L z*#zA)v`~WCRi8m^`5hq)pV+v@^*<{@#@rPXDf4?;xH@+B8u~A!F)i5bG zQp$*&TuSonI;F6|L@;*i7JD3?x;)2%q`p+LFNsGon!`6cN6&uTtdr*%M0yU05KD>% zn<65;cA*`pJB&U`6Oamr94xSgzXh2!uHvQ7r>?x`qQ~v#+^7}89-z(14ZUDMl z08jn7+qE-U4u;O=%Op`LN*rg3Y$!mKsN~44F&+|YibTga!iavaw3g%xa=a3p5|5Ot z<6q!woCq6MnxD|S#f%K0w&f$h$MnOYb`MbTfG4=|i>vhE6L5nXpgLXX=^`=!sa=Wm z!ilN}eavtk+ts51K(f9DNw2X-jm!finJUrU^1qQqOkCh%iy1anS~N3hV_B zI{L%-Ei=AFT7?XUFDjp&s!bXO-C91~>KW#<)2y7GTG$dK*{szS)&L2yqP29`LAZBr zjd?$|SX5|Wm1Sh{@roP>HeIH1`9~}-n{Zyb#%{8_Fpv>04)EzF6mTc!0G1p_=Cc~i zL~S-|LC~c%%XX_(zgv_cV__}C)>Oaxt-G%NGWJDUa@sNbw74tj3=o1y6?SE?ZC z8s4f(3G6eV7BZNH{Wj!*v9v~5h)INpjCl7K>HvumJ+T}@lZ=j%d^rns^M-x+_zlB% zbryAJ^FFwnw}e@_ZC|A^r>S}(FC=YBzT(Pc=`)mx#3sa*rFkEhxt{!j7#$Ye7g>JS z)#G?M;=VJYDsywUt%MaH%RG-OC&tdYmBdPe1}Y01-U1k>(WTG^WD%;0Q1t<&qsa&+RcT%~Y?Vs5jHrwX!+BPs)8cL;?z(tM$5#rN zqgVTfJ3smBYTf@&f5TrdZ$}NcK~Vm2`}B#xOb!H;BwA8P(?BepT!zHzGzWLt!v$Hb z4#pX@>*Uuvf_Oa^ASD1AusI&PPII*}0;3&L_NP|wCFX@B3=z?JDLJ;~b%)f{C1VjqVf@5X#!$*i3(dRbMte%TvTKU;t0ERUKY zOkArawWW)ZnswK55nhX~1f3j{bzyeA%3$Q2F7p+RJ``9pPK-D0HfnI0-C?C4 z@_w_aKIxA0)%ta--D;kkJZYVLz#M1RiuG$peX|DtU#}#Bb03%k_Cd>D<;9`fEantj z{Qu3mDj}?EhsUYdklDit>8?)o*bc@)oPf}#!}b_tYcoJ1kS3AdHEt83#4Rd&OQ#!e z%;!jb(LFWC+Z7$#lBuMHL%RcdOxi$!ouY99^GseM7Z3$SNnacz#fL88Z7{-%9Lyh3 ze#)S@p92VqE)@e6o%48nQ{OhUqk<`>QOrc)hKYAI2F#;~v5Kcj0I8wASp&G@f7TIk zd@!a+4Qds23_{G~Km2x*z}r7y%tm~`|5|T5(wt97nh=8q%2yRN?q<2j6D(3y%x-E1 zM2dPWT}E)o1OQh zX3t!FE1Yzi+S42cNv`F@gK2J1`uRdej^om*yK6L=hGdCnjmqonlE0-X-@3x%51- zXn99vQV$8J@247Uo3YLe|t)gqQ24?GrQ@3^wcD>n+fM_a5r71zUaUduW*Q)*4hS)I$+z>Z%E^a?R zp5tIpMvN3Irx<2+X!SJL-{ zIVmFw2$La7vsf|dW1)5nWr+E8?Hh^QIa4Zv$kvD&hn@- z)ag{v#K^cCRxazJTNUb4sJ*f#o*t2*qC{$}KOnqcj&vomQ6;7kFX^bGQJ@L>P~osS zRuODRr*wZ({3Xeqs2j#vIFA>u>kj~INfJhE>g(3|%3;T)vTh^>gPHVpngYZz+1F0Y z8BS46zk3aKUy?a#K*?AWcdL7pTq-i5q*ynHB2+hzpjC?WYM3@XsS(rSGvCz1Z5GTO zC&Tn2-!wcTl8hety{Qvn`VxuWrbENQ>YOmG;!DBJU^0l%cpnT~#G+ulc@hoHO~V_4 z%NaLIJOn!Q7GB~LJkx8qo}L9zCl)3!EcU<9|*>Kh#(lr`Dh(mN+L>In70-@2e0=?cDNk|Svbi~Y4 zXMEkDCs8ZJysjm65@AOmF-7{8&o(=-U!Y&74rIe8fz{$?s930{%rz&jx+K=m+xsN% z+H&Xtc9b$g)vSHyqf*J3}+o;5nb!fpUii#GHe6LIfO1J;XRh)-Tx0*379sWg#jz=9?3Jdz_-KU3+-bO6{)QMHFhxKJqY3-s&G5%;V!iK1 zh$pDWPxHbvus2E5S;P9=3(~RUI-bS$4(doIb3B5FAJ?OWXrU1$A3xTL;AO|@EY0(H zFcGI7Q9l7OV0tPnBe}+Cro}kja%jaxDbsP0vqh|g;JB-z%xHfFy*43`b}wYBj!>0S z6!cBE{Gj))ciDU23*CqOXi$ELCGr22htAI<3c${R9t#~b3}YHpsVV7tZ9TH5v^$a? zFA~e|!uau6WzjUiNIaQU0wZC?pzrzyE@S!fdtiV%(hX2KHihO5Vl>9c2+Cy#kQqol z<5WHp;*mvYhXz`Ks_Ki;eB$4-id|@3 z%Y*8x`qovs2h)Do!uwxIdPCW}m%M8^E_I24c+X-jm=l8Hpq>Wfz|q4eh%$`t6EmQ6 z9%hq@=_SDJb+4VETuMxqwtj1XEP2Dd(R>!(lGeLcDsh%xpxb?iz)}bD(rxzqcNn1n zpF{91zHOd7JsZ`k}EXncNTW=0{tXH zzD4lDMMQc7z4mx(o-Rc2bG-y_e%#sJ-qiL-04t_TcK*a2a~n})NJM7+4(NV>EnwHD z`fzc97M90Usa>Cn^F;O9Cp0mP3JQ3$(r{Hf?EghGb(YnIk)MA0NtwK62!d!I0)F_v z<|J$7F7HXv&B~se6-FI70=6)XvX*nzlWn#9h&jK7IW0L@b(>#%uee9Cy*1jdVr}jH z;x-Ih?p&+B_R4?RM};X1y86=i9DM$xIqr$!?5F84>Ij(OC7a;V$Q4P11SiO1APwmD zUnV`|EDQilF)iD&Y;E!(5zgGjY%cR`TFHVE$M3$XfXhkp{rBIS$(b#ABD^Bzp>bLD ztX10a5#!ZSMVC=tyoK}ZFh$1f<^+guxAkjdS+Vgp2{~&!ttcJY9;_>wqNIA}>QrG6 zRc9r;DN3y_gLgVz$5cvgOQCEn)mM1m_A^;$H8sPC7NF52FBCD515IE4WP zFkNa|lAbe{!;{snIRb1sZ42FmwxM(7>`FqGxNq!g^rS{$7r-)*TnX2fshG}Mn5 z&q5F)7~wS(J9tq_l9LEJGU|%#iXa4>?fTTZSQd?Y2x)ljj`Z3Zq_m5|pl1+0wfO>C z;b1@xWOPw0gX)MfTiYnb&2XzbSjvj{^Mt@X5E*|VEaOEndeR_EG-}esr%WV%x;%8! z=J~a)O~f_oFXpT;erYEsO}~YnXpL{yqzlu8YxcXLiR13^$?4T~v(un`I`Uf zOMFT@{O^4f{w+VBcK#>v!2Y^5HQdeT|Jz589#+r)#`@R%uV3c#C&!lps3-{ylN4Pm zi5b6$25JB#KgTHj9{Hyncot;W=`cwk%Tu0l7{M+_v^NLbliz`MQ@%I9 z+jZPV>T~7j;&rKV^gE{|kL5^{dxav=uw!z5hOA;-MAICVqcAXPuY;LtcG)$Ci;|y= zDQXPz@C02UvM7v_(5Z{oFRB*dT^o9hzUb&WCxxcA5MDB@Eu)QqT+F(|n?dM{YQkB9 zIEwBb?7o5%z0iR<&0?U#MKb1~SM{l~*v!%}HN-f2MKHGM*k`A^u4GR;HQlAlZ(1t? zKZz~okvCfS5}y4TC)A?1YA3-PY=zZ9+mSwo60S;$tv6$eEl=5X*(70WbkLc9DmMy) zi{P@P7&k`ujwFM@#UULp8SSm#Vp&@$d+@z-AX9Q0xhjedX%^h&aZZ<=lP(-ls9%z7 zHmx%3+NN+QErb5<-L`3y@{Zjwq{&B)2d`NcCG)&>RM$s}e!2%oKQOl7sq@_ex0a2Z z+!aoCCCq0;@ip8KJAj2a-4P=b3y7TLBr2NcoI}Zs@E9JPnrw7BMV*5@ObmR_?yB`J zxq|AOb}XCpFPzZ%Cd}!19Sqq_*LXP%P!hcppDTNY+;n6z&X%8_ z#iPQ)iRqY7VJR$?4D!#9T_{_+bhB(u{y6oW>Kj3N;;KY#>s`E>HHDW%`7dpe*%KPl zaeR7;qfw{jvI~WrV?0^Jq_V1J56Rya8KBQ8rhOX!zq|8nd+%`jj(yzB{{yT4ZI%CD zTi^J~|9_FsvvhXJ+{pUs>K{As@7gN;yQX&XAPCj}`06k`1N?_~BfYK3gqaug3IU&UbbygP=}sjuII~Mu zfTPJa9TgXp$`}o(d7g$bc?A#CaE=O8O7P~Pax+JRZKN89QlrtLPKFVP8Nz|;SNf)? zhn^7Vr%y@Z;v}5R$wZTvxCx4Ji@;bO=||6UYrAmH;l3A z!Mwom_V^IEW{!bkjbeRlevUzQK-Vp`?Ck{0<0Fa~w3{^s(;-wzDtMZCNUkoCT7mPC; z<0CyCjCPDyQ`k8}B7`nX6Cmd3$8B}E|KjM)*1@*gIaIF>_Wyh5`Sx?w*gAyYjgES= zbM)i>>mvmv4z~7=epdT0)Yjh5>aRO{&pY1sPp=NP4-eJ;f!cZbYIkS*c}MN+J==Z# zd}r?m^%Uyu?H{S#otHaD(CE>=!VaaWo$W&p8hg2Y@a#wUx%G5scjxHmj(V|kw1;iJ zfJV2}tF42hooBCiw+_^+*9Wim54WNF=ic7_-p<~O1L$S@<@Vl@54}QHYWu(8hdTUm zYj>Br+IkJ6KcMkF+kf@*!Ojmq9(h0R?>^s#hflX*WLr;nx4A2r)U(~KotGW;eCy@b z58G60A6hw}VmvzU&5zsk2>RQC|DGM~?C;^4Jlo$pI)I-YnB~EdsrqK;aJ!?n4t5S< zsNRc%eP|w+6Kd>JBT#Q|n_I!9R;3+*BKZ6DA%69EEYG*McA>39tn3!{ziJKtg+HH0 z|D~4y8=$A#`?#6@uhF}T{{P|n+E@DjB|gZ`Hqa#8*aX>JZ!n4HjiDr02ON%Xw?vMX zte+fsmpEHC@{=N|tCd7uR1&co$mizJNGnaP`K$gzej3by;%4xW8EZ3^Meaj%1`TwB zonVppFY)`_hvLW_Q)4{d+_r`{5wK_x%;;8vEsDOhH0O#cn@5#Jvow#3G`n=#x}4F- z#&~sxAI-CgJlX8^;NP?P0Pk1zVjO%AQh$BL%^Vf6MnWjBkG5NM~gImjODB-W_K7&FAFYuQ`oR5)7-r6?$=~CeGS~*;;wL8ci4$v<6#M+{^D%; zurhD1!45gWq`E5n7DOVD{hVdO>0l3Sr%x_)IG-Ws5#az(Ph_U_-!1^I`QJ9=4YcIE zdb{d>=RfMsGC2jmN=T`EHw}j6Mv>FABLeOypHH!g|6Kj!@IN=c8;v#|{xJxn;JZiB zMle_p{y2)(*S`(I^)Ogp-&p&jGxSlGPRk4Szr14qU<381;s1l}t>-Vd{ps*decWRI z{dRR@LH>KV`qlpXMLzdPaYMW6d7qBqJ@0i6V6@B3Ala_6wdU{LEN&(M1IC^nNnjdmEi<43M zZ_d7c+WALP+8YFU9NudD{eQRGf7kJ>SNOk2U;RJ6%!gu3M0w$y)%(DK+;92#)Wc(1 zKFRlezjwdodHA|{pJ3p=8!W7_w;%QS7MmxYaqs5STlmmRFlkoL@NI>XU>IO2qa$7{ zr>_dGExvNBb38)Q3I&KgLAne#X;iYWO9Pg@V|bFae(;y0fIf(4@km0*;VV4$Y{f^L-Y`pN663IPXrQCDRWy*64JvFlfj8Q4 zVizTrOv6hK=qjDTTUwJW;R`E>$<$))PO&)BjiudgEbH`--`%Cp(w<#coBHE_e%b^) z<1ub7Gr5iuB_;O4EzZT+H_oETByIdt?v?dAhAEB5ltDzr(`htBwZHg{{9oA9#RE-_ z3!h9x?}%BcljicRTwQ!sM;GseuV{NFik|I_sg6(Uq1pWwZ@?F%ERkbGoivPdF=bkc~jrw2yA;FMQNSqh(BrYy}&pTc@emakVKgU?t^Zb;EK@LbG z$M7(bkJm8cyc@=TnvEB6?kpL%PBj6!xh&>>*0E>I6;RGbHpqgE{m=2@dz2*@;gyo@ z&89HM?YB{ane8#^tBzNq?<8VN&(t6`SFgz+h6D*J?&x^$0|^hCQA$}NS2iz8&bRIV z3y9Vs(FWD$K$?AzRpzJ&zjsfOF5L6_{l2AdlxWsW(N&FGn%Q#VX#&?AWd0~kk&$oH zmlnqjoJT85i@^^rM)%HFa0oP_7g2ygzjMzM>lm$UF3Igi@^;hn+KMt;E6U!DbA~6| z?}~_$HCyV94n=L%(Aj$%s^4z+?JMsvim0*v6eE_L_4U_5;QZK7qlBuMCl3`+Aih{g zTk{f9ly`0jn2o6O2u zMSyW9F+Vh}0CeOziA^}J=HyaG6<{y0vtWkqev{}e#zU4+d>5G02m7KJDmV~56`6w$ zFlaLN*^D6P5p>)PK0Iypp{JMgNfE=ERR^Q*sOtcMHqrpcA)-l_7I7*qc@)x_7dfb1 z;{LsUX<2Diq9I4%lnAM`UY?10RF2mR<9-dtr+;#{gFXQ)|@lPlKVVaq{ zP_TE>*=?KWv(KL7CZXuhW~un_QItoqd?Ok&X|rt{280zIJX$)G@Jx2UZ5y$^my;xX zr)Q84DV-RC(ZD1Y=YR<`goUKyIh^Hq6o+*F_;QTkbS&yEq!h;h{ha?o;boCN$8_tv z0s8wKqHWNp*a99E(IqfYzf$e?p2>Bt@9GcZ(FleK;ERTK8o@;%%1&85&q+U*%?FqF zbJc$y!#Z)ss&<>f$>f4HaD@}rVP~S;*J@k~3OqOr{rSR;z1gqy*E~L@EAZ{$r?2|dF~PEOu%z#(|M57(9hc4AT;M&)KI>})HZqAtE5fSBXD zmN1Cde*hTdYS8M0t?Rx{+Hj#0HkjzM2wnuNupIBvJs0!K^=-$F|!{*d;z8 zj)Gbrz{22e(vPs!*L#aOXiRV(K<$9FqVQZ2%TTY#G69N?6Jk8Dd~uNy6_E5;hNqDn zsfewRP@B-BigG)7-ZR2X7(vRs5%WC2DPK4=VBqYsX-C6v9Xs;!7Iwt8;@vr3w{RTy zlwACZk?8>PE+zX4(O82?VLot4T{B0V)wAb9f<#*FzQhHfFNIh!>0t;R#o@adn6*;T(QZ zSHqP9y3_)iQ8YS*)=(!~Z2 zs_^WRGY9u|K9Mkxc1wK%MBekh zdL|@avW@mRIR-GXFw7JgtS!AM(wftfXPcFySI!sU&{L3AMsvD{fT6W=A(xtiLRC12 zDlajEuvQq}PnJs9-R1`2Y2;pB?7jT;)z;CEedw3aEy22G1CKBab6nmqhjqlFhU-{T z)-XX-nxe!kE!%GpO~5n%lGZL4&Y#!whX~jQ&8eBypGI_3I3Af0a+e*+mq|2;ua&)V zsS=4a{h9$txLKcjrQrXlkA&4au(6ADJre@S4MOciTS7ArcH~CD*6r$GfLn+JOfWg~ zi{sb9I$``*VB&jyP6qEO(<{%Bu^iAwn-E8Xn!z=+R3L=`o8K33@{|B4P8!vgz->{) zERlriatdcVAsUyWm~0dCNNO@@h2&>S3x|Z3awJBQ57WeU58kHnkfLPe7=n{#kYDDA z$?%pu5)`})#8jMzl^Zb!M2UN@Hv0ygZK8T8yBDIN2!ju(jY|2o9$ho*au-_>Z7I$T{T69b$bVDaX) zq4k#UkOUnyqdpK0H*hY15{pjbkBi(hv^>bhbC$sJdCbAJ5YBP28UN9dlfLkDY%`hM ztecqqnM<_OT_=;s!pO~pEAzc>)y|jKYDuOO+$uNkm5zmgVa(_}bxc(3;&MWlv=wSW!vSr#hm#tbl+(?3cl7^eft zgKh;g^Wofp8W=9lXc;su$yuYJuPq`9h_W~xN=(Ff za++kF)H=%bHrXK6qqylhMyrIvC0Ws`3N*&oXNcr#YKr*ZQutTAl&VvVYMLszz;n@y zPP*VQ>}R5Rk(uPWodq31@MO?m2t7{?^n33v-}lzmH+n%RnipC|eh$y@owH5MJF>Dl z(?LMBDvO4eaXM5-QC6quLxS%aPE_wIXCS#ly$hME{>JkiO%NG^&lwc{X21OrNOi%GK2WA<0|IKTGHRdJ#BM2mde zIT+bf)=HKmiSR2fMw%~E-S>M^oudytR>z9n@W|_qyp@OekEFb}A9^OQBC0?&2H|j_ zTu2Ru^nOTHhS5Ty!7$Ex4gDp=;WSQZWE7l**eb^|lS9oS z&RR6ep7Y6_GC*DfrU!#u9Z@Xpbr!&su!D(nfsr2IHWZA1H^^c*)aLJ4+MX5T0e@O+yPwgRaC|f!M z36=<#AIv})BkJZ*GA3sremRtmo-ZM7%Qt-*B(&-H7yiFi{()`!Yb8i%+h{_b&L8=p23XvDVh2~8Y# z;W?A0u3NfWri_EIdt0HC6XAp068Ot$2T}Uz?Zu9{%&}YKxK!e{_q-6t6;M1b!D1tj z5W1*;JqPxcBa=%=kH-wNZp_g_v*s)fF#%$!18sC1VCXeIb^vQ8} zerg)lW&XbQwRrmRN&;HaG@-Pgz2YJzcVsi(t6sa)zFxw%^@4mjvj4dAyy`uXdQeJ) zh)N5tNJK??gB~&TJxUF$E7^S?rihu&jE5TQ*u_+W$|aaXG_+&aB%#M$U+W);{(3$! z`aXSe*3XyRn$=`o#+Fbv8Tm#pKqe!K#l9?gXQw8xHhzo_3`b>#XTF7Y#5fVD=13Zt z_FE=eDGQT^K`aQZ@Y+_X>G77zpSqPp585_GO-yFiQ z*p#$M$pPLb)NM7KuM6q`1KbvTtvMBops5z9I%bm4*|3b_OfpPY97R#(g^9UH#qup3 z1#wz7>9o$A1efd`T=Lf!Z?!1M<0#Yl>h#_W*~c(WiaDDbNsY})>q%6&UVujLhl;_F z@1&qlmC0GJ{Xo!puHqq|n^Q?v(1QHFouIdv5Ozui;an#Wuq*S^Pd{xUq(HlX75V-H zS^a_m+7LMkzvQ1A#qYG29cCZENHDP8@M?;UkI@-vKI7EXMLIKWq5FHKR~Axvsc}^7 zy}qem3m9m3-A47d#c!-(p?_KTGt_8Vl$RHgPP9$luTe1Ebb+qaMY*-xIx!m^QI1$n z3TWJQ#LI%%#*pI~vt6>MO^IY+%q^*05%n^BaWFXjfO>5PN2pBFuvKmntFJsjfPmYl7Ey z^TUT0doXu|&D-!^@zZI27U zAL(^Txp%nIA3|#N9eK0Y7IR8*p+$nthpZD`x9l0St7cD|!%PJonm}i0&t+w5JY##( z1O0_wx7=UDR<+?PX!+V{TJ*gQqu7=GbR`a&1Ptl6X}B%9U`I&eZIH$3Jm)JOK(&yu zGVpe+7JI4Lg_{KUy>< zCvR6+&Mz&=mO{?8q>D97ZjaEUDq1XU5>{(xM_(WhI?w~d#gA2Zyy{+U0DcTT z3Gw;bsh_7=(F`WDv!Laa(cCx|T0g}kP=-zs;L(c>dO_gkyeop)KKo0C$KUFz@*cS= zH_tQ_`v2`+&2oY;5Pp>mCmfL}RCK1Dw$no|J+ud(Kq{!yQXT8TpW)q`-Ay1_KphX- z=@1V}vI&92WRraRt>IQ2ZEBQBO_uqGtZK>(D*$F{M5Rtpb?_0yFv1t+uF#j&>*)Q> zr&l;nx9*DP(0?8#mvXuC?Uq(3W;*#q%HW%&D6<1h)zGc-aY#3Y#7v`1>wvVBfrPCl z)Hegtp}AZWK)+COy5%eL9JCsHUUkQg=n6-Ex;&jq>eLpcI{>9Bhg3x;bpYJ`07beb zBtrCPA&&RUeyX%{1>!<^%lk^kpF}y*0J|W$=M>IVn{X`FOENOpFc{pS!ahl{a=EYs z`opAB%c3IK7Q!8SBDUP^jm4vg#ghoco#+KEN5~%xC*l7LnUj zjRhy@<(sWzOui7Yvm-txTtvojnWQ3JKnO0<`AR`Rz86GU~{V0#^2MJ<3 zW5}*=*>#^?M{(sgajp)0@fRi5DQD|KJ43w*loCT_G8CpYXiOMwO&uj<9-AJiLMHCA zqjSm$1IZ4Nd{9o`3-A$3?&1?<_J!2Q3-?=Wh| z|4W2M8UQ)WTa0*|44`(>C?^FvyEvq=W?4|76Tn@KP9YFB3uu;6Sqi|jLl69K;L+Mt zajT$7CRveT4s}ifoYqPbIE~Q?7qwBS;-T^1_WtpYFsyt96Z3Ik)D&4mXMK=md236 zEV)cA&0*FpzJqLD-QGgo4Sox+$aI8@JoqBOcr}KL%d4_;=Sr_IF0amAo=Yn=Emvyp z(p<^vWu>rk)0IV!&it{Nux8@C#(9lG;kwryc2|n@GzA)PxiLOvU@$veK7#@1A^_{D BICB61 literal 0 HcmV?d00001 diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/ad/a1/cd9122e6beb95de36bb8dc10c255a6a7d7b8bfbe21b72843ab6db402ee8cb8bde5fb2d050a7eb96ea330e8be1a394c4c7c444c8b541f8e180b7f12506fe8 b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/ad/a1/cd9122e6beb95de36bb8dc10c255a6a7d7b8bfbe21b72843ab6db402ee8cb8bde5fb2d050a7eb96ea330e8be1a394c4c7c444c8b541f8e180b7f12506fe8 new file mode 100644 index 00000000000000..009905080b2b41 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/ad/a1/cd9122e6beb95de36bb8dc10c255a6a7d7b8bfbe21b72843ab6db402ee8cb8bde5fb2d050a7eb96ea330e8be1a394c4c7c444c8b541f8e180b7f12506fe8 @@ -0,0 +1 @@ +{"_id":"async","_rev":"223-5df87f4f3d2584f561ccb40c7361a399","name":"async","description":"Higher-order functions and common patterns for asynchronous code","dist-tags":{"latest":"0.2.10"},"versions":{"0.1.0":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.0","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.0","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/async/-/async-0.1.0.tgz","shasum":"ab8ece0c40627e4e8f0e09c8fcf7c19ed0c4241c"},"directories":{}},"0.1.1":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.1","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/async/-/async-0.1.1.tgz","shasum":"fb965e70dbea44c8a4b8a948472dee7d27279d5e"},"directories":{}},"0.1.2":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.2","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.2","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/async/-/async-0.1.2.tgz","shasum":"be761882a64d3dc81a669f9ee3d5c28497382691"},"directories":{}},"0.1.3":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.3","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.3","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/async/-/async-0.1.3.tgz","shasum":"629ca2357112d90cafc33872366b14f2695a1fbc"},"directories":{}},"0.1.4":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.4","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.4","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/async/-/async-0.1.4.tgz","shasum":"29de4b98712ab8858411d8d8e3361a986c3b2c18"},"directories":{}},"0.1.5":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.5","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.5","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/async/-/async-0.1.5.tgz","shasum":"9d83e3d4adb9c962fc4a30e7dd04bf1206c28ea5"},"directories":{}},"0.1.6":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.6","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.6","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/async/-/async-0.1.6.tgz","shasum":"2dfb4fa1915f86056060c2e2f35a7fb8549907cc"},"directories":{}},"0.1.7":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.7","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.7","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.4-1","_nodeVersion":"v0.2.5","dist":{"tarball":"http://localhost:1337/async/-/async-0.1.7.tgz","shasum":"e9268d0d8cd8dcfe0db0895b27dcc4bcc5c739a5"},"directories":{}},"0.1.8":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.8","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.8","engines":{"node":"*"},"_nodeSupported":true,"dist":{"tarball":"http://localhost:1337/async/-/async-0.1.8.tgz","shasum":"52f2df6c0aa6a7f8333e1fbac0fbd93670cf6758"},"directories":{}},"0.1.9":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.9","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"dependencies":{},"devDependencies":{},"_id":"async@0.1.9","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.1rc7","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"f984d0739b5382c949cc3bea702d21d0dbd52040","tarball":"http://localhost:1337/async/-/async-0.1.9.tgz"},"directories":{}},"0.1.10":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.10","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/home/caolan/.npm/async/0.1.10/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"async@0.1.10","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"12b32bf098fa7fc51ae3ac51441b8ba15f437cf1","tarball":"http://localhost:1337/async/-/async-0.1.10.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.11":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.11","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/home/caolan/.npm/async/0.1.11/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"async@0.1.11","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"a397a69c6febae232d20a76a5b10d8742e2b8215","tarball":"http://localhost:1337/async/-/async-0.1.11.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.12":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.12","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/home/caolan/.npm/async/0.1.12/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"async@0.1.12","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"ab36be6611dc63d91657128e1d65102b959d4afe","tarball":"http://localhost:1337/async/-/async-0.1.12.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.13":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.13","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.13","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"f1e53ad69dab282d8e75cbec5e2c5524b6195eab","tarball":"http://localhost:1337/async/-/async-0.1.13.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.14":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.14","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.14","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"0fcfaf089229fc657798203d1a4544102f7d26dc","tarball":"http://localhost:1337/async/-/async-0.1.14.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.15":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.15","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.15","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"2180eaca2cf2a6ca5280d41c0585bec9b3e49bd3","tarball":"http://localhost:1337/async/-/async-0.1.15.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.16":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.16","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.16","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"b3a61fdc1a9193d4f64755c7600126e254223186","tarball":"http://localhost:1337/async/-/async-0.1.16.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.17":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.17","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"dependencies":{"uglify-js":"1.2.x"},"devDependencies":{"nodeunit":">0.0.0","nodelint":">0.0.0"},"scripts":{"preinstall":"make clean","install":"make build","test":"make test"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.17","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"03524a379e974dc9ee5c811c6ee3815d7bc54f6e","tarball":"http://localhost:1337/async/-/async-0.1.17.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.18":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.18","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.18","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"c59c923920b76d5bf23248c04433920c4d45086a","tarball":"http://localhost:1337/async/-/async-0.1.18.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.19":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.19","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.19","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"4fd6125a70f841fb10b14aeec6e23cf1479c71a7","tarball":"http://localhost:1337/async/-/async-0.1.19.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.20":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.20","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.20","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"ba0e47b08ae972e04b5215de28539b313482ede5","tarball":"http://localhost:1337/async/-/async-0.1.20.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.21":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.21","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.21","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"b5b12e985f09ab72c202fa00f623cd9d997e9464","tarball":"http://localhost:1337/async/-/async-0.1.21.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.22":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.22","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.22","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061","tarball":"http://localhost:1337/async/-/async-0.1.22.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.0":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.0","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_id":"async@0.2.0","dist":{"shasum":"db1c645337bab79d0ca93d95f5c72d9605be0fce","tarball":"http://localhost:1337/async/-/async-0.2.0.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.1":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.1","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_id":"async@0.2.1","dist":{"shasum":"4e37d08391132f79657a99ca73aa4eb471a6f771","tarball":"http://localhost:1337/async/-/async-0.2.1.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.2":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.2","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"_id":"async@0.2.2","dist":{"shasum":"8414ee47da7548126b4d3d923850d54e68a72b28","tarball":"http://localhost:1337/async/-/async-0.2.2.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.3":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.3","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"_id":"async@0.2.3","dist":{"shasum":"79bf601d723a2e8c3e91cb6bb08f152dca309fb3","tarball":"http://localhost:1337/async/-/async-0.2.3.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.4":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.4","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"_id":"async@0.2.4","dist":{"shasum":"0550e510cf43b83e2fcf1cb96399f03f1efd50eb","tarball":"http://localhost:1337/async/-/async-0.2.4.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.5":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.5","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"_id":"async@0.2.5","dist":{"shasum":"45f05da480749ba4c1dcd8cd3a3747ae7b36fe52","tarball":"http://localhost:1337/async/-/async-0.2.5.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.6":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.6","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.6","dist":{"shasum":"ad3f373d9249ae324881565582bc90e152abbd68","tarball":"http://localhost:1337/async/-/async-0.2.6.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.7":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.7","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.7","dist":{"shasum":"44c5ee151aece6c4bf5364cfc7c28fe4e58f18df","tarball":"http://localhost:1337/async/-/async-0.2.7.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.8":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.8","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.8","dist":{"shasum":"ba1b3ffd1e6cdb1e999aca76ef6ecee8e7f55f53","tarball":"http://localhost:1337/async/-/async-0.2.8.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.9":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.9","repository":{"type":"git","url":"https://github.com/caolan/async.git"},"bugs":{"url":"https://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"https://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.9","dist":{"shasum":"df63060fbf3d33286a76aaf6d55a2986d9ff8619","tarball":"http://localhost:1337/async/-/async-0.2.9.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.10":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.10","repository":{"type":"git","url":"https://github.com/caolan/async.git"},"bugs":{"url":"https://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"https://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.10","dist":{"shasum":"b6bbe0b0674b9d719708ca38de8c237cb526c3d1","tarball":"http://localhost:1337/async/-/async-0.2.10.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}}},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"author":{"name":"Caolan McMahon"},"repository":{"type":"git","url":"https://github.com/caolan/async.git"},"time":{"modified":"2014-03-13T17:04:44.914Z","created":"2010-12-19T16:41:51.765Z","0.1.0":"2010-12-19T16:41:51.765Z","0.1.1":"2010-12-19T16:41:51.765Z","0.1.2":"2010-12-19T16:41:51.765Z","0.1.3":"2010-12-19T16:41:51.765Z","0.1.4":"2010-12-19T16:41:51.765Z","0.1.5":"2010-12-19T16:41:51.765Z","0.1.6":"2010-12-19T16:41:51.765Z","0.1.7":"2010-12-19T16:41:51.765Z","0.1.8":"2011-01-18T09:56:53.975Z","0.1.9":"2011-04-27T20:48:08.634Z","0.1.10":"2011-09-19T04:40:01.573Z","0.1.11":"2011-10-14T17:07:28.752Z","0.1.12":"2011-10-14T17:19:19.452Z","0.1.13":"2011-10-29T22:33:52.448Z","0.1.14":"2011-10-29T22:40:14.486Z","0.1.15":"2011-11-01T23:05:01.415Z","0.1.16":"2012-02-13T04:56:23.926Z","0.1.17":"2012-02-27T02:40:58.997Z","0.1.18":"2012-02-27T16:51:02.109Z","0.1.19":"2012-05-24T06:51:06.109Z","0.1.20":"2012-05-24T06:53:39.997Z","0.1.21":"2012-05-24T07:16:16.753Z","0.1.22":"2012-05-30T18:26:44.821Z","0.1.23":"2012-10-04T13:52:08.947Z","0.2.0":"2013-02-04T11:38:08.943Z","0.2.1":"2013-02-04T11:52:34.110Z","0.2.2":"2013-02-05T15:55:23.202Z","0.2.3":"2013-02-06T12:48:37.415Z","0.2.4":"2013-02-07T17:26:22.236Z","0.2.5":"2013-02-10T22:42:00.162Z","0.2.6":"2013-03-03T11:29:52.674Z","0.2.7":"2013-04-09T20:50:04.712Z","0.2.8":"2013-05-01T10:04:07.430Z","0.2.9":"2013-05-28T07:50:48.795Z","0.2.10":"2014-01-23T16:23:57.271Z"},"users":{"thejh":true,"avianflu":true,"dylang":true,"ragingwind":true,"mvolkmann":true,"mikl":true,"linus":true,"pvorb":true,"dodo":true,"danielr":true,"suor":true,"dolphin278":true,"kurijov":true,"langpavel":true,"alexindigo":true,"fgribreau":true,"hughsk":true,"pid":true,"tylerstalder":true,"gillesruppert":true,"coiscir":true,"xenomuta":true,"jgoodall":true,"jswartwood":true,"drudge":true,"cpsubrian":true,"joeferner":true,"bencevans":true,"Scryptonite":true,"damonoehlman":true,"glukki":true,"tivac":true,"shama":true,"gimenete":true,"bryanburgers":true,"hij1nx":true,"sandeepmistry":true,"minddiaper":true,"fiws":true,"ljharb":true,"popeindustries":true,"charmander":true,"dbrockman":true,"eknkc":true,"booyaa":true,"afc163":true,"maxmaximov":true,"meryn":true,"hfcorriez":true,"hyqhyq_3":true,"zonetti":true,"cmilhench":true,"cparker15":true,"jfromaniello":true,"ExxKA":true,"devoidfury":true,"cedrickchee":true,"niftymonkey":true,"paulj":true,"leesei":true,"jamesmgreene":true,"igorissen":true,"zaphod1984":true,"moonpyk":true,"joliva":true,"netroy":true,"chrisweb":true,"cuprobot":true,"tmaximini":true,"lupomontero":true,"john.pinch":true,"everywhere.js":true,"frankblizzard":true,"alanshaw":true,"forivall":true,"kubakubula":true,"doliveira":true,"dstokes":true,"pana":true,"irae":true,"mhaidarh":true,"feross":true,"tetsu3a":true,"qubyte":true,"darosh":true,"pragmadash":true,"denisix":true,"samuelrn":true,"tigefa":true,"tcrowe":true,"tpwk":true,"eins78":true,"sierrasoftworks":true,"yoavf":true,"irakli":true,"hypergeometric":true,"gammasoft":true,"youxiachai":true,"kahboom":true,"elisee":true,"soroush":true,"thomas-so":true,"shenaor":true,"dannynemer":true,"paulomcnally":true,"timur.shemsedinov":true,"slianfeng":true,"ettalea":true,"mananvaghasiya":true,"daniel7912":true,"themiddleman":true,"jacques":true,"kerimdzhanov":true,"jorgemsrs":true,"ivandimanov":true,"vegera":true,"aselzer":true,"kentcdodds":true,"putaoshu":true,"imdsm":true,"cilindrox":true},"readme":"# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser. Also supports [component](https://github.com/component/component).\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, each…) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfall…). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n```javascript\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n\nasync.parallel([\n function(){ ... },\n function(){ ... }\n], callback);\n\nasync.series([\n function(){ ... },\n function(){ ... }\n]);\n```\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n## Common Pitfalls\n\n### Binding a context to an iterator\n\nThis section is really about bind, not about async. If you are wondering how to\nmake async execute your iterators in a given context, or are confused as to why\na method of another library isn't working as an iterator, study this example:\n\n```js\n// Here is a simple object with an (unnecessarily roundabout) squaring method\nvar AsyncSquaringLibrary = {\n squareExponent: 2,\n square: function(number, callback){ \n var result = Math.pow(number, this.squareExponent);\n setTimeout(function(){\n callback(null, result);\n }, 200);\n }\n};\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){\n // result is [NaN, NaN, NaN]\n // This fails because the `this.squareExponent` expression in the square\n // function is not evaluated in the context of AsyncSquaringLibrary, and is\n // therefore undefined.\n});\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){\n // result is [1, 4, 9]\n // With the help of bind we can attach a context to the iterator before\n // passing it to async. Now the square function will be executed in its \n // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`\n // will be as expected.\n});\n```\n\n## Download\n\nThe source is available for download from\n[GitHub](http://github.com/caolan/async).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed\n\n## In the Browser\n\nSo far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n```html\n\n\n```\n\n## Documentation\n\n### Collections\n\n* [each](#each)\n* [eachSeries](#eachSeries)\n* [eachLimit](#eachLimit)\n* [map](#map)\n* [mapSeries](#mapSeries)\n* [mapLimit](#mapLimit)\n* [filter](#filter)\n* [filterSeries](#filterSeries)\n* [reject](#reject)\n* [rejectSeries](#rejectSeries)\n* [reduce](#reduce)\n* [reduceRight](#reduceRight)\n* [detect](#detect)\n* [detectSeries](#detectSeries)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n* [concatSeries](#concatSeries)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [parallelLimit](#parallellimittasks-limit-callback)\n* [whilst](#whilst)\n* [doWhilst](#doWhilst)\n* [until](#until)\n* [doUntil](#doUntil)\n* [forever](#forever)\n* [waterfall](#waterfall)\n* [compose](#compose)\n* [applyEach](#applyEach)\n* [applyEachSeries](#applyEachSeries)\n* [queue](#queue)\n* [cargo](#cargo)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n* [times](#times)\n* [timesSeries](#timesSeries)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n\n### each(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the each function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n\n### eachSeries(arr, iterator, callback)\n\nThe same as each only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as each only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as map only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as reject, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then it's probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback(err, reduction) which accepts an optional error as its first \n argument, and the state of the reduction as the second. If an error is \n passed to the callback, the reduction is stopped and the main callback is \n immediately called with the error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, sortValue) which must be called once it\n has completed with an error (which can be null) and a value to use as the sort\n criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, results) which must be called once it \n has completed with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallelLimit(tasks, limit, [callback])\n\nThe same as parallel only the tasks are executed in parallel with a maximum of \"limit\" \ntasks executing at any time.\n\nNote that the tasks are not executed in batches, so there is no guarantee that \nthe first \"limit\" tasks will complete before any others are started.\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* limit - The maximum number of tasks to run at any time.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback(err) which must be called once it has completed with an \n optional error argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n\n### doWhilst(fn, test, callback)\n\nThe post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n---------------------------------------\n\n\n### doUntil(fn, test, callback)\n\nLike doWhilst except the test is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n\n### forever(fn, callback)\n\nCalls the asynchronous function 'fn' repeatedly, in series, indefinitely.\nIf an error is passed to fn's callback then 'callback' is called with the\nerror, otherwise it will never be called.\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a \n callback(err, result1, result2, ...) it must call on completion. The first\n argument is an error (which can be null) and any further arguments will be \n passed as arguments in order to the next task.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done' \n});\n```\n\n---------------------------------------\n\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions f(), g() and h() would produce the result of\nf(g(h())), only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling the\ncallback after all functions have completed. If you only provide the first\nargument then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* fns - the asynchronous functions to all call with the same arguments\n* args... - any number of separate arguments to pass to the function\n* callback - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n---------------------------------------\n\n\n### applyEachSeries(arr, iterator, callback)\n\nThe same as applyEach only the functions are applied in series.\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task, which must call its callback(err) argument when finished, with an \n optional error as an argument.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* unshift(task, [callback]) - add a new task to the front of the queue.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n---------------------------------------\n\n\n### cargo(worker, [payload])\n\nCreates a cargo object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the payload limit). If the\nworker is in progress, the task is queued until it is available. Once\nthe worker has completed some tasks, each callback of those tasks is called.\n\n__Arguments__\n\n* worker(tasks, callback) - An asynchronous function for processing an array of\n queued tasks, which must call its callback(err) argument when finished, with \n an optional error as an argument.\n* payload - An optional integer for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe cargo object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* payload - an integer for determining how many tasks should be\n process per round. This property can be changed after a cargo is created to\n alter the payload on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\nNote, all functions are called with a results object as a second argument, \nso it is unsafe to pass functions in the tasks object which cannot handle the\nextra argument. For example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling readFile with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to readFile in a function which does not forward the \nresults object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The \n function receives two arguments: (1) a callback(err, result) which must be \n called when finished, passing an error (which can be null) and the result of \n the function's execution, and (2) a results object, containing the results of\n the previously executed functions.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. Results will always be passed\n\tbut if an error occurred, no other tasks will be performed, and the results\n\tobject will only contain partial results.\n \n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n});\n```\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. It's also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setImmediate(callback)\nif available, otherwise setTimeout(callback, 0), which means other higher priority\nevents may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n\n### times(n, callback)\n\nCalls the callback n times and accumulates results in the same manner\nyou would use with async.map.\n\n__Arguments__\n\n* n - The number of times to run the function.\n* callback - The function to call n times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n\n### timesSeries(n, callback)\n\nThe same as times only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/caolan/async/issues"},"_attachments":{}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/b4/8a/454c55f95fa0351cca479761f5ff792f8f7ab4448f2b1399a3ac3778a60a293f71feeda29678ce15b71712b0803f9866e92c0cbc4549b4807435dcf7a767 b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/b4/8a/454c55f95fa0351cca479761f5ff792f8f7ab4448f2b1399a3ac3778a60a293f71feeda29678ce15b71712b0803f9866e92c0cbc4549b4807435dcf7a767 new file mode 100644 index 0000000000000000000000000000000000000000..0866e68dc09d2e2e7d587bd6aaaf23ee40764ec5 GIT binary patch literal 143 zcmb2|=3oE=VQmkebACSlSM?h%R7D>BS;-T^1_WtpYFsyt96TVRk)D&4mXMK=md236 zEV)c=nZvAGdsn-Wt58a%ko)-1Hk{$sgRHqy z)FY4b?K{gZ;$8p51WsQJ?BNg%#p>RB9|(4EGb35=_(GOgA}7?1HbjE`1i@3Zjz4Y~ mxWRP27lre|6e7=sdDti<%=52TOOhl>K6nE8r0AXi2mk=&S6NE{ literal 0 HcmV?d00001 diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/cd/eb/0f5065be03e89547a33e064d911969953c45eb05df664ca4d537b970dc9f768123463a6f75ce6b836d50ee73c18ac7a25e763f2b9869612cdbf427195d4b b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/cd/eb/0f5065be03e89547a33e064d911969953c45eb05df664ca4d537b970dc9f768123463a6f75ce6b836d50ee73c18ac7a25e763f2b9869612cdbf427195d4b new file mode 100644 index 00000000000000..df235e9e79ec2e --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/cd/eb/0f5065be03e89547a33e064d911969953c45eb05df664ca4d537b970dc9f768123463a6f75ce6b836d50ee73c18ac7a25e763f2b9869612cdbf427195d4b @@ -0,0 +1 @@ +{"_id":"test-repo-url-ssh","_rev":"2-cc990259d480838e6847fb520d305a9e","name":"test-repo-url-ssh","description":"Test repo with non-github ssh repository url","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"test-repo-url-ssh","version":"0.0.1","description":"Test repo with non-github ssh repository url","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@gitlab.com:evanlucas/test-repo-url-ssh.git"},"author":{"name":"Evan Lucas","email":"evanlucas@me.com"},"license":"ISC","_id":"test-repo-url-ssh@0.0.1","dist":{"shasum":"2a77307e108bfb57107c4c334abb5ef5395dc68a","tarball":"http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"evanlucas","email":"evanlucas@me.com"},"maintainers":[{"name":"evanlucas","email":"evanlucas@me.com"}],"directories":{}}},"readme":"ERROR: No README data found!","maintainers":[{"name":"evanlucas","email":"evanlucas@me.com"}],"time":{"0.0.1":"2014-02-16T18:50:00.142Z"},"readmeFilename":"","_attachments":{}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/d4/45/ed72e65ed0b9fec5a6a41794caadda951ba79a0541648e259c8021b3fc96487d2caedf869ac142b4b0f31998c436f171d98a9a1740e3ac8eebb5c1103c53 b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/d4/45/ed72e65ed0b9fec5a6a41794caadda951ba79a0541648e259c8021b3fc96487d2caedf869ac142b4b0f31998c436f171d98a9a1740e3ac8eebb5c1103c53 new file mode 100644 index 00000000000000..11b928e5cddd9e --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/d4/45/ed72e65ed0b9fec5a6a41794caadda951ba79a0541648e259c8021b3fc96487d2caedf869ac142b4b0f31998c436f171d98a9a1740e3ac8eebb5c1103c53 @@ -0,0 +1 @@ +{"_id":"checker","_rev":"23-39ff9491581c529b8b828651a196c7a3","name":"checker","description":"Checker is the collection of common abstract methods for validatiors and setters.","dist-tags":{"latest":"0.5.2"},"versions":{"0.0.0":{"name":"checker","version":"0.0.0","description":"","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"MIT","readme":"ERROR: No README data found!","_id":"checker@0.0.0","dist":{"shasum":"6a7a3977bbe770560d4fcc86eb3a32a52c9b368d","tarball":"http://localhost:1337/checker/-/checker-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.2.1":{"name":"checker","version":"0.2.1","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n\n(THIS DOCUMENTAION IS NOT FINISHED YET.)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, callback);\n```\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\n#### options.limit `Boolean=false`\n\n#### options.check_all `Boolean=false`\n\n\n\n## Schema Structures \n\n```js\n{\n\t: \n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n","_id":"checker@0.2.1","dist":{"shasum":"f25a07a1429cd9cee4a668f19fa99fa7e380deda","tarball":"http://localhost:1337/checker/-/checker-0.2.1.tgz"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.3.1":{"name":"checker","version":"0.3.1","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n\n(THIS DOCUMENTAION IS NOT FINISHED YET.)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, callback);\n```\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\n#### options.limit `Boolean=false`\n\n#### options.check_all `Boolean=false`\n\n\n\n## Schema Structures \n\n```js\n{\n\t: \n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n","_id":"checker@0.3.1","dist":{"shasum":"c285c3f3c29c4186156d9e94945ad3892e64c739","tarball":"http://localhost:1337/checker/-/checker-0.3.1.tgz"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.3.2":{"name":"checker","version":"0.3.2","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, function(err, value, details){\n});\n```\n\n### err `mixed`\n\n### parsed `Object`\n\nThe cleaned and parsed `data`.\n\n### details `Object`\n\n```\n{\n\t: \n}\n```\n\n- `detail.value` `mixed` the parsed value\n- `detail.is_default` `Boolean` if the current property is defined in `schema`, but the input data doesn't have it, then the value will be `true`\n- `detail.is_cooked` `Boolean` if there're any setters, it will be `true`\n- `detail.origin` the origin value of the property\n\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; ' \n\t\t\t+ 'Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\nBy default, `checker` will check each properties in series, \n\n#### options.limit `Boolean=false`\n\nIf `options.limit` is `true` and a certain property of the input data is not defined in the `schema`, the property will be removed.\n\nDefault to `false`.\n\n#### options.check_all `Boolean=false`\n\nNot implemented yet.\n\n#### options.context `Object`\n\nSee sections below.\n\n## Schema Structures \n\n```js\n{\n\t: \n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n\n\n## `this` object inside validators and setters\n\nInside validators(`rule.validator`) and setters(`rule.setter`), there're several opaque methods\n\n### this.async()\n\nGenerate the `done` function to make the validator or setter become an async method.\n\n\tvar done = this.async();\n\t\nFor details, see the demos above.\n\n### this.get(name)\n\nThe value of the input object by name\n\n### this.set(name, value)\n\nChange the value of the specified property of the input object.\n\n```\n{\n\tusername: {\n\t},\n\t\n\tpassword: {\n\t\tvalidator: function(value){\n\t\t\tvar username = this.get('username');\n\t\t\t\n\t\t\t// Guests are welcome even without passwords\n\t\t\treturn value || username === 'guest';\n\t\t}\n\t}\n}\n```\n\nNotice that you'd better use `this.get` and `this.set` with the `options.parallel` setting as `false`(the default value). Otherwise, it might encounter unexpected situations, because the value of the object is ever changing due to the setter.\n\nSo, use them wisely.\n\n### this.context `Object`\n\nThe `options.context` itself.\n\n\n\n","_id":"checker@0.3.2","dist":{"shasum":"bc4b84036a5699c609e3c627923cb87d8058a79d","tarball":"http://localhost:1337/checker/-/checker-0.3.2.tgz"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.4.2":{"name":"checker","version":"0.4.2","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, function(err, value, details){\n});\n```\n\n### err `mixed`\n\n### results `Object`\n\nThe parsed object.\n\n### details `Object`\n\n```\n{\n\t: \n}\n```\n\n- `detail.value` `mixed` the parsed value\n- `detail.is_default` `Boolean` if the current property is defined in `schema`, but the input data doesn't have it, then the value will be `true`\n- `detail.is_cooked` `Boolean` if there're any setters, it will be `true`\n- `detail.origin` the origin value of the property\n- `detail.error` the error belongs to the current property. If not exists, it will be `null`\n\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; ' \n\t\t\t+ 'Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\nBy default, `checker` will check each properties in series, \n\n#### options.limit `Boolean=false`\n\nIf `options.limit` is `true` and a certain property of the input data is not defined in the `schema`, the property will be removed.\n\nDefault to `false`.\n\n#### options.check_all `Boolean=false`\n\nBy default, `checker` will exit immediately at the first error. But if `options.check_all` is `true`, it will parse all the properties, and collect every possible error.\n\n#### options.context `Object`\n\nSee sections below.\n\n## Schema Structures \n\n```js\n{\n\t: \n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n\n\n## `this` object inside validators and setters\n\nInside validators(`rule.validator`) and setters(`rule.setter`), there're several opaque methods\n\n### this.async()\n\nGenerate the `done` function to make the validator or setter become an async method.\n\n\tvar done = this.async();\n\t\nFor details, see the demos above.\n\n### this.get(name)\n\nThe value of the input object by name\n\n### this.set(name, value)\n\nChange the value of the specified property of the input object.\n\n```\n{\n\tusername: {\n\t},\n\t\n\tpassword: {\n\t\tvalidator: function(value){\n\t\t\tvar username = this.get('username');\n\t\t\t\n\t\t\t// Guests are welcome even without passwords\n\t\t\treturn value || username === 'guest';\n\t\t}\n\t}\n}\n```\n\nNotice that you'd better use `this.get` and `this.set` with the `options.parallel` setting as `false`(the default value). Otherwise, it might encounter unexpected situations, because the value of the object is ever changing due to the setter.\n\nSo, use them wisely.\n\n### this.context `Object`\n\nThe `options.context` itself.\n\n\n\n","_id":"checker@0.4.2","dist":{"shasum":"7b033fdad0f000f88302ff1f5a8e59d8f466580e","tarball":"http://localhost:1337/checker/-/checker-0.4.2.tgz"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.5.1":{"name":"checker","version":"0.5.1","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, function(err, value, details){\n});\n```\n\n### err `mixed`\n\n### results `Object`\n\nThe parsed object.\n\n### details `Object`\n\n```\n{\n\t: \n}\n```\n\n- `detail.value` `mixed` the parsed value\n- `detail.is_default` `Boolean` if the current property is defined in `schema`, but the input data doesn't have it, then the value will be `true`\n- `detail.is_cooked` `Boolean` if there're any setters, it will be `true`\n- `detail.origin` the origin value of the property\n- `detail.error` the error belongs to the current property. If not exists, it will be `null`\n\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; ' \n\t\t\t+ 'Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\nBy default, `checker` will check each properties in series, \n\n#### options.limit `Boolean=false`\n\nIf `options.limit` is `true` and a certain property of the input data is not defined in the `schema`, the property will be removed.\n\nDefault to `false`.\n\n#### options.check_all `Boolean=false`\n\nBy default, `checker` will exit immediately at the first error. But if `options.check_all` is `true`, it will parse all the properties, and collect every possible error.\n\n#### options.context `Object`\n\nSee sections below.\n\n## Schema Structures \n\n```js\n{\n\t: \n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n\n\n## `this` object inside validators and setters\n\nInside validators(`rule.validator`) and setters(`rule.setter`), there're several opaque methods\n\n### this.async()\n\nGenerate the `done` function to make the validator or setter become an async method.\n\n\tvar done = this.async();\n\t\nFor details, see the demos above.\n\n### this.get(name)\n\nThe value of the input object by name\n\n### this.set(name, value)\n\nChange the value of the specified property of the input object.\n\n```\n{\n\tusername: {\n\t},\n\t\n\tpassword: {\n\t\tvalidator: function(value){\n\t\t\tvar username = this.get('username');\n\t\t\t\n\t\t\t// Guests are welcome even without passwords\n\t\t\treturn value || username === 'guest';\n\t\t}\n\t}\n}\n```\n\nNotice that you'd better use `this.get` and `this.set` with the `options.parallel` setting as `false`(the default value). Otherwise, it might encounter unexpected situations, because the value of the object is ever changing due to the setter.\n\nSo, use them wisely.\n\n### this.context `Object`\n\nThe `options.context` itself.\n\n\n\n","readmeFilename":"README.md","_id":"checker@0.5.1","dist":{"shasum":"fef66f63d231ae2910f7dd7df291912a1e95e5d7","tarball":"http://localhost:1337/checker/-/checker-0.5.1.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}},"0.5.2":{"name":"checker","version":"0.5.2","description":"Checker is the collection of common abstract methods for validatiors and setters.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"keywords":["checker","validator","validate","setter"],"author":{"name":"kael"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-checker/issues"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"dependencies":{"async":"~0.2.9"},"readme":"[![NPM version](https://badge.fury.io/js/checker.png)](http://badge.fury.io/js/checker)\n[![Build Status](https://travis-ci.org/kaelzhang/node-checker.png?branch=master)](https://travis-ci.org/kaelzhang/node-checker)\n[![Dependency Status](https://gemnasium.com/kaelzhang/node-checker.png)](https://gemnasium.com/kaelzhang/node-checker)\n\n# checker\n\nChecker is the collection of common abstract node.js methods for validatiors and setters.\n\t\n# Usage\n```sh\nnpm install checker --save\n```\n\n```js\nvar checker = require('checker');\n```\n\n# Synopsis\n\n```js\nchecker(schema, options).check(data, function(err, value, details){\n});\n```\n\n### err `mixed`\n\n### results `Object`\n\nThe parsed object.\n\n### details `Object`\n\n```\n{\n\t: \n}\n```\n\n- `detail.value` `mixed` the parsed value\n- `detail.is_default` `Boolean` if the current property is defined in `schema`, but the input data doesn't have it, then the value will be `true`\n- `detail.is_cooked` `Boolean` if there're any setters, it will be `true`\n- `detail.origin` the origin value of the property\n- `detail.error` the error belongs to the current property. If not exists, it will be `null`\n\n\n# Validation, Error Messages\n\n## Simple synchronous validators\n\n```js\nvar schema = {\n\tusername: {\n\t\tvalidator: function(value){\n\t\t\treturn /^[a-zA-Z0-9]{6,}$/.test(value);\n\t\t},\n\t\tmessage: 'Username must only contain letters, numbers; ' \n\t\t\t+ 'Username must contain at least 6 charactors'\n\t}\n};\n\nvar c = checker(schema);\n\nc.check({\n\tusername: 'a'\n}, function(err){\n\tif(err){\n\t\tconsole.log(err); // Then, `schema.username.message` will be displayed.\n\t}\n});\n```\n\n## Regular expressions as validators\n\nThe error hint of the example above is bad, because we want to know the very certain reason why we are wrong.\n\nThe `schema` below is equivalent to the one of the previous section:\n\n```js\n{\n\tvalidator: [\n\t\tfunction(value){\n\t\t\treturn value && value.length > 5;\n\t\t}, \n\t\t/^[a-zA-Z0-9]+$/\n\t],\n\tmessage: [\n\t\t'Username must contain at least 6 charactors', \n\t\t'Username must only contain letters and numbers'\n\t];\n}\n```\n\n## Asynchronous validators\n\n```js\n{\n\tvalidator: function(value){\n\t\tvar done = this.async();\n\t\t// this is an async method, and takes sooooo long...\n\t\tremote_check(value, function(err){\n\t\t\tdone(err); // `err` will pass to the `callback`\n\t\t});\n\t}\n}\n```\n\n\n# Programmatical Details\n\n## Options\n\n#### options.default_message `String`\n\nDefault error message\n\n#### options.parallel `Boolean=false`\n\nBy default, `checker` will check each properties in series, \n\n#### options.limit `Boolean=false`\n\nIf `options.limit` is `true` and a certain property of the input data is not defined in the `schema`, the property will be removed.\n\nDefault to `false`.\n\n#### options.check_all `Boolean=false`\n\nBy default, `checker` will exit immediately at the first error. But if `options.check_all` is `true`, it will parse all the properties, and collect every possible error.\n\n#### options.context `Object`\n\nSee sections below.\n\n## Schema Structures \n\n```js\n{\n\t: \n}\n```\n\n\nWhere `rule` might contains (all properties are optional):\n\n#### validator \n\n- `RegExp` The regular exp that input must matches against\n- `Function` Validation function. If `arguments.length === 3`, it will be considered as an async methods\n- `Array.` Group of validations. Asks will check each validator one by one. If validation fails, the rest validators will be skipped.\n- See sections above for details\n\t\n#### setter `Function|Array.`\n\nSee sections above for details.\n\n#### message `String`\n\nDefault error message\n\n#### default: `String`\n\n\n## `this` object inside validators and setters\n\nInside validators(`rule.validator`) and setters(`rule.setter`), there're several opaque methods\n\n### this.async()\n\nGenerate the `done` function to make the validator or setter become an async method.\n\n\tvar done = this.async();\n\t\nFor details, see the demos above.\n\n### this.get(name)\n\nThe value of the input object by name\n\n### this.set(name, value)\n\nChange the value of the specified property of the input object.\n\n```\n{\n\tusername: {\n\t},\n\t\n\tpassword: {\n\t\tvalidator: function(value){\n\t\t\tvar username = this.get('username');\n\t\t\t\n\t\t\t// Guests are welcome even without passwords\n\t\t\treturn value || username === 'guest';\n\t\t}\n\t}\n}\n```\n\nNotice that you'd better use `this.get` and `this.set` with the `options.parallel` setting as `false`(the default value). Otherwise, it might encounter unexpected situations, because the value of the object is ever changing due to the setter.\n\nSo, use them wisely.\n\n### this.context `Object`\n\nThe `options.context` itself.\n\n\n\n","readmeFilename":"README.md","_id":"checker@0.5.2","dist":{"shasum":"c27a36bf00f3a7a3d24a8fbc7853f06fce4e9c86","tarball":"http://localhost:1337/checker/-/checker-0.5.2.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"kael","email":"i@kael.me"}],"directories":{}}},"readme":"ERROR: No README data found!","maintainers":[{"name":"kael","email":"i@kael.me"}],"time":{"modified":"2013-10-17T03:05:51.738Z","created":"2013-10-07T13:53:26.836Z","0.0.0":"2013-10-07T14:00:18.706Z","0.2.1":"2013-10-08T13:10:06.237Z","0.3.1":"2013-10-08T14:00:33.456Z","0.3.2":"2013-10-08T14:36:07.451Z","0.4.2":"2013-10-09T10:02:48.711Z","0.5.1":"2013-10-09T16:43:25.048Z","0.5.2":"2013-10-17T03:05:51.738Z"},"author":{"name":"kael"},"repository":{"type":"git","url":"git://github.com/kaelzhang/node-checker.git"},"_attachments":{}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/dc/2a/a4df42cd435623f4c2c3e274fa081cc942ff45dcfa98cdf4a9324b6a21c3721c34bb97e6809ee28051fc10f57749cff60aa970a1e38c7a6c354a9403554e b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/dc/2a/a4df42cd435623f4c2c3e274fa081cc942ff45dcfa98cdf4a9324b6a21c3721c34bb97e6809ee28051fc10f57749cff60aa970a1e38c7a6c354a9403554e new file mode 100644 index 00000000000000..fa7bb7f467d7bd --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/dc/2a/a4df42cd435623f4c2c3e274fa081cc942ff45dcfa98cdf4a9324b6a21c3721c34bb97e6809ee28051fc10f57749cff60aa970a1e38c7a6c354a9403554e @@ -0,0 +1 @@ +{"@foo/bar":"write","@foo/util":"read"} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/dc/68/8298544a3867cf399b04cc60c38c6519dae6096c5ba1917bb78a489baa9d6bad39649e16e00367e7cd02ac14ba7cd64f3acd56e21b984630f823ad9c9663 b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/dc/68/8298544a3867cf399b04cc60c38c6519dae6096c5ba1917bb78a489baa9d6bad39649e16e00367e7cd02ac14ba7cd64f3acd56e21b984630f823ad9c9663 new file mode 100644 index 00000000000000..4293310ab4d4ff --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/dc/68/8298544a3867cf399b04cc60c38c6519dae6096c5ba1917bb78a489baa9d6bad39649e16e00367e7cd02ac14ba7cd64f3acd56e21b984630f823ad9c9663 @@ -0,0 +1 @@ +{"name":"add-named-update-protocol-port","versions":{"0.0.0":{"name":"add-named-update-protocol-port","version":"0.0.0","dist":{"tarball":"https://localhost:1338/registry/add-named-update-protocol-port/-/add-named-update-protocol-port-0.0.0.tgz","shasum":"356a192b7913b04c54574d18c28d46e6395428ab"}}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/e7/06/de9d8e6ce16152be537cbccdf26321b3d678394ce42fb56aa4e69a37aba9d54df284700d066f7e6d005e461ab41d220fd6f268ff889e405809108a7b8676 b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/e7/06/de9d8e6ce16152be537cbccdf26321b3d678394ce42fb56aa4e69a37aba9d54df284700d066f7e6d005e461ab41d220fd6f268ff889e405809108a7b8676 new file mode 100644 index 00000000000000..a04cd09944ea10 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/e7/06/de9d8e6ce16152be537cbccdf26321b3d678394ce42fb56aa4e69a37aba9d54df284700d066f7e6d005e461ab41d220fd6f268ff889e405809108a7b8676 @@ -0,0 +1 @@ +{"latest":"2.0.0","a":"0.0.2","b":"0.6.0"} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/e8/36/89a9c21ac93c2a0efc7e536925004e528bd3bfeba708cf5216db999c5efce0d7138a7e6ecedb125e43ba2aeb475d5958a2ca31f48c6a1442f164e90a3a22 b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/e8/36/89a9c21ac93c2a0efc7e536925004e528bd3bfeba708cf5216db999c5efce0d7138a7e6ecedb125e43ba2aeb475d5958a2ca31f48c6a1442f164e90a3a22 new file mode 100644 index 00000000000000..643beaec7898ae --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/e8/36/89a9c21ac93c2a0efc7e536925004e528bd3bfeba708cf5216db999c5efce0d7138a7e6ecedb125e43ba2aeb475d5958a2ca31f48c6a1442f164e90a3a22 @@ -0,0 +1 @@ +{"username":"igotauthed"} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/ed/fc/2d79d0d55bf4ea02b74ecc3657ea833bc6d0578adb2e1f5ae0d733b09a484f8e7287901578c7bdaa5d6fd30ac4dea48773a610ca6ee1e09e31f6147e921d b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/ed/fc/2d79d0d55bf4ea02b74ecc3657ea833bc6d0578adb2e1f5ae0d733b09a484f8e7287901578c7bdaa5d6fd30ac4dea48773a610ca6ee1e09e31f6147e921d new file mode 100644 index 00000000000000..34df07b38c356e --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/ed/fc/2d79d0d55bf4ea02b74ecc3657ea833bc6d0578adb2e1f5ae0d733b09a484f8e7287901578c7bdaa5d6fd30ac4dea48773a610ca6ee1e09e31f6147e921d @@ -0,0 +1 @@ +{"_id":"optimist","_rev":"147-993915d1034a2506e97797cd2d1bd171","name":"optimist","dist-tags":{"latest":"0.6.0"},"versions":{"0.0.1":{"name":"optimist","version":"0.0.1","descrption":"Light-weight option parsing","modules":{"index":"./optimist.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"engine":["node >=0.1.100"],"_id":"optimist@0.0.1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/optimist/-/optimist-0.0.1.tgz","shasum":"be66175d8781290f1672ae96858814c88274c41c"},"directories":{}},"0.0.2":{"name":"optimist","version":"0.0.2","description":"Light-weight option parsing","modules":{"index":"./optimist.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"engine":["node >=0.1.100"],"_id":"optimist@0.0.2","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/optimist/-/optimist-0.0.2.tgz","shasum":"594ac6711315fa0d06887e3833567ff3fc7de4e1"},"directories":{}},"0.0.4":{"name":"optimist","version":"0.0.4","description":"Light-weight option parsing with an argv hash. No optstrings attached.","modules":{"index":"./lib/optimist.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.0.4","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/optimist/-/optimist-0.0.4.tgz","shasum":"6d5a2516e5b9a4808a8477cd62086ef829f07f4e"},"directories":{}},"0.0.5":{"name":"optimist","version":"0.0.5","description":"Light-weight option parsing with an argv hash. No optstrings attached.","modules":{"index":"./lib/optimist.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.0.5","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/optimist/-/optimist-0.0.5.tgz","shasum":"79f3bd7caf7c9002ace2a0600df80761fa459ea7"},"directories":{}},"0.0.6":{"name":"optimist","version":"0.0.6","description":"Light-weight option parsing with an argv hash. No optstrings attached.","modules":{"index":"./lib/optimist.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.0.6","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://localhost:1337/optimist/-/optimist-0.0.6.tgz","shasum":"1e00197a8f5c010ed02c9bed629af28422c51bdf"},"directories":{}},"0.0.7":{"name":"optimist","version":"0.0.7","description":"Light-weight option parsing with an argv hash. No optstrings attached.","modules":{"index":"./lib/optimist.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.0.7","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.10","_nodeVersion":"v0.2.5","dist":{"shasum":"5ffc1dce7ddfdfe57a61fabb2644d7bda57722b2","tarball":"http://localhost:1337/optimist/-/optimist-0.0.7.tgz"},"directories":{}},"0.1.0":{"name":"optimist","version":"0.1.0","description":"Light-weight option parsing with an argv hash. No optstrings attached.","modules":{"index":"./lib/optimist.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.1.0","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.10","_nodeVersion":"v0.2.5","dist":{"shasum":"b523820a36a51c35bf6098d2dc4b5aa001e0f541","tarball":"http://localhost:1337/optimist/-/optimist-0.1.0.tgz"},"directories":{}},"0.1.1":{"name":"optimist","version":"0.1.1","description":"Light-weight option parsing with an argv hash. No optstrings attached.","modules":{"index":"./lib/optimist.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.1.1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.10","_nodeVersion":"v0.2.5","dist":{"shasum":"ed43041fe2196e9f36b9c0f75e301526ab751baa","tarball":"http://localhost:1337/optimist/-/optimist-0.1.1.tgz"},"directories":{}},"0.1.2":{"name":"optimist","version":"0.1.2","description":"Light-weight option parsing with an argv hash. No optstrings attached.","modules":{"index":"./lib/optimist.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","option","parser","parsing"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.1.2","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.12-1","_nodeVersion":"v0.2.5","dist":{"shasum":"489780fb5350e8429e99a9e6e1305124eb3bbc8e","tarball":"http://localhost:1337/optimist/-/optimist-0.1.2.tgz"},"directories":{}},"0.1.3":{"name":"optimist","version":"0.1.3","description":"Light-weight option parsing with an argv hash. No optstrings attached.","modules":{"index":"./lib/optimist.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","option","parser","parsing"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.1.3","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.12-1","_nodeVersion":"v0.2.5","dist":{"shasum":"90389a7e6807b5798b41c4b4112403a9691b98ff","tarball":"http://localhost:1337/optimist/-/optimist-0.1.3.tgz"},"directories":{}},"0.1.4":{"name":"optimist","version":"0.1.4","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index","repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","option","parser","parsing"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.1.4","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.2.16","_nodeVersion":"v0.3.8-pre","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"92496e1e378b46a24b6c027a612637cfc5fb543e","tarball":"http://localhost:1337/optimist/-/optimist-0.1.4.tgz"}},"0.1.5":{"name":"optimist","version":"0.1.5","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index","repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","option","parser","parsing"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.1.5","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.2.16","_nodeVersion":"v0.3.8-pre","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"f5b85dd7ba7928224db268f668419ffb1e7d2cec","tarball":"http://localhost:1337/optimist/-/optimist-0.1.5.tgz"}},"0.1.6":{"name":"optimist","version":"0.1.6","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index","repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","option","parser","parsing"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.1.6","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.2.16","_nodeVersion":"v0.3.8-pre","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"0f2f671dfec3365509dc335f098158aa90c80100","tarball":"http://localhost:1337/optimist/-/optimist-0.1.6.tgz"}},"0.1.7":{"name":"optimist","version":"0.1.7","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.1.7","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.15","_nodeVersion":"v0.4.2","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"f83a9644634d446bf3934518257d55dd6d08e183","tarball":"http://localhost:1337/optimist/-/optimist-0.1.7.tgz"}},"0.1.8":{"name":"optimist","version":"0.1.8","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":["node >=0.1.100"],"_id":"optimist@0.1.8","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.15","_nodeVersion":"v0.4.2","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"58d0adde9d61db67dfbe2c7467da8abf9c86bc94","tarball":"http://localhost:1337/optimist/-/optimist-0.1.8.tgz"}},"0.1.9":{"name":"optimist","version":"0.1.9","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":["node >=0.1.100"],"dependencies":{},"devDependencies":{},"_id":"optimist@0.1.9","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.1rc8","_nodeVersion":"v0.4.2","_defaultsLoaded":true,"dist":{"shasum":"d88fd79743a88960a418f5754b3b2157252447cc","tarball":"http://localhost:1337/optimist/-/optimist-0.1.9.tgz"},"directories":{}},"0.0.3":{"name":"optimist","version":"0.0.3","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./optimist.js","repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"license":"MIT/X11","engine":["node >=0.1.100"],"dependencies":{},"devDependencies":{},"_id":"optimist@0.0.3","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.8-pre","_defaultsLoaded":true,"dist":{"shasum":"323a5c625b708e0197b72c106aef6444ada0c515","tarball":"http://localhost:1337/optimist/-/optimist-0.0.3.tgz"},"scripts":{},"directories":{}},"0.2.0":{"name":"optimist","version":"0.2.0","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"dependencies":{},"devDependencies":{},"_id":"optimist@0.2.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"1cb5b0e727009370f324765e2a5245ac0d806bfd","tarball":"http://localhost:1337/optimist/-/optimist-0.2.0.tgz"},"scripts":{},"directories":{}},"0.2.1":{"name":"optimist","version":"0.2.1","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"dependencies":{},"devDependencies":{},"_id":"optimist@0.2.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"80a2d75b660d467f673599dcbc69c113f289554a","tarball":"http://localhost:1337/optimist/-/optimist-0.2.1.tgz"},"scripts":{},"directories":{}},"0.2.2":{"name":"optimist","version":"0.2.2","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"examples"},"dependencies":{"wordwrap":">=0.0.1 <0.1"},"devDependencies":{"expresso":"=0.7.x"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_id":"optimist@0.2.2","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"a6bb06ff1f8229a12ee9abcb8160eee35e629ef8","tarball":"http://localhost:1337/optimist/-/optimist-0.2.2.tgz"},"scripts":{}},"0.2.3":{"name":"optimist","version":"0.2.3","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"examples"},"dependencies":{"wordwrap":">=0.0.1 <0.1"},"devDependencies":{"expresso":"=0.7.x"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_id":"optimist@0.2.3","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"dc259cc0e5d73e1f3fcc2dea3526e52f19ed740c","tarball":"http://localhost:1337/optimist/-/optimist-0.2.3.tgz"},"scripts":{}},"0.2.4":{"name":"optimist","version":"0.2.4","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"examples"},"dependencies":{"wordwrap":">=0.0.1 <0.1"},"devDependencies":{"hashish":"0.0.x","expresso":"=0.7.x"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_id":"optimist@0.2.4","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"9d543b3444fe127e8c01891c11a38d20b886317b","tarball":"http://localhost:1337/optimist/-/optimist-0.2.4.tgz"},"scripts":{}},"0.2.5":{"name":"optimist","version":"0.2.5","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"examples"},"dependencies":{"wordwrap":">=0.0.1 <0.1"},"devDependencies":{"hashish":"0.0.x","expresso":"=0.7.x"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_id":"optimist@0.2.5","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"50e0127b8443da18f4fdb756aaca446f1c65d136","tarball":"http://localhost:1337/optimist/-/optimist-0.2.5.tgz"},"scripts":{}},"0.2.6":{"name":"optimist","version":"0.2.6","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"examples"},"dependencies":{"wordwrap":">=0.0.1 <0.1"},"devDependencies":{"hashish":"0.0.x","expresso":"=0.7.x"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_id":"optimist@0.2.6","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"c15b750c98274ea175d241b745edf4ddc88f177b","tarball":"http://localhost:1337/optimist/-/optimist-0.2.6.tgz"},"scripts":{}},"0.2.7":{"name":"optimist","version":"0.2.7","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"examples"},"dependencies":{"wordwrap":">=0.0.1 <0.1.0"},"devDependencies":{"hashish":"0.0.x","expresso":"0.7.x"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_npmUser":{"name":"substack","email":"mail@substack.net"},"_id":"optimist@0.2.7","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.99","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"62945bcc760643d918a5c7649ade86e662144024","tarball":"http://localhost:1337/optimist/-/optimist-0.2.7.tgz"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.2.8":{"name":"optimist","version":"0.2.8","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"examples"},"dependencies":{"wordwrap":">=0.0.1 <0.1.0"},"devDependencies":{"hashish":"0.0.x","expresso":"0.7.x"},"scripts":{"test":"expresso"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_npmUser":{"name":"substack","email":"mail@substack.net"},"_id":"optimist@0.2.8","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.99","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"e981ab7e268b457948593b55674c099a815cac31","tarball":"http://localhost:1337/optimist/-/optimist-0.2.8.tgz"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.3.0":{"name":"optimist","version":"0.3.0","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"examples"},"dependencies":{"wordwrap":">=0.0.1 <0.1.0"},"devDependencies":{"hashish":"0.0.x","expresso":"0.7.x"},"scripts":{"test":"expresso"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_npmUser":{"name":"substack","email":"mail@substack.net"},"_id":"optimist@0.3.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"4458c1f02acf1e5c9ece36ce2fd4d338e56ee0f6","tarball":"http://localhost:1337/optimist/-/optimist-0.3.0.tgz"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.3.1":{"name":"optimist","version":"0.3.1","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"examples"},"dependencies":{"wordwrap":">=0.0.1 <0.1.0"},"devDependencies":{"hashish":"0.0.x","expresso":"0.7.x"},"scripts":{"test":"expresso"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_npmUser":{"name":"substack","email":"mail@substack.net"},"_id":"optimist@0.3.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"6680d30560193af5a55eb64394883ed7bcb98f2e","tarball":"http://localhost:1337/optimist/-/optimist-0.3.1.tgz"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.3.3":{"name":"optimist","version":"0.3.3","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"example"},"dependencies":{"wordwrap":"~0.0.2"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.2.4"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_npmUser":{"name":"substack","email":"mail@substack.net"},"_id":"optimist@0.3.3","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"d75701d48f37fe0e6f06f88e7b0cf0882a3ce394","tarball":"http://localhost:1337/optimist/-/optimist-0.3.3.tgz"},"readme":"","maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.3.4":{"name":"optimist","version":"0.3.4","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"example"},"dependencies":{"wordwrap":"~0.0.2"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.2.4"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_npmUser":{"name":"substack","email":"mail@substack.net"},"_id":"optimist@0.3.4","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"4d6d0bd71ffad0da4ba4f6d876d5eeb04e07480b","tarball":"http://localhost:1337/optimist/-/optimist-0.3.4.tgz"},"readme":"","maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.3.5":{"name":"optimist","version":"0.3.5","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","directories":{"lib":".","test":"test","example":"example"},"dependencies":{"wordwrap":"~0.0.2"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.2.4"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"readme":"optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n","_id":"optimist@0.3.5","dist":{"shasum":"03654b52417030312d109f39b159825b60309304","tarball":"http://localhost:1337/optimist/-/optimist-0.3.5.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.3.6":{"name":"optimist","version":"0.3.6","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","dependencies":{"wordwrap":"~0.0.2"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.4.0"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"readme":"optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n","readmeFilename":"readme.markdown","_id":"optimist@0.3.6","dist":{"shasum":"816e0039f848fccf9db70cada5535ed9dd55f496","tarball":"http://localhost:1337/optimist/-/optimist-0.3.6.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.3.7":{"name":"optimist","version":"0.3.7","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","dependencies":{"wordwrap":"~0.0.2"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.4.0"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"readme":"optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n","readmeFilename":"readme.markdown","_id":"optimist@0.3.7","dist":{"shasum":"c90941ad59e4273328923074d2cf2e7cbc6ec0d9","tarball":"http://localhost:1337/optimist/-/optimist-0.3.7.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.4.0":{"name":"optimist","version":"0.4.0","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","dependencies":{"wordwrap":"~0.0.2"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.4.0"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"readme":"optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\nshort numbers\n-------------\n\nShort numeric `head -n5` style argument work too:\n\n $ node reflect.js -n123 -m456\n { '3': true,\n '6': true,\n _: [],\n '$0': 'node ./reflect.js',\n n: 123,\n m: 456 }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n","readmeFilename":"readme.markdown","_id":"optimist@0.4.0","dist":{"shasum":"cb8ec37f2fe3aa9864cb67a275250e7e19620a25","tarball":"http://localhost:1337/optimist/-/optimist-0.4.0.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.5.0":{"name":"optimist","version":"0.5.0","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","dependencies":{"wordwrap":"~0.0.2"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.4.0"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"readme":"optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\nshort numbers\n-------------\n\nShort numeric `head -n5` style argument work too:\n\n $ node reflect.js -n123 -m456\n { '3': true,\n '6': true,\n _: [],\n '$0': 'node ./reflect.js',\n n: 123,\n m: 456 }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n","readmeFilename":"readme.markdown","_id":"optimist@0.5.0","dist":{"shasum":"d9c60da4c34811418d183390623f8046f134a2d4","tarball":"http://localhost:1337/optimist/-/optimist-0.5.0.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.5.1":{"name":"optimist","version":"0.5.1","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","dependencies":{"wordwrap":"~0.0.2"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.4.0"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"readme":"optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\nshort numbers\n-------------\n\nShort numeric `head -n5` style argument work too:\n\n $ node reflect.js -n123 -m456\n { '3': true,\n '6': true,\n _: [],\n '$0': 'node ./reflect.js',\n n: 123,\n m: 456 }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n","readmeFilename":"readme.markdown","_id":"optimist@0.5.1","dist":{"shasum":"9f6a34014ca8344a60a5d39734436f49d2bbe4f5","tarball":"http://localhost:1337/optimist/-/optimist-0.5.1.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.5.2":{"name":"optimist","version":"0.5.2","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","dependencies":{"wordwrap":"~0.0.2"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.4.0"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"readme":"optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\nshort numbers\n-------------\n\nShort numeric `head -n5` style argument work too:\n\n $ node reflect.js -n123 -m456\n { '3': true,\n '6': true,\n _: [],\n '$0': 'node ./reflect.js',\n n: 123,\n m: 456 }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n","readmeFilename":"readme.markdown","_id":"optimist@0.5.2","dist":{"shasum":"85c8c1454b3315e4a78947e857b1df033450bfbc","tarball":"http://localhost:1337/optimist/-/optimist-0.5.2.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}},"0.6.0":{"name":"optimist","version":"0.6.0","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","dependencies":{"wordwrap":"~0.0.2","minimist":"~0.0.1"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.4.0"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"readme":"optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\nshort numbers\n-------------\n\nShort numeric `head -n5` style argument work too:\n\n $ node reflect.js -n123 -m456\n { '3': true,\n '6': true,\n _: [],\n '$0': 'node ./reflect.js',\n n: 123,\n m: 456 }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n","readmeFilename":"readme.markdown","bugs":{"url":"https://github.com/substack/node-optimist/issues"},"_id":"optimist@0.6.0","dist":{"shasum":"69424826f3405f79f142e6fc3d9ae58d4dbb9200","tarball":"http://localhost:1337/optimist/-/optimist-0.6.0.tgz"},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}}},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"repository":{"type":"git","url":"http://github.com/substack/node-optimist.git"},"description":"Light-weight option parsing with an argv hash. No optstrings attached.","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"time":{"0.0.1":"2010-12-21T14:33:53.354Z","0.0.2":"2010-12-21T14:33:53.354Z","0.0.3":"2010-12-21T14:33:53.354Z","0.0.4":"2010-12-21T14:33:53.354Z","0.0.5":"2010-12-21T14:33:53.354Z","0.0.6":"2010-12-21T14:33:53.354Z","0.0.7":"2010-12-21T14:33:53.354Z","0.1.0":"2010-12-21T14:33:53.354Z","0.1.1":"2010-12-21T14:33:53.354Z","0.1.2":"2010-12-21T14:33:53.354Z","0.1.3":"2010-12-21T14:33:53.354Z","0.1.4":"2011-01-30T07:04:28.963Z","0.1.5":"2011-02-01T08:01:38.160Z","0.1.6":"2011-02-13T23:35:31.427Z","0.1.7":"2011-03-28T05:44:30.304Z","0.1.8":"2011-03-28T21:03:46.234Z","0.1.9":"2011-04-14T03:33:37.811Z","0.2.0":"2011-05-08T03:32:40.650Z","0.2.1":"2011-05-16T07:14:37.232Z","0.2.2":"2011-05-16T09:20:48.490Z","0.2.3":"2011-05-16T19:03:41.732Z","0.2.4":"2011-06-13T04:00:46.046Z","0.2.5":"2011-06-25T22:24:50.361Z","0.2.6":"2011-07-14T21:41:44.257Z","0.2.7":"2011-10-20T02:25:41.335Z","0.2.8":"2011-10-20T03:47:03.659Z","0.3.0":"2011-12-09T08:22:35.261Z","0.3.1":"2011-12-31T08:45:18.568Z","0.3.3":"2012-04-30T06:46:32.091Z","0.3.4":"2012-04-30T06:59:33.018Z","0.3.5":"2012-10-10T11:12:31.230Z","0.3.6":"2013-04-04T04:06:39.393Z","0.3.7":"2013-04-04T04:09:40.361Z","0.4.0":"2013-04-13T19:05:38.560Z","0.5.0":"2013-05-18T22:00:22.299Z","0.5.1":"2013-05-30T07:17:29.830Z","0.5.2":"2013-05-31T03:46:50.271Z","0.6.0":"2013-06-25T08:49:19.511Z"},"users":{"avianflu":true,"mvolkmann":true,"naholyr":true,"vtsvang":true,"linus":true,"pvorb":true,"matthiasg":true,"dshaw":true,"thlorenz":true,"MattiSG":true,"fgribreau":true,"clux":true,"hughsk":true,"pid":true,"gillesruppert":true,"jswartwood":true,"tokuhirom":true,"kennethjor":true,"chevex":true,"tivac":true,"konklone":true,"hij1nx":true,"luk":true,"booyaa":true,"megadrive":true,"nrn":true,"kastor":true,"joshthegeek":true,"charmander":true,"zaphod1984":true,"ljharb":true,"everywhere.js":true,"fiveisprime":true,"florianwendelborn":true,"lexa":true,"nak2k":true,"spekkionu":true,"conradz":true,"leesei":true,"pana":true},"_attachments":{"optimist-0.6.0.tgz":{"content_type":"application/octet-stream","revpos":132,"digest":"md5-I0ZgAx6amh/JRlF/tCQh0A==","length":12142,"stub":true},"optimist-0.5.2.tgz":{"content_type":"application/octet-stream","revpos":129,"digest":"md5-meoV8NdbCXOtbQcUb7qjUA==","length":13233,"stub":true},"optimist-0.5.1.tgz":{"content_type":"application/octet-stream","revpos":127,"digest":"md5-gE3NkJCbcKOoRQ1uMWn2nw==","length":13087,"stub":true},"optimist-0.5.0.tgz":{"content_type":"application/octet-stream","revpos":124,"digest":"md5-uQDzmYafvd/HvTJ3mUyLgw==","length":12984,"stub":true},"optimist-0.4.0.tgz":{"content_type":"application/octet-stream","revpos":121,"digest":"md5-Qka6k4uV5oWTww24Qt5P1Q==","length":12765,"stub":true},"optimist-0.3.7.tgz":{"content_type":"application/octet-stream","revpos":118,"digest":"md5-p4myQcSLDtU5PdiW3z137w==","length":12549,"stub":true},"optimist-0.3.6.tgz":{"content_type":"application/octet-stream","revpos":116,"digest":"md5-DueY6+6h+OTzM7P4iu5l9Q==","length":12598,"stub":true},"optimist-0.3.5.tgz":{"content_type":"application/octet-stream","revpos":101,"digest":"md5-5oFLAuVTvnhrV97GjqYmCA==","length":12463,"stub":true},"optimist-0.3.4.tgz":{"content_type":"application/octet-stream","revpos":88,"digest":"md5-kYOcoyFYV6OViKIqfMCxTA==","length":12538,"stub":true},"optimist-0.3.3.tgz":{"content_type":"application/octet-stream","revpos":83,"digest":"md5-Eq2+Ja5uGwC3gWW6Z0Z1gA==","length":12495,"stub":true},"optimist-0.3.1.tgz":{"content_type":"application/octet-stream","revpos":79,"digest":"md5-eFa9A+zxtlqYkE1zVnuUmA==","length":11800,"stub":true},"optimist-0.3.0.tgz":{"content_type":"application/octet-stream","revpos":75,"digest":"md5-ixo6YIBhoVFxqPN+KKyeuw==","length":11788,"stub":true},"optimist-0.2.8.tgz":{"content_type":"application/octet-stream","revpos":70,"digest":"md5-4LAF42qgFkJWg+BctkReNg==","length":11471,"stub":true},"optimist-0.2.7.tgz":{"content_type":"application/octet-stream","revpos":68,"digest":"md5-9GdCLdqH8jznVkbyjf/H8Q==","length":11337,"stub":true},"optimist-0.2.6.tgz":{"content_type":"application/octet-stream","revpos":64,"digest":"md5-t0BAQ1OFo1Sib+eStMAJxQ==","length":11308,"stub":true},"optimist-0.2.5.tgz":{"content_type":"application/octet-stream","revpos":62,"digest":"md5-QJVI872hENNvWGP+Ry+tLg==","length":11304,"stub":true},"optimist-0.2.4.tgz":{"content_type":"application/octet-stream","revpos":60,"digest":"md5-V4yDhXE3ifUaQzmOsLTgEg==","length":11161,"stub":true},"optimist-0.2.3.tgz":{"content_type":"application/octet-stream","revpos":58,"digest":"md5-NRVX0hVlcRjZdC92K6YIIw==","length":9713,"stub":true},"optimist-0.2.2.tgz":{"content_type":"application/octet-stream","revpos":56,"digest":"md5-fKrLoZrWtXw+5ITaXcXgBw==","length":9595,"stub":true},"optimist-0.2.1.tgz":{"content_type":"application/octet-stream","revpos":54,"digest":"md5-FpyRtmufNwNV17Lj3bE0VA==","length":9446,"stub":true},"optimist-0.2.0.tgz":{"content_type":"application/octet-stream","revpos":52,"digest":"md5-y8zpVGItFFYgNe3iNal2Jw==","length":8982,"stub":true},"optimist-0.0.3.tgz":{"content_type":"application/octet-stream","revpos":48,"digest":"md5-Gu0oCNCbD1Uki/2RcH2dEA==","length":3895,"stub":true},"optimist-0.1.9.tgz":{"content_type":"application/octet-stream","revpos":42,"digest":"md5-pEYFZ2Ayic4OVE+XnBgiFA==","length":7870,"stub":true},"optimist-0.1.8.tgz":{"content_type":"application/octet-stream","revpos":40,"digest":"md5-KSQ/QYT218dKyFforjobWw==","length":7740,"stub":true},"optimist-0.1.7.tgz":{"content_type":"application/octet-stream","revpos":38,"digest":"md5-kuMOFCqPA+3fZe5wAoJkvQ==","length":7650,"stub":true},"optimist-0.1.6.tgz":{"content_type":"application/octet-stream","revpos":36,"digest":"md5-VQGuFlwNqfW9dluVGAPung==","length":7547,"stub":true},"optimist-0.1.5.tgz":{"content_type":"application/octet-stream","revpos":34,"digest":"md5-s/q19VNxIBEt8kJMKIgLgQ==","length":7054,"stub":true},"optimist-0.1.4.tgz":{"content_type":"application/octet-stream","revpos":28,"digest":"md5-qo9j4yQZZ2bVphRNdykI/Q==","length":6431,"stub":true},"optimist-0.1.3.tgz":{"content_type":"application/octet-stream","revpos":26,"digest":"md5-gjKi5e08v+EsS4pgDok9cg==","length":6612,"stub":true},"optimist-0.1.2.tgz":{"content_type":"application/octet-stream","revpos":24,"digest":"md5-scvhz0+WQU6CQ9GOr4upWw==","length":6575,"stub":true},"optimist-0.1.1.tgz":{"content_type":"application/octet-stream","revpos":22,"digest":"md5-eRK/UJ1K8f2KzTRdzoS/Qw==","length":6179,"stub":true},"optimist-0.1.0.tgz":{"content_type":"application/octet-stream","revpos":20,"digest":"md5-pa99w4YezJSc5rwUaM8dvQ==","length":5809,"stub":true},"optimist-0.0.7.tgz":{"content_type":"application/octet-stream","revpos":18,"digest":"md5-pRDoQx+Kl+XL9l/O1NRV2A==","length":5470,"stub":true},"optimist-0.0.6.tgz":{"content_type":"application/octet-stream","revpos":13,"digest":"md5-prbC00jgIbKx0pRJk3H3Yw==","length":5470,"stub":true},"optimist-0.0.5.tgz":{"content_type":"application/octet-stream","revpos":11,"digest":"md5-zMnStZ7TmRET2xBnt2V4Qg==","length":5342,"stub":true},"optimist-0.0.4.tgz":{"content_type":"application/octet-stream","revpos":9,"digest":"md5-y7Y+/2R3qu0qa+5I0mJDRA==","length":5092,"stub":true},"optimist-0.0.2.tgz":{"content_type":"application/octet-stream","revpos":5,"digest":"md5-qhp0ch0rzo1O4GTFO0AOtg==","length":3128,"stub":true},"optimist-0.0.1.tgz":{"content_type":"application/octet-stream","revpos":3,"digest":"md5-cL87g7wfaP2HMV5LK9Gh+A==","length":3130,"stub":true}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/f3/e8/2d6a0b75ad5cebd09177d93f572dbd8b877ee9f1505b2e84e03810fa0412e4904060be7d2a4df4221b1bb92884db886826bf8cd26634667a2d103a999438 b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/f3/e8/2d6a0b75ad5cebd09177d93f572dbd8b877ee9f1505b2e84e03810fa0412e4904060be7d2a4df4221b1bb92884db886826bf8cd26634667a2d103a999438 new file mode 100644 index 00000000000000..9b3718b2d05897 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/f3/e8/2d6a0b75ad5cebd09177d93f572dbd8b877ee9f1505b2e84e03810fa0412e4904060be7d2a4df4221b1bb92884db886826bf8cd26634667a2d103a999438 @@ -0,0 +1 @@ +{"objects":[{"id":"foo"},{"id":"bar"},{"id":"baz"}]} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/f5/91/da7ce6e308dcaa672b8625ca0491cafed6726ceda16ffbcdd3f7661e5eb5b1aae2bd99960acb3a2fcc61a14edff79dd7bd610b27c57fea8aff535dbc519f b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/f5/91/da7ce6e308dcaa672b8625ca0491cafed6726ceda16ffbcdd3f7661e5eb5b1aae2bd99960acb3a2fcc61a14edff79dd7bd610b27c57fea8aff535dbc519f new file mode 100644 index 00000000000000..cd9bffe29a343b --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/f5/91/da7ce6e308dcaa672b8625ca0491cafed6726ceda16ffbcdd3f7661e5eb5b1aae2bd99960acb3a2fcc61a14edff79dd7bd610b27c57fea8aff535dbc519f @@ -0,0 +1 @@ +{"_id":"@scope/cond","_rev":"19-d458a706de1740662cd7728d7d7ddf07","name":"@scope/cond","time":{"modified":"2015-02-13T07:33:58.120Z","created":"2014-03-16T20:52:52.236Z","0.0.0":"2014-03-16T20:52:52.236Z","0.0.1":"2014-03-16T21:12:33.393Z","0.0.2":"2014-03-16T21:15:25.430Z"},"versions":{"0.0.0":{},"0.0.1":{},"0.0.2":{}},"dist-tags":{"latest":"0.0.2"},"description":"Restartable error handling system","license":"CC0"} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/f5/bd/a6b78fcf204b1ec0e6069045b44f6669e9aab878bfc891b946e4cecb843f4e87e428b6771ae7b4a2ce8f303e97746763b0642faf89a9b00425297dc78d6a b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/f5/bd/a6b78fcf204b1ec0e6069045b44f6669e9aab878bfc891b946e4cecb843f4e87e428b6771ae7b4a2ce8f303e97746763b0642faf89a9b00425297dc78d6a new file mode 100644 index 00000000000000..075750f8680f0d --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/f5/bd/a6b78fcf204b1ec0e6069045b44f6669e9aab878bfc891b946e4cecb843f4e87e428b6771ae7b4a2ce8f303e97746763b0642faf89a9b00425297dc78d6a @@ -0,0 +1 @@ +{"latest":"1.0.0","a":"0.0.1","b":"0.5.0"} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/content-v2/sha512/fd/37/65c30143da9bd36758e4f19cce0984aac9f6a6a90a2a1ea79ab8acec84841b7b2af4b20e52051d585ac12bef1930d35234d6556319315d5656391257472d b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/fd/37/65c30143da9bd36758e4f19cce0984aac9f6a6a90a2a1ea79ab8acec84841b7b2af4b20e52051d585ac12bef1930d35234d6556319315d5656391257472d new file mode 100644 index 00000000000000..fb33c40d3795ba --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/content-v2/sha512/fd/37/65c30143da9bd36758e4f19cce0984aac9f6a6a90a2a1ea79ab8acec84841b7b2af4b20e52051d585ac12bef1930d35234d6556319315d5656391257472d @@ -0,0 +1 @@ +{"username":"admin","username2":"foo"} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/06/90/5e61e746e7d543d4bffbfeead5822d45a4e7089a414fbe6f1be007f6cd48 b/deps/npm/test/npm_cache/_cacache/index-v5/06/90/5e61e746e7d543d4bffbfeead5822d45a4e7089a414fbe6f1be007f6cd48 new file mode 100644 index 00000000000000..0fb889198463c6 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/06/90/5e61e746e7d543d4bffbfeead5822d45a4e7089a414fbe6f1be007f6cd48 @@ -0,0 +1,3 @@ + +f79f1f96542accdfe7c66e2adeebe6230b324be4 {"key":"pacote:tag-manifest:http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz:sha1-KncwfhCL+1cQfEwzSrte9Tldxoo=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833049346,"size":1,"metadata":{"id":"test-repo-url-ssh@0.0.1","manifest":{"name":"test-repo-url-ssh","version":"0.0.1","description":"Test repo with non-github ssh repository url","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/evanlucas/test-repo-url-ssh.git"},"author":{"name":"Evan Lucas","email":"evanlucas@me.com"},"license":"ISC","_id":"test-repo-url-ssh@0.0.1","dist":{"shasum":"2a77307e108bfb57107c4c334abb5ef5395dc68a","tarball":"http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"evanlucas","email":"evanlucas@me.com"},"maintainers":[{"name":"evanlucas","email":"evanlucas@me.com"}],"directories":{},"_integrity":"sha1-KncwfhCL+1cQfEwzSrte9Tldxoo=","_shasum":"2a77307e108bfb57107c4c334abb5ef5395dc68a","_resolved":"http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_shrinkwrap":null,"bin":null,"bugs":{"url":"https://gitlab.com/evanlucas/test-repo-url-ssh/issues"},"homepage":"https://gitlab.com/evanlucas/test-repo-url-ssh#readme"},"type":"finalized-manifest"}} +033be10c654046737e09e90415c78249d86bb129 {"key":"pacote:tag-manifest:http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz:sha1-KncwfhCL+1cQfEwzSrte9Tldxoo=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833266232,"size":1,"metadata":{"id":"test-repo-url-ssh@0.0.1","manifest":{"name":"test-repo-url-ssh","version":"0.0.1","description":"Test repo with non-github ssh repository url","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/evanlucas/test-repo-url-ssh.git"},"author":{"name":"Evan Lucas","email":"evanlucas@me.com"},"license":"ISC","_id":"test-repo-url-ssh@0.0.1","dist":{"shasum":"2a77307e108bfb57107c4c334abb5ef5395dc68a","tarball":"http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"evanlucas","email":"evanlucas@me.com"},"maintainers":[{"name":"evanlucas","email":"evanlucas@me.com"}],"directories":{},"_integrity":"sha1-KncwfhCL+1cQfEwzSrte9Tldxoo=","_shasum":"2a77307e108bfb57107c4c334abb5ef5395dc68a","_resolved":"http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_shrinkwrap":null,"bin":null,"bugs":{"url":"https://gitlab.com/evanlucas/test-repo-url-ssh/issues"},"homepage":"https://gitlab.com/evanlucas/test-repo-url-ssh#readme"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/0b/5a/62ce62a24edca98b341182e328ec6d451a459b384cac489f57771ed7e74a b/deps/npm/test/npm_cache/_cacache/index-v5/0b/5a/62ce62a24edca98b341182e328ec6d451a459b384cac489f57771ed7e74a new file mode 100644 index 00000000000000..2225a6556e0f7b --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/0b/5a/62ce62a24edca98b341182e328ec6d451a459b384cac489f57771ed7e74a @@ -0,0 +1,2 @@ + +d58db47c718e3d30c4c86d7b5ea9fd867dbdbc68 {"key":"pacote:packed-dir:git://localhost:1234/child.git#aef7bbd091eeef812d6364c2e8250b1e4b39a5ba","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833000938,"size":143} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/0e/d4/8aa7d55331a48f04b5218bb50c1c639e7a3600893f62fde6191d2563e6df b/deps/npm/test/npm_cache/_cacache/index-v5/0e/d4/8aa7d55331a48f04b5218bb50c1c639e7a3600893f62fde6191d2563e6df new file mode 100644 index 00000000000000..ae572112072f70 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/0e/d4/8aa7d55331a48f04b5218bb50c1c639e7a3600893f62fde6191d2563e6df @@ -0,0 +1,5 @@ + +74dc30109273ec856599bc20e75e4a7163722fa7 {"key":"pacote:packed-dir:git://localhost:1234/child.git#8da4c77141205e56a0a30c4a95a13aa221537ea9","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833118351,"size":143} +75e68abddffebaf55df7bb36f662ab7faa04b943 {"key":"pacote:packed-dir:git://localhost:1234/child.git#8da4c77141205e56a0a30c4a95a13aa221537ea9","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833118616,"size":143} +49f7029d1f223b3bd3eecb19428ace3310fd9f93 {"key":"pacote:packed-dir:git://localhost:1234/child.git#8da4c77141205e56a0a30c4a95a13aa221537ea9","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833119692,"size":143} +992f03d4d29fd112cef6fd6afb6af20ad7acfe0b {"key":"pacote:packed-dir:git://localhost:1234/child.git#8da4c77141205e56a0a30c4a95a13aa221537ea9","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833119999,"size":143} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/13/b5/0178cbb8a4a3e25b821dbdd82db862373a457bbab3fee9c0e305b4f83b37 b/deps/npm/test/npm_cache/_cacache/index-v5/13/b5/0178cbb8a4a3e25b821dbdd82db862373a457bbab3fee9c0e305b4f83b37 new file mode 100644 index 00000000000000..b0c1a79bb55ae7 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/13/b5/0178cbb8a4a3e25b821dbdd82db862373a457bbab3fee9c0e305b4f83b37 @@ -0,0 +1,2 @@ + +95c0e26dc337f0530229453e6eae5e768fc188d3 {"key":"make-fetch-happen:request-cache:http://localhost:1337/clean/-/clean-2.1.6.tgz","integrity":"sha1-QcgLK29UMsYM3bgZMqtWVjtET1I=","time":1547833073369,"size":6288,"metadata":{"url":"http://localhost:1337/clean/-/clean-2.1.6.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:clean@http://localhost:1337/clean/-/clean-2.1.6.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/14/7e/33640d7ecca75f94fce8a3c3b46e111bc08921520f7b2cce032bf8862107 b/deps/npm/test/npm_cache/_cacache/index-v5/14/7e/33640d7ecca75f94fce8a3c3b46e111bc08921520f7b2cce032bf8862107 new file mode 100644 index 00000000000000..7546dee83ef37d --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/14/7e/33640d7ecca75f94fce8a3c3b46e111bc08921520f7b2cce032bf8862107 @@ -0,0 +1,3 @@ + +dda70cf10fd1b63cf6d5d008b56f3a199fea0741 {"key":"make-fetch-happen:request-cache:http://localhost:1337/underscore/-/underscore-1.5.1.tgz","integrity":"sha1-0r3oF9F2/63olKtxRY5oKhS4bck=","time":1547833045352,"size":22746,"metadata":{"url":"http://localhost:1337/underscore/-/underscore-1.5.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["4fa97a596a50fc65"],"referer":["bugs underscore"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:underscore@http://localhost:1337/underscore/-/underscore-1.5.1.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:25 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +920b6c736f7d6cfb695de62fc103db9fb5522b33 {"key":"make-fetch-happen:request-cache:http://localhost:1337/underscore/-/underscore-1.5.1.tgz","integrity":"sha1-0r3oF9F2/63olKtxRY5oKhS4bck=","time":1547833262764,"size":22746,"metadata":{"url":"http://localhost:1337/underscore/-/underscore-1.5.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["20080b2063fb2e2a"],"referer":["bugs underscore"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:underscore@http://localhost:1337/underscore/-/underscore-1.5.1.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:02 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/15/bf/92c5cbc5f2b5bb51971d6f7d04cf0b3871bdde88a368eed466901917d636 b/deps/npm/test/npm_cache/_cacache/index-v5/15/bf/92c5cbc5f2b5bb51971d6f7d04cf0b3871bdde88a368eed466901917d636 new file mode 100644 index 00000000000000..a1c0e1e2b37a03 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/15/bf/92c5cbc5f2b5bb51971d6f7d04cf0b3871bdde88a368eed466901917d636 @@ -0,0 +1,3 @@ + +994ba6103d857ed6f02b897b43c714147a25c7d1 {"key":"make-fetch-happen:request-cache:http://localhost:1337/async/-/async-0.2.10.tgz","integrity":"sha1-trvgsGdLnXGXCMo43owjfLUmw9E=","time":1547833073451,"size":15772,"metadata":{"url":"http://localhost:1337/async/-/async-0.2.10.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:async@http://localhost:1337/async/-/async-0.2.10.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +cf44917b107eb08c84c9345d5b79d2bed349755f {"key":"make-fetch-happen:request-cache:http://localhost:1337/async/-/async-0.2.10.tgz","integrity":"sha1-trvgsGdLnXGXCMo43owjfLUmw9E=","time":1547833093330,"size":15772,"metadata":{"url":"http://localhost:1337/async/-/async-0.2.10.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcd144259ba74815"],"referer":["install ."],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:async@http://localhost:1337/async/-/async-0.2.10.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/18/1f/b15fb9d4fbd32e771ad6afadda07bc566c24b4b589c6bbc5c3e996c7a3db b/deps/npm/test/npm_cache/_cacache/index-v5/18/1f/b15fb9d4fbd32e771ad6afadda07bc566c24b4b589c6bbc5c3e996c7a3db new file mode 100644 index 00000000000000..af0dae50439ad2 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/18/1f/b15fb9d4fbd32e771ad6afadda07bc566c24b4b589c6bbc5c3e996c7a3db @@ -0,0 +1,3 @@ + +5872147226813473de0d5f3c9bf716a16e27a39e {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:npm_oauth_auth_dummy_user","integrity":null,"time":1547833016269} +e580567b82439b0fa590acaf46117d7ea73de06c {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:npm_oauth_auth_dummy_user","integrity":null,"time":1547833235770} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/19/db/491ce5fd3b8f5521f62a3d208c8b91325f3f8fe347347649e2e7cb8c10b2 b/deps/npm/test/npm_cache/_cacache/index-v5/19/db/491ce5fd3b8f5521f62a3d208c8b91325f3f8fe347347649e2e7cb8c10b2 new file mode 100644 index 00000000000000..9bbc8300f630fe --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/19/db/491ce5fd3b8f5521f62a3d208c8b91325f3f8fe347347649e2e7cb8c10b2 @@ -0,0 +1,3 @@ + +9d3fbd26021863fa857a7b84ed1768b2b94f0366 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/npm/v1/hooks/hook","integrity":null,"time":1547833360547} +a85a425bcdeb7c2ccf977d545f13cdd7f3cef331 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/npm/v1/hooks/hook","integrity":null,"time":1547833361187} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/1c/05/419d1e706cbe2c4b49cddcc72c47c6fbcde4ff2cdbb76da7c1defd09d6d6 b/deps/npm/test/npm_cache/_cacache/index-v5/1c/05/419d1e706cbe2c4b49cddcc72c47c6fbcde4ff2cdbb76da7c1defd09d6d6 new file mode 100644 index 00000000000000..747abfcf598669 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/1c/05/419d1e706cbe2c4b49cddcc72c47c6fbcde4ff2cdbb76da7c1defd09d6d6 @@ -0,0 +1,7 @@ + +eab0846401a097a355ae6b40613e32a9d5bdd840 {"key":"make-fetch-happen:request-cache:http://localhost:1337/wordwrap","integrity":"sha512-UjqQJTil69POEpCH8mK/ChZjwv22pjas12YOOG+/L40JeUbNoHUYu9m5/Jxb5yXormBB5iyenoHeVYXpADKLCQ==","time":1547833073399,"size":2532,"metadata":{"url":"http://localhost:1337/wordwrap","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:wordwrap"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +dc32e815d94277f6d7fdc1b0ccc2988d624aec46 {"key":"make-fetch-happen:request-cache:http://localhost:1337/wordwrap","integrity":"sha512-UjqQJTil69POEpCH8mK/ChZjwv22pjas12YOOG+/L40JeUbNoHUYu9m5/Jxb5yXormBB5iyenoHeVYXpADKLCQ==","time":1547833079826,"size":2532,"metadata":{"url":"http://localhost:1337/wordwrap","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["d19ab2d4de48cace"],"referer":["install optimist"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:wordwrap"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:59 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +6e816008ddb2f41c3f1c121ffece8dbee86ef0b7 {"key":"make-fetch-happen:request-cache:http://localhost:1337/wordwrap","integrity":"sha512-UjqQJTil69POEpCH8mK/ChZjwv22pjas12YOOG+/L40JeUbNoHUYu9m5/Jxb5yXormBB5iyenoHeVYXpADKLCQ==","time":1547833093372,"size":2532,"metadata":{"url":"http://localhost:1337/wordwrap","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcd144259ba74815"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:wordwrap"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +d1063fca9f6ffeb5fc3cbb9f09d0324106467714 {"key":"make-fetch-happen:request-cache:http://localhost:1337/wordwrap","integrity":"sha512-UjqQJTil69POEpCH8mK/ChZjwv22pjas12YOOG+/L40JeUbNoHUYu9m5/Jxb5yXormBB5iyenoHeVYXpADKLCQ==","time":1547833294159,"size":2532,"metadata":{"url":"http://localhost:1337/wordwrap","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["0a92a1a2bc33028a"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:wordwrap"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:34 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +a73d8c131fb046e62332bca244be5323d0c1b54e {"key":"make-fetch-happen:request-cache:http://localhost:1337/wordwrap","integrity":"sha512-UjqQJTil69POEpCH8mK/ChZjwv22pjas12YOOG+/L40JeUbNoHUYu9m5/Jxb5yXormBB5iyenoHeVYXpADKLCQ==","time":1547833301219,"size":2532,"metadata":{"url":"http://localhost:1337/wordwrap","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["f4c81daeaa866c45"],"referer":["install optimist"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:wordwrap"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:41 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +93cb442b9ba3e5e64ff7047b96f76559172cc302 {"key":"make-fetch-happen:request-cache:http://localhost:1337/wordwrap","integrity":"sha512-UjqQJTil69POEpCH8mK/ChZjwv22pjas12YOOG+/L40JeUbNoHUYu9m5/Jxb5yXormBB5iyenoHeVYXpADKLCQ==","time":1547833314454,"size":2532,"metadata":{"url":"http://localhost:1337/wordwrap","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["ce2c0b941f6a62b8"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:wordwrap"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:54 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/1d/95/be47aca6f275eae3f3b2d5c35a85f51736f1403d8fd3790ab0e354238f68 b/deps/npm/test/npm_cache/_cacache/index-v5/1d/95/be47aca6f275eae3f3b2d5c35a85f51736f1403d8fd3790ab0e354238f68 new file mode 100644 index 00000000000000..de0902ed8d0c16 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/1d/95/be47aca6f275eae3f3b2d5c35a85f51736f1403d8fd3790ab0e354238f68 @@ -0,0 +1,5 @@ + +09c3f181c0854f46273f41e916aedf906823cc22 {"key":"make-fetch-happen:request-cache:http://localhost:1338/-/user/org.couchdb.user:u","integrity":null,"time":1547833010390} +90ced6633bb45047bdb8b1aae92c7cf9e5864c96 {"key":"make-fetch-happen:request-cache:http://localhost:1338/-/user/org.couchdb.user:u","integrity":null,"time":1547833011577} +66dd2102e034752ab1aa68d91b0c66ba1894363c {"key":"make-fetch-happen:request-cache:http://localhost:1338/-/user/org.couchdb.user:u","integrity":null,"time":1547833230546} +318a7ae8e8c3e1f64f4396ee1c893f80b9f9110e {"key":"make-fetch-happen:request-cache:http://localhost:1338/-/user/org.couchdb.user:u","integrity":null,"time":1547833231536} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/1e/c1/c1f0fea37e015610f77e0486d0c90745de8da2029e042c59f6197901f5fb b/deps/npm/test/npm_cache/_cacache/index-v5/1e/c1/c1f0fea37e015610f77e0486d0c90745de8da2029e042c59f6197901f5fb new file mode 100644 index 00000000000000..8659041e1210e3 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/1e/c1/c1f0fea37e015610f77e0486d0c90745de8da2029e042c59f6197901f5fb @@ -0,0 +1,13 @@ + +d51b8401bfd296821844053e4d221c3e963f6a5c {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":null,"time":1547833009024} +b5a55946cc3765a670773a1ac1c61020efdfcc7c {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":null,"time":1547833012658} +296fdd1a10001bb18edea110f74ef314d16624dc {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":null,"time":1547833013383} +abb2b62b4b9b34c703d06944e5abfb2760c0189f {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":null,"time":1547833014054} +2c41be84ad4581319a0b1c5ee2d27c9ef07d2a27 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":null,"time":1547833015086} +dc098e0a677206db298b56e879f3571da00247d7 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":"sha512-nbMJVEfJtT/oi78ZD7ajJMekKoS/UdPDRfyIze6gDwJhZ61zKbQjadeaZ4EnOKIyS3quQtT+6sSaK4lcV7SBaA==","time":1547833015108,"size":29,"metadata":{"url":"http://localhost:1337/-/user/org.couchdb.user:u?write=true","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["921f4dd388006bcd"],"referer":["adduser"],"authorization":["Basic dTp4"]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:55 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +18e85b94d32a66aa745c72800287b0737e64da56 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":null,"time":1547833229649} +52b8b6265052d06cb1b11701990b1cc867599a2f {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":null,"time":1547833232612} +4fe8d89414166b89a370517f3770037b7529ea5d {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":null,"time":1547833233312} +0c1b13b3cb55c753d9b44b35ef490e514cc8f219 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":null,"time":1547833233899} +9772baed148b319af55ee66915c9e7a5baf26b02 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":null,"time":1547833234801} +00845d6e9ad719f069dedc8971ebb25f8b31f30f {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u","integrity":"sha512-nbMJVEfJtT/oi78ZD7ajJMekKoS/UdPDRfyIze6gDwJhZ61zKbQjadeaZ4EnOKIyS3quQtT+6sSaK4lcV7SBaA==","time":1547833234821,"size":29,"metadata":{"url":"http://localhost:1337/-/user/org.couchdb.user:u?write=true","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["f5d540ebb7caafdf"],"referer":["adduser"],"authorization":["Basic dTp4"]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:34 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/1f/4c/7c6c652ccd8d9b32c0b4ef03e8a114c823d405df62054797ae8e510155d2 b/deps/npm/test/npm_cache/_cacache/index-v5/1f/4c/7c6c652ccd8d9b32c0b4ef03e8a114c823d405df62054797ae8e510155d2 new file mode 100644 index 00000000000000..1b22356a3e8028 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/1f/4c/7c6c652ccd8d9b32c0b4ef03e8a114c823d405df62054797ae8e510155d2 @@ -0,0 +1,5 @@ + +bec8fa8e08f78acec14ab9c9db47d7c10afcea82 {"key":"make-fetch-happen:request-cache:http://localhost:1337/checker","integrity":"sha512-1EXtcuZe0Ln+xaakF5TKrdqVG6eaBUFkjiWcgCGz/JZIfSyu34aawUK0sPMZmMQ28XHZipoXQOOsjuu1wRA8Uw==","time":1547833073399,"size":29837,"metadata":{"url":"http://localhost:1337/checker","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:checker"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +dd598597f8e43cf35bcd5cdd30fd47e607caa590 {"key":"make-fetch-happen:request-cache:http://localhost:1337/checker","integrity":"sha512-1EXtcuZe0Ln+xaakF5TKrdqVG6eaBUFkjiWcgCGz/JZIfSyu34aawUK0sPMZmMQ28XHZipoXQOOsjuu1wRA8Uw==","time":1547833093286,"size":29837,"metadata":{"url":"http://localhost:1337/checker","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcd144259ba74815"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:checker"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +d50082ec956f0b3a8fd90ea25c490bcf2e11deb7 {"key":"make-fetch-happen:request-cache:http://localhost:1337/checker","integrity":"sha512-1EXtcuZe0Ln+xaakF5TKrdqVG6eaBUFkjiWcgCGz/JZIfSyu34aawUK0sPMZmMQ28XHZipoXQOOsjuu1wRA8Uw==","time":1547833294158,"size":29837,"metadata":{"url":"http://localhost:1337/checker","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["0a92a1a2bc33028a"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:checker"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:34 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +12823d2665d82f3e3319f998b9e6cc5e849d90fa {"key":"make-fetch-happen:request-cache:http://localhost:1337/checker","integrity":"sha512-1EXtcuZe0Ln+xaakF5TKrdqVG6eaBUFkjiWcgCGz/JZIfSyu34aawUK0sPMZmMQ28XHZipoXQOOsjuu1wRA8Uw==","time":1547833314395,"size":29837,"metadata":{"url":"http://localhost:1337/checker","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["ce2c0b941f6a62b8"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:checker"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:54 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/21/69/cf895689c136d0f667f13d167389f0bdff113e4a85c2d0a34e8420953fb0 b/deps/npm/test/npm_cache/_cacache/index-v5/21/69/cf895689c136d0f667f13d167389f0bdff113e4a85c2d0a34e8420953fb0 new file mode 100644 index 00000000000000..ee51d124d2d660 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/21/69/cf895689c136d0f667f13d167389f0bdff113e4a85c2d0a34e8420953fb0 @@ -0,0 +1,2 @@ + +bcf2512c5444034125be184da64a4bc8f0c469ff {"key":"pacote:version-manifest:http://localhost:1337/minimist/-/minimist-0.0.5.tgz:sha1-16oye87PUY+RBqxrjwA/o7zqhWY=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833093354,"size":1,"metadata":{"id":"minimist@0.0.5","manifest":{"name":"minimist","version":"0.0.5","dependencies":{},"optionalDependencies":{},"devDependencies":{"tape":"~1.0.4","tap":"~0.4.0"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/minimist/-/minimist-0.0.5.tgz","_integrity":"sha1-16oye87PUY+RBqxrjwA/o7zqhWY=","_shasum":"d7aa327bcecf518f9106ac6b8f003fa3bcea8566","_shrinkwrap":null,"bin":null,"_id":"minimist@0.0.5"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/21/90/97d7c2a8081808dcd3d6fc97011bebe11fc8e308eaff2d4224c21477d1d5 b/deps/npm/test/npm_cache/_cacache/index-v5/21/90/97d7c2a8081808dcd3d6fc97011bebe11fc8e308eaff2d4224c21477d1d5 new file mode 100644 index 00000000000000..2e8cbde1cf80c7 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/21/90/97d7c2a8081808dcd3d6fc97011bebe11fc8e308eaff2d4224c21477d1d5 @@ -0,0 +1,2 @@ + +068551101b5c24f7117897d030b63fc0e7bb83ff {"key":"pacote:remote-manifest:https://github.com/substack/jsonify/tarball/master:sha512-LjZI+XaDCuq6BySzgqCaamc239THVZY6T0Yvlj+eyyEcIljwB2bcOqaGZPZtOgHLJ4myz2FK6yktvrSv4LIGzA==","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1544485146885,"size":1,"metadata":{"id":"jsonify@0.0.0","manifest":{"name":"jsonify","version":"0.0.0","dependencies":{},"optionalDependencies":{},"devDependencies":{"tap":"0.4.x","garbage":"0.0.x"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"https://github.com/substack/jsonify/tarball/master","_integrity":"sha512-LjZI+XaDCuq6BySzgqCaamc239THVZY6T0Yvlj+eyyEcIljwB2bcOqaGZPZtOgHLJ4myz2FK6yktvrSv4LIGzA==","_shasum":"ee568a2b1efaeb95bec4d9e59e5301fc63339866","_shrinkwrap":null,"bin":null,"_id":"jsonify@0.0.0"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/24/d3/c242b6ced69f0f27995a54c44c2c4ef172a4c3a0e7c91e0b8da7b9c418f8 b/deps/npm/test/npm_cache/_cacache/index-v5/24/d3/c242b6ced69f0f27995a54c44c2c4ef172a4c3a0e7c91e0b8da7b9c418f8 new file mode 100644 index 00000000000000..f28910aab1e348 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/24/d3/c242b6ced69f0f27995a54c44c2c4ef172a4c3a0e7c91e0b8da7b9c418f8 @@ -0,0 +1,3 @@ + +fe1b6996003d74fda794d1572ae3e1d9f91e3de0 {"key":"pacote:file-manifest:/Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/test-whoops-1.0.0.tgz:sha512-yaIGW7l0bldKVBrwYbeICUjTDkfbHcNWwxS9k0sBaYlNaW6DO9Y7bFPLlz0UuAZLWwQXfEAuNHdw3fu7x8kGyw==","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833112248,"size":1,"metadata":{"id":"@test/whoops@1.0.0","manifest":{"name":"@test/whoops","version":"1.0.0","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"/Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/test-whoops-1.0.0.tgz","_integrity":"sha512-yaIGW7l0bldKVBrwYbeICUjTDkfbHcNWwxS9k0sBaYlNaW6DO9Y7bFPLlz0UuAZLWwQXfEAuNHdw3fu7x8kGyw==","_shasum":"fdccb81c7f8261e7ad23f8160293393b19c117a9","_shrinkwrap":null,"bin":null,"_id":"@test/whoops@1.0.0"},"type":"finalized-manifest"}} +54837347024bdf594dbd5f7d2e0d9a9d26dfa5ec {"key":"pacote:file-manifest:/Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/test-whoops-1.0.0.tgz:sha512-yaIGW7l0bldKVBrwYbeICUjTDkfbHcNWwxS9k0sBaYlNaW6DO9Y7bFPLlz0UuAZLWwQXfEAuNHdw3fu7x8kGyw==","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833333874,"size":1,"metadata":{"id":"@test/whoops@1.0.0","manifest":{"name":"@test/whoops","version":"1.0.0","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"/Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/test-whoops-1.0.0.tgz","_integrity":"sha512-yaIGW7l0bldKVBrwYbeICUjTDkfbHcNWwxS9k0sBaYlNaW6DO9Y7bFPLlz0UuAZLWwQXfEAuNHdw3fu7x8kGyw==","_shasum":"fdccb81c7f8261e7ad23f8160293393b19c117a9","_shrinkwrap":null,"bin":null,"_id":"@test/whoops@1.0.0"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/29/89/d8ec4f471f8b2f7110ade5b17475bf87d30ec77a66a68a3481fbcb2299ca b/deps/npm/test/npm_cache/_cacache/index-v5/29/89/d8ec4f471f8b2f7110ade5b17475bf87d30ec77a66a68a3481fbcb2299ca new file mode 100644 index 00000000000000..5b8d6a8f1dfc08 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/29/89/d8ec4f471f8b2f7110ade5b17475bf87d30ec77a66a68a3481fbcb2299ca @@ -0,0 +1,3 @@ + +920d3ce83fe8dea3041db1157d39e26cd0490eef {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz","integrity":"sha1-Rcijm2JsH4P4uPUwB8L2DrmO7p0=","time":1547833047698,"size":372,"metadata":{"url":"http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["e139e9c1a8b0ded0"],"referer":["bugs test-repo-url-http"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:test-repo-url-http@http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:27 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +94ed1e8729c493f16b28a16b058bf28e58029638 {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz","integrity":"sha1-Rcijm2JsH4P4uPUwB8L2DrmO7p0=","time":1547833264863,"size":372,"metadata":{"url":"http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["11f83a1c99f277cb"],"referer":["bugs test-repo-url-http"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:test-repo-url-http@http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:04 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/2d/22/47328dfeb3a9f00c15c20ec3ebdaa0e12382c5c6badfa30fb7b376f6a580 b/deps/npm/test/npm_cache/_cacache/index-v5/2d/22/47328dfeb3a9f00c15c20ec3ebdaa0e12382c5c6badfa30fb7b376f6a580 new file mode 100644 index 00000000000000..4882c2fc4e14dc --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/2d/22/47328dfeb3a9f00c15c20ec3ebdaa0e12382c5c6badfa30fb7b376f6a580 @@ -0,0 +1,2 @@ + +47afbed34e3296c3fb1c2c3c31dd4f6e008a611d {"key":"pacote:packed-dir:git://github.com/isaacs/node-glob.git#67bda227fd7a559cca5620307c7d30a6732a792f","integrity":"sha512-nVsV0K11/FE/SjJ7XkQYA90iDt60+WYORU/p0mO1Q7o1bHEzCllk+GTRwkqtoWvqAo60AQZ2KxQrMNRIzcCFkw==","time":1544485144332,"size":27629} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/2f/ee/99c47a7b4b5d997bbdb8d0095b14f1940fbdde0e7515bc19ccfcfbccec49 b/deps/npm/test/npm_cache/_cacache/index-v5/2f/ee/99c47a7b4b5d997bbdb8d0095b14f1940fbdde0e7515bc19ccfcfbccec49 new file mode 100644 index 00000000000000..5fc55edfd6c6e9 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/2f/ee/99c47a7b4b5d997bbdb8d0095b14f1940fbdde0e7515bc19ccfcfbccec49 @@ -0,0 +1,3 @@ + +821d0bccf89608b476114b6cf34478e48ed64c01 {"key":"pacote:tag-manifest:http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz:sha1-gvPMuhGRTciLyxhe47GzO1ZCcrw=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833046970,"size":1,"metadata":{"id":"npm-test-peer-deps@0.0.0","manifest":{"author":{"name":"Domenic Denicola"},"name":"npm-test-peer-deps","version":"0.0.0","peerDependencies":{"request":"0.9.x"},"dependencies":{"underscore":"1.3.1"},"_id":"npm-test-peer-deps@0.0.0","dist":{"shasum":"82f3ccba11914dc88bcb185ee3b1b33b564272bc","tarball":"http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"domenic","email":"domenic@domenicdenicola.com"},"maintainers":[{"name":"domenic","email":"domenic@domenicdenicola.com"}],"directories":{},"_integrity":"sha1-gvPMuhGRTciLyxhe47GzO1ZCcrw=","_shasum":"82f3ccba11914dc88bcb185ee3b1b33b564272bc","_resolved":"http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz","optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"deprecated":false,"_shrinkwrap":null,"bin":null},"type":"finalized-manifest"}} +dc64a2c024b2011cd817a03f225f2ce1fd5bc3c2 {"key":"pacote:tag-manifest:http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz:sha1-gvPMuhGRTciLyxhe47GzO1ZCcrw=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833264159,"size":1,"metadata":{"id":"npm-test-peer-deps@0.0.0","manifest":{"author":{"name":"Domenic Denicola"},"name":"npm-test-peer-deps","version":"0.0.0","peerDependencies":{"request":"0.9.x"},"dependencies":{"underscore":"1.3.1"},"_id":"npm-test-peer-deps@0.0.0","dist":{"shasum":"82f3ccba11914dc88bcb185ee3b1b33b564272bc","tarball":"http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"domenic","email":"domenic@domenicdenicola.com"},"maintainers":[{"name":"domenic","email":"domenic@domenicdenicola.com"}],"directories":{},"_integrity":"sha1-gvPMuhGRTciLyxhe47GzO1ZCcrw=","_shasum":"82f3ccba11914dc88bcb185ee3b1b33b564272bc","_resolved":"http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz","optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"deprecated":false,"_shrinkwrap":null,"bin":null},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/32/2d/90e41f3ad9eeece7d8bafb5672197db1ee77ca9aa734a3e77692efcf7716 b/deps/npm/test/npm_cache/_cacache/index-v5/32/2d/90e41f3ad9eeece7d8bafb5672197db1ee77ca9aa734a3e77692efcf7716 new file mode 100644 index 00000000000000..b7a52d77b40f60 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/32/2d/90e41f3ad9eeece7d8bafb5672197db1ee77ca9aa734a3e77692efcf7716 @@ -0,0 +1,2 @@ + +9c30652272faf34fb4c4f517d0252e59c247af3e {"key":"pacote:range-manifest:http://localhost:1337/wordwrap/-/wordwrap-0.0.2.tgz:sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833073434,"size":1,"metadata":{"id":"wordwrap@0.0.2","manifest":{"name":"wordwrap","version":"0.0.2","engines":{"node":">=0.4.0"},"dependencies":{},"optionalDependencies":{},"devDependencies":{"expresso":"=0.7.x"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/wordwrap/-/wordwrap-0.0.2.tgz","_integrity":"sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=","_shasum":"b79669bb42ecb409f83d583cad52ca17eaa1643f","_shrinkwrap":null,"bin":null,"_id":"wordwrap@0.0.2"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/34/f7/495a783848aed5199e0583f72c91d67d20fa9f5f5604755719bc421195dd b/deps/npm/test/npm_cache/_cacache/index-v5/34/f7/495a783848aed5199e0583f72c91d67d20fa9f5f5604755719bc421195dd new file mode 100644 index 00000000000000..1189abdea29efc --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/34/f7/495a783848aed5199e0583f72c91d67d20fa9f5f5604755719bc421195dd @@ -0,0 +1,3 @@ + +ff2ce690683c79e0df6daf181cfe0543239d9b0b {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fanother/access","integrity":null,"time":1547832986290} +e053044487b8a4c73b139c9f3441d9ed6d646135 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fanother/access","integrity":null,"time":1547833210590} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/35/d4/4f8776a16f1d67cec7136a104fc757d4d7719d47a6b5d71c1b3075cc1b69 b/deps/npm/test/npm_cache/_cacache/index-v5/35/d4/4f8776a16f1d67cec7136a104fc757d4d7719d47a6b5d71c1b3075cc1b69 new file mode 100644 index 00000000000000..a000ea1d271756 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/35/d4/4f8776a16f1d67cec7136a104fc757d4d7719d47a6b5d71c1b3075cc1b69 @@ -0,0 +1,3 @@ + +f9ae39b39ffa062b7f3c79830bf3f5666ced8f6a {"key":"make-fetch-happen:request-cache:http://localhost:1337/registry/add-named-update-protocol-port","integrity":"sha512-3GiCmFRKOGfPOZsEzGDDjGUZ2uYJbFuhkXu3ikibqp1rrTlknhbgA2fnzQKsFLp81k86zVbiG5hGMPgjrZyWYw==","time":1547832996619,"size":301,"metadata":{"url":"http://localhost:1337/registry/add-named-update-protocol-port","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["2b49fe996267b15d"],"referer":["cache add add-named-update-protocol-port@0.0.0"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:add-named-update-protocol-port"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:36 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +d7c26b3ee71fee8c9c16ec6525b081a4972ee922 {"key":"make-fetch-happen:request-cache:http://localhost:1337/registry/add-named-update-protocol-port","integrity":"sha512-3GiCmFRKOGfPOZsEzGDDjGUZ2uYJbFuhkXu3ikibqp1rrTlknhbgA2fnzQKsFLp81k86zVbiG5hGMPgjrZyWYw==","time":1547833219206,"size":301,"metadata":{"url":"http://localhost:1337/registry/add-named-update-protocol-port","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["302f70336b58dfc7"],"referer":["cache add add-named-update-protocol-port@0.0.0"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:add-named-update-protocol-port"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:19 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/4b/fa/51a839f22632c42d66d63607a55048be00c0a16bcf8dc96b9aadb8511570 b/deps/npm/test/npm_cache/_cacache/index-v5/4b/fa/51a839f22632c42d66d63607a55048be00c0a16bcf8dc96b9aadb8511570 new file mode 100644 index 00000000000000..b01ea3b8b46f58 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/4b/fa/51a839f22632c42d66d63607a55048be00c0a16bcf8dc96b9aadb8511570 @@ -0,0 +1,5 @@ + +6ed5c7aff973ebeb3d108482dfd58982c46c2e1c {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fpkg/access","integrity":null,"time":1547832983691} +8b3bb3243ae51532a265f0f56f77a2b120c6cac5 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fpkg/access","integrity":null,"time":1547832985654} +a76a484674e2e4cb0185c9c622f4894dcabc0fc7 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fpkg/access","integrity":null,"time":1547833208503} +417ea4dabdd7cadf16c11c19d3a321c54eb68f21 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fpkg/access","integrity":null,"time":1547833210073} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/4c/94/5f2a94150990b1ee4ecadd4897498d69b3141e0d72f1ccc1f3bd703a4c75 b/deps/npm/test/npm_cache/_cacache/index-v5/4c/94/5f2a94150990b1ee4ecadd4897498d69b3141e0d72f1ccc1f3bd703a4c75 new file mode 100644 index 00000000000000..8d1978120a29ff --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/4c/94/5f2a94150990b1ee4ecadd4897498d69b3141e0d72f1ccc1f3bd703a4c75 @@ -0,0 +1,3 @@ + +67a9de7796100032dc06f94a7f969dc9dbf6b66f {"key":"make-fetch-happen:request-cache:http://localhost:1337/wordwrap/-/wordwrap-0.0.2.tgz","integrity":"sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=","time":1547833073426,"size":13772,"metadata":{"url":"http://localhost:1337/wordwrap/-/wordwrap-0.0.2.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:wordwrap@http://localhost:1337/wordwrap/-/wordwrap-0.0.2.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +7b4401744a73e7d9d61a3cef29d9548dd30dff92 {"key":"make-fetch-happen:request-cache:http://localhost:1337/wordwrap/-/wordwrap-0.0.2.tgz","integrity":"sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=","time":1547833093386,"size":13772,"metadata":{"url":"http://localhost:1337/wordwrap/-/wordwrap-0.0.2.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcd144259ba74815"],"referer":["install ."],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:wordwrap@http://localhost:1337/wordwrap/-/wordwrap-0.0.2.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/4c/9f/92b75e7965b407ec25a6d5770af0d18432dbca32e8a2a9958dd413e3b776 b/deps/npm/test/npm_cache/_cacache/index-v5/4c/9f/92b75e7965b407ec25a6d5770af0d18432dbca32e8a2a9958dd413e3b776 new file mode 100644 index 00000000000000..3fb97608f5172b --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/4c/9f/92b75e7965b407ec25a6d5770af0d18432dbca32e8a2a9958dd413e3b776 @@ -0,0 +1,5 @@ + +65e2bd8d36bc6ef8dce26de8c55e0a213bab8d5a {"key":"make-fetch-happen:request-cache:http://localhost:1337/clean","integrity":"sha512-eexGJb7BoTqu/c1OfPGPHFV1h52A6L26BjzJYslZxIUmoMHJ43Zsleyeoc8QzZVJaPO/7BNvDTqocAnbBc9GZg==","time":1547833073341,"size":29623,"metadata":{"url":"http://localhost:1337/clean","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:clean"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +6a207e4d350e6a798c36a4e81135a280f6ba65e9 {"key":"make-fetch-happen:request-cache:http://localhost:1337/clean","integrity":"sha512-eexGJb7BoTqu/c1OfPGPHFV1h52A6L26BjzJYslZxIUmoMHJ43Zsleyeoc8QzZVJaPO/7BNvDTqocAnbBc9GZg==","time":1547833093274,"size":29623,"metadata":{"url":"http://localhost:1337/clean","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcd144259ba74815"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:clean"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +1dd2ce72056652f48dc6931ea01fab72e888a342 {"key":"make-fetch-happen:request-cache:http://localhost:1337/clean","integrity":"sha512-eexGJb7BoTqu/c1OfPGPHFV1h52A6L26BjzJYslZxIUmoMHJ43Zsleyeoc8QzZVJaPO/7BNvDTqocAnbBc9GZg==","time":1547833294122,"size":29623,"metadata":{"url":"http://localhost:1337/clean","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["0a92a1a2bc33028a"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:clean"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:34 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +091b191fc26665b124a1ebd27d91f5f5a70e18a9 {"key":"make-fetch-happen:request-cache:http://localhost:1337/clean","integrity":"sha512-eexGJb7BoTqu/c1OfPGPHFV1h52A6L26BjzJYslZxIUmoMHJ43Zsleyeoc8QzZVJaPO/7BNvDTqocAnbBc9GZg==","time":1547833314380,"size":29623,"metadata":{"url":"http://localhost:1337/clean","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["ce2c0b941f6a62b8"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:clean"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:54 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/4d/ed/ee7db809a7dfddfb87fc4055ac06876c63165a517fc12011046fc2cc4a9f b/deps/npm/test/npm_cache/_cacache/index-v5/4d/ed/ee7db809a7dfddfb87fc4055ac06876c63165a517fc12011046fc2cc4a9f new file mode 100644 index 00000000000000..9d55f4bb97315f --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/4d/ed/ee7db809a7dfddfb87fc4055ac06876c63165a517fc12011046fc2cc4a9f @@ -0,0 +1,3 @@ + +f907d57bfb7ff4880fc048a1703c6bee25d11de6 {"key":"make-fetch-happen:request-cache:http://localhost:1337/registry/add-named-update-protocol-porti","integrity":"sha512-iEmRT8aS3FRB/sgjGjPK7JhAm21SL6Rr7UpnMSeHYiS5y4vDXlHiUciol6HXHdnX9GtiF+yO8w7E2D9LmkMJjQ==","time":1547832997182,"size":304,"metadata":{"url":"http://localhost:1337/registry/add-named-update-protocol-porti","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["8cb41ddc499c27b6"],"referer":["cache add add-named-update-protocol-porti@0.0.0"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:add-named-update-protocol-porti"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:37 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +27ddad6023e6e5949796edad34e03de77ff584e4 {"key":"make-fetch-happen:request-cache:http://localhost:1337/registry/add-named-update-protocol-porti","integrity":"sha512-iEmRT8aS3FRB/sgjGjPK7JhAm21SL6Rr7UpnMSeHYiS5y4vDXlHiUciol6HXHdnX9GtiF+yO8w7E2D9LmkMJjQ==","time":1547833219768,"size":304,"metadata":{"url":"http://localhost:1337/registry/add-named-update-protocol-porti","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["87b598eff1cdd205"],"referer":["cache add add-named-update-protocol-porti@0.0.0"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:add-named-update-protocol-porti"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:19 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/4e/ce/f2fe3deddf79eb0c8c03828e46b026559f16671fbad7c36d5e0a1bd28a7f b/deps/npm/test/npm_cache/_cacache/index-v5/4e/ce/f2fe3deddf79eb0c8c03828e46b026559f16671fbad7c36d5e0a1bd28a7f new file mode 100644 index 00000000000000..46ff239a9a061c --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/4e/ce/f2fe3deddf79eb0c8c03828e46b026559f16671fbad7c36d5e0a1bd28a7f @@ -0,0 +1,13 @@ + +615a02b41b714e7944da18b9c8a4a62463b823f9 {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":"sha512-WmQCdLXP3E4GNb3SYsWDDef6+cAtPF72amCsWO0g/LMk+F1+97boUhDYIJEiCWGRiT9mLbM9BWmDcwU4i601vw==","time":1547833095212,"size":405,"metadata":{"url":"http://localhost:1337/cond?write=true","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["02b311f2b8b360bb"],"referer":["deprecate cond@0.0.1 make it dead"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:15 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +a876e349124d09b706740a5fc1a495f5bf0c32a2 {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":null,"time":1547833095221} +74a45b087e8945624ff7f12c34c21da8e82210a5 {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":"sha512-WmQCdLXP3E4GNb3SYsWDDef6+cAtPF72amCsWO0g/LMk+F1+97boUhDYIJEiCWGRiT9mLbM9BWmDcwU4i601vw==","time":1547833096353,"size":405,"metadata":{"url":"http://localhost:1337/cond?write=true","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["2dc1d8ce7042f86e"],"referer":["deprecate cond@<0.0.2 make it dead"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:16 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +c0f7a970f72991a541e6e96b934f43f00a29b0e4 {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":null,"time":1547833096358} +ff945e0c64b571a8018b102bb1bf6e6a3814391d {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":"sha512-WmQCdLXP3E4GNb3SYsWDDef6+cAtPF72amCsWO0g/LMk+F1+97boUhDYIJEiCWGRiT9mLbM9BWmDcwU4i601vw==","time":1547833097537,"size":405,"metadata":{"url":"http://localhost:1337/cond?write=true","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["8fcad2955426aecc"],"referer":["deprecate cond make it dead"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:17 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +a0bfcc705e18dcda52ad996ed6b93ee76b367dc3 {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":null,"time":1547833097544} +04c50a42efd378ebf125165e24d0a56eaae2f814 {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":"sha512-WmQCdLXP3E4GNb3SYsWDDef6+cAtPF72amCsWO0g/LMk+F1+97boUhDYIJEiCWGRiT9mLbM9BWmDcwU4i601vw==","time":1547833316172,"size":405,"metadata":{"url":"http://localhost:1337/cond?write=true","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["0c1b36ee0c47d1ae"],"referer":["deprecate cond@0.0.1 make it dead"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:56 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +32965c869981124c26fcb3933106540045c69ae4 {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":null,"time":1547833316178} +591f02138e8b4dbb841c65796f6da7928c1ca821 {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":"sha512-WmQCdLXP3E4GNb3SYsWDDef6+cAtPF72amCsWO0g/LMk+F1+97boUhDYIJEiCWGRiT9mLbM9BWmDcwU4i601vw==","time":1547833317223,"size":405,"metadata":{"url":"http://localhost:1337/cond?write=true","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["83346960af9afefb"],"referer":["deprecate cond@<0.0.2 make it dead"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:57 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +1c56dcec89793dace00808ad01cfcfae3d49a8de {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":null,"time":1547833317228} +d66e3a04880e9d955736a5130058591b4c7acab4 {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":"sha512-WmQCdLXP3E4GNb3SYsWDDef6+cAtPF72amCsWO0g/LMk+F1+97boUhDYIJEiCWGRiT9mLbM9BWmDcwU4i601vw==","time":1547833318278,"size":405,"metadata":{"url":"http://localhost:1337/cond?write=true","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["74d74662562f8e40"],"referer":["deprecate cond make it dead"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:58 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +5f2eee7d6a675de32334da3735a9cd5918686f89 {"key":"make-fetch-happen:request-cache:http://localhost:1337/cond","integrity":null,"time":1547833318286} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/52/26/16d800e2651582fd96b18d4ff02085c52be8b7b4b739d0da243122208329 b/deps/npm/test/npm_cache/_cacache/index-v5/52/26/16d800e2651582fd96b18d4ff02085c52be8b7b4b739d0da243122208329 new file mode 100644 index 00000000000000..015dce01067b88 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/52/26/16d800e2651582fd96b18d4ff02085c52be8b7b4b739d0da243122208329 @@ -0,0 +1,3 @@ + +714a9469ff5844eb797bf3506abc20d4d452dec6 {"key":"make-fetch-happen:request-cache:http://localhost:1337/underscore","integrity":"sha512-Fa00hT8RSVJtl/CLUMOqqeyEAxp+v7e7WePyMX1cMGKGUoy5G/U9xZaALTFnYuW6RkF2SyaAlFuj9iDTz3mKBQ==","time":1547833045332,"size":40940,"metadata":{"url":"http://localhost:1337/underscore","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["4fa97a596a50fc65"],"referer":["bugs underscore"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:underscore"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:25 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +35349b250c2ac115dcd5abcd4ebba1151a71f888 {"key":"make-fetch-happen:request-cache:http://localhost:1337/underscore","integrity":"sha512-Fa00hT8RSVJtl/CLUMOqqeyEAxp+v7e7WePyMX1cMGKGUoy5G/U9xZaALTFnYuW6RkF2SyaAlFuj9iDTz3mKBQ==","time":1547833262745,"size":40940,"metadata":{"url":"http://localhost:1337/underscore","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["20080b2063fb2e2a"],"referer":["bugs underscore"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:underscore"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:02 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/53/b9/a3f54151106c138d93ef4e411f13d971ff84939f5a96a1d5826244927399 b/deps/npm/test/npm_cache/_cacache/index-v5/53/b9/a3f54151106c138d93ef4e411f13d971ff84939f5a96a1d5826244927399 new file mode 100644 index 00000000000000..f3558b0d7a772b --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/53/b9/a3f54151106c138d93ef4e411f13d971ff84939f5a96a1d5826244927399 @@ -0,0 +1,3 @@ + +8c49400cedb617b1a7a9dd9f93635b4f7546dd84 {"key":"pacote:tag-manifest:http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz:sha1-Rcijm2JsH4P4uPUwB8L2DrmO7p0=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833047706,"size":1,"metadata":{"id":"test-repo-url-http@0.0.1","manifest":{"name":"test-repo-url-http","version":"0.0.1","description":"Test repo with non-github http repository url","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"http://gitlab.com/evanlucas/test-repo-url-http.git"},"author":{"name":"Evan Lucas","email":"evanlucas@me.com"},"license":"ISC","_id":"test-repo-url-http@0.0.1","dist":{"shasum":"45c8a39b626c1f83f8b8f53007c2f60eb98eee9d","tarball":"http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"evanlucas","email":"evanlucas@me.com"},"maintainers":[{"name":"evanlucas","email":"evanlucas@me.com"}],"directories":{},"_integrity":"sha1-Rcijm2JsH4P4uPUwB8L2DrmO7p0=","_shasum":"45c8a39b626c1f83f8b8f53007c2f60eb98eee9d","_resolved":"http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_shrinkwrap":null,"bin":null},"type":"finalized-manifest"}} +4fb5740938b9bf3eef72c65b21823d14dd9c2367 {"key":"pacote:tag-manifest:http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz:sha1-Rcijm2JsH4P4uPUwB8L2DrmO7p0=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833264868,"size":1,"metadata":{"id":"test-repo-url-http@0.0.1","manifest":{"name":"test-repo-url-http","version":"0.0.1","description":"Test repo with non-github http repository url","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"http://gitlab.com/evanlucas/test-repo-url-http.git"},"author":{"name":"Evan Lucas","email":"evanlucas@me.com"},"license":"ISC","_id":"test-repo-url-http@0.0.1","dist":{"shasum":"45c8a39b626c1f83f8b8f53007c2f60eb98eee9d","tarball":"http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"evanlucas","email":"evanlucas@me.com"},"maintainers":[{"name":"evanlucas","email":"evanlucas@me.com"}],"directories":{},"_integrity":"sha1-Rcijm2JsH4P4uPUwB8L2DrmO7p0=","_shasum":"45c8a39b626c1f83f8b8f53007c2f60eb98eee9d","_resolved":"http://localhost:1337/test-repo-url-http/-/test-repo-url-http-0.0.1.tgz","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_shrinkwrap":null,"bin":null},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/54/c7/bd7b2edde99a50402386dc89dd492bc0e1c9c57727fbf97333ab23450cc6 b/deps/npm/test/npm_cache/_cacache/index-v5/54/c7/bd7b2edde99a50402386dc89dd492bc0e1c9c57727fbf97333ab23450cc6 new file mode 100644 index 00000000000000..43146fe8ef9cab --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/54/c7/bd7b2edde99a50402386dc89dd492bc0e1c9c57727fbf97333ab23450cc6 @@ -0,0 +1,5 @@ + +b40a8c13bae09feb6652226e83377e1ecd65aaac {"key":"make-fetch-happen:request-cache:http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","integrity":"sha1-KOuEepSeceuQQf1lZ6Nsms/PK+0=","time":1547833041014,"size":55415,"metadata":{"url":"http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["66dfca64d34790d3"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:undefined@http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz"]},"resHeaders":{"date":["Fri, 18 Jan 2019 17:37:20 GMT"],"connection":["keep-alive"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +1e3f986dad6c99953d81d83d7938b389aa8e1793 {"key":"make-fetch-happen:request-cache:http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","integrity":"sha512-NycvWDeO1ZEZc3P0bTvhSL/IJknbshO+FKKxrEf1DX1IBMsQVZCTWnvNAt+uOiQhyTnK+1hrnxtsSS/f4JrKhg==","time":1547833041061,"size":55415,"metadata":{"url":"http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["66dfca64d34790d3"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:undefined@http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz"]},"resHeaders":{"date":["Fri, 18 Jan 2019 17:37:21 GMT"],"connection":["keep-alive"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +dd8f9ec163a26a6724431b7c5b5b26ffa874ebfb {"key":"make-fetch-happen:request-cache:http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","integrity":"sha1-KOuEepSeceuQQf1lZ6Nsms/PK+0=","time":1547833259078,"size":55415,"metadata":{"url":"http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["971c11884a599dc1"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:undefined@http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz"]},"resHeaders":{"date":["Fri, 18 Jan 2019 17:40:59 GMT"],"connection":["keep-alive"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +3eb068393054e489ac2faa2394c38673a8d26073 {"key":"make-fetch-happen:request-cache:http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","integrity":"sha1-KOuEepSeceuQQf1lZ6Nsms/PK+0=","time":1548718095636,"size":55415,"metadata":{"url":"http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.7.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["1ff276f8555c3331"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:undefined@http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz"]},"resHeaders":{"date":["Mon, 28 Jan 2019 23:28:15 GMT"],"connection":["keep-alive"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/55/94/6aae1bf2eae7384bbf56a2610deec22135ab5102d53f8dc5bb1359585a5c b/deps/npm/test/npm_cache/_cacache/index-v5/55/94/6aae1bf2eae7384bbf56a2610deec22135ab5102d53f8dc5bb1359585a5c new file mode 100644 index 00000000000000..eca0f3535f784a --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/55/94/6aae1bf2eae7384bbf56a2610deec22135ab5102d53f8dc5bb1359585a5c @@ -0,0 +1,5 @@ + +a2b116d83c5946d7ea2926dc2f964775ad99c33e {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/myorg/package","integrity":"sha512-3Cqk30LNQ1Yj9MLD4nT6CBzJQv9F3PqYzfSpMktqIcNyHDS7l+aAnuKAUfwQ9XdJz/YKqXCh44x6bDVKlANVTg==","time":1547832991512,"size":39,"metadata":{"url":"http://localhost:1337/-/user/myorg/package?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["2942fcbe6b15bc39"],"referer":["access ls-packages myorg"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:31 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +ac58205d3eccdc2ae3c12d4fe9a36dfdbb773a1c {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/myorg/package","integrity":"sha512-3Cqk30LNQ1Yj9MLD4nT6CBzJQv9F3PqYzfSpMktqIcNyHDS7l+aAnuKAUfwQ9XdJz/YKqXCh44x6bDVKlANVTg==","time":1547832992340,"size":39,"metadata":{"url":"http://localhost:1337/-/user/myorg/package?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["932157f8d5b366bf"],"referer":["access ls-packages myorg"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:32 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +9912b7634d0dbaf0ca67a4b70d5f39646fb9dc6d {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/myorg/package","integrity":"sha512-3Cqk30LNQ1Yj9MLD4nT6CBzJQv9F3PqYzfSpMktqIcNyHDS7l+aAnuKAUfwQ9XdJz/YKqXCh44x6bDVKlANVTg==","time":1547833215173,"size":39,"metadata":{"url":"http://localhost:1337/-/user/myorg/package?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["affe1fe251e4fee3"],"referer":["access ls-packages myorg"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:15 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +ccc3fa29db9b00c42232defb85de668c64b7e566 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/myorg/package","integrity":"sha512-3Cqk30LNQ1Yj9MLD4nT6CBzJQv9F3PqYzfSpMktqIcNyHDS7l+aAnuKAUfwQ9XdJz/YKqXCh44x6bDVKlANVTg==","time":1547833215718,"size":39,"metadata":{"url":"http://localhost:1337/-/user/myorg/package?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["d0ef5e47830054c8"],"referer":["access ls-packages myorg"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:15 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/56/a3/d63cf88aff86698120f294331ca4785e2ef41b621d746ef1047eaf34e122 b/deps/npm/test/npm_cache/_cacache/index-v5/56/a3/d63cf88aff86698120f294331ca4785e2ef41b621d746ef1047eaf34e122 new file mode 100644 index 00000000000000..323aba91b031b4 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/56/a3/d63cf88aff86698120f294331ca4785e2ef41b621d746ef1047eaf34e122 @@ -0,0 +1,3 @@ + +b49db14b91a87711dc8285af855701bdd5ed7d31 {"key":"pacote:tarball:file:/Users/zkat/Documents/code/work/npm/test/tap/bundled-dependencies-nonarray/a-bundled-dep-2.0.0.tgz","integrity":"sha512-qoZzDskyzbDwXbLzXh5Fb8mG2xn4P7P4FApYUUEfvPRJZjKEeasoDMgK4tdAzcAfj4gINqAMZnQ1ZazS6DUueg==","time":1547833057455,"size":151} +a78edf067966dfa38715a7036b298d44373f88c2 {"key":"pacote:tarball:file:/Users/zkat/Documents/code/work/npm/test/tap/bundled-dependencies-nonarray/a-bundled-dep-2.0.0.tgz","integrity":"sha512-qoZzDskyzbDwXbLzXh5Fb8mG2xn4P7P4FApYUUEfvPRJZjKEeasoDMgK4tdAzcAfj4gINqAMZnQ1ZazS6DUueg==","time":1547833274122,"size":151} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/58/cd/24c1bfea16737029dabb2e41b34b7a019b657b6db6c972a30870f3318344 b/deps/npm/test/npm_cache/_cacache/index-v5/58/cd/24c1bfea16737029dabb2e41b34b7a019b657b6db6c972a30870f3318344 new file mode 100644 index 00000000000000..9195ed434b7115 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/58/cd/24c1bfea16737029dabb2e41b34b7a019b657b6db6c972a30870f3318344 @@ -0,0 +1,4 @@ + +45cef68fe8e13d96253fa955bb0343077d163666 {"key":"pacote:packed-dir:git+file:///Users/zkat/Documents/code/work/npm/test/tap/add-remote-git-file/child.git#244a79cc7d51cd727460a91fea694a700a414510","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547832998376,"size":143} +53a8de5d4a72e643b5d250ff17f81dbc78704e42 {"key":"pacote:packed-dir:git+file:///Users/zkat/Documents/code/work/npm/test/tap/add-remote-git-file/child.git#244a79cc7d51cd727460a91fea694a700a414510","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547832998710,"size":143} +178404c25dd4361196f30fd3a098349fe20d9e26 {"key":"pacote:packed-dir:git+file:///Users/zkat/Documents/code/work/npm/test/tap/add-remote-git-file/child.git#244a79cc7d51cd727460a91fea694a700a414510","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547832999024,"size":143} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/58/fc/50f89b2f236774e4b33eda6968cde18196e800153a6162d5f73df18895fa b/deps/npm/test/npm_cache/_cacache/index-v5/58/fc/50f89b2f236774e4b33eda6968cde18196e800153a6162d5f73df18895fa new file mode 100644 index 00000000000000..9893a7fe4d8827 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/58/fc/50f89b2f236774e4b33eda6968cde18196e800153a6162d5f73df18895fa @@ -0,0 +1,3 @@ + +c46aa948cd5c228a9e7222006ced1fb23b531de9 {"key":"pacote:tag-manifest:http://localhost:1337/underscore/-/underscore-1.5.1.tgz:sha1-0r3oF9F2/63olKtxRY5oKhS4bck=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833045360,"size":1,"metadata":{"id":"underscore@1.5.1","manifest":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://underscorejs.org","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"repository":{"type":"git","url":"git://github.com/jashkenas/underscore.git"},"main":"underscore.js","version":"1.5.1","devDependencies":{"phantomjs":"1.9.0-1"},"scripts":{"test":"phantomjs test/vendor/runner.js test/index.html?noglobals=true"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/jashkenas/underscore/issues"},"_id":"underscore@1.5.1","dist":{"shasum":"d2bde817d176ffade894ab71458e682a14b86dc9","tarball":"http://localhost:1337/underscore/-/underscore-1.5.1.tgz"},"_from":".","_npmVersion":"1.2.24","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{},"_integrity":"sha1-0r3oF9F2/63olKtxRY5oKhS4bck=","_shasum":"d2bde817d176ffade894ab71458e682a14b86dc9","_resolved":"http://localhost:1337/underscore/-/underscore-1.5.1.tgz","dependencies":{},"optionalDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_shrinkwrap":null,"bin":null},"type":"finalized-manifest"}} +eaffa59aa3c09ecc9f1ca6b49e7b24b33cf7c78b {"key":"pacote:tag-manifest:http://localhost:1337/underscore/-/underscore-1.5.1.tgz:sha1-0r3oF9F2/63olKtxRY5oKhS4bck=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833262771,"size":1,"metadata":{"id":"underscore@1.5.1","manifest":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://underscorejs.org","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"repository":{"type":"git","url":"git://github.com/jashkenas/underscore.git"},"main":"underscore.js","version":"1.5.1","devDependencies":{"phantomjs":"1.9.0-1"},"scripts":{"test":"phantomjs test/vendor/runner.js test/index.html?noglobals=true"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/jashkenas/underscore/issues"},"_id":"underscore@1.5.1","dist":{"shasum":"d2bde817d176ffade894ab71458e682a14b86dc9","tarball":"http://localhost:1337/underscore/-/underscore-1.5.1.tgz"},"_from":".","_npmVersion":"1.2.24","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{},"_integrity":"sha1-0r3oF9F2/63olKtxRY5oKhS4bck=","_shasum":"d2bde817d176ffade894ab71458e682a14b86dc9","_resolved":"http://localhost:1337/underscore/-/underscore-1.5.1.tgz","dependencies":{},"optionalDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_shrinkwrap":null,"bin":null},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/59/28/f3ffadce8db4fdb922343ee79cb0ab6d1b2f500885d3a7d93bbb4b24e711 b/deps/npm/test/npm_cache/_cacache/index-v5/59/28/f3ffadce8db4fdb922343ee79cb0ab6d1b2f500885d3a7d93bbb4b24e711 new file mode 100644 index 00000000000000..54c80e1accabdd --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/59/28/f3ffadce8db4fdb922343ee79cb0ab6d1b2f500885d3a7d93bbb4b24e711 @@ -0,0 +1,5 @@ + +e24beb7df1231c201db341f46ef1f8abb7752d80 {"key":"make-fetch-happen:request-cache:http://localhost:1338/-/v1/login","integrity":null,"time":1547833010372} +ec88b3c9343b37dbf0c6c084946610bb7835774d {"key":"make-fetch-happen:request-cache:http://localhost:1338/-/v1/login","integrity":null,"time":1547833011560} +318f091e15c70e6f29d4f0b1e663c2807a98524b {"key":"make-fetch-happen:request-cache:http://localhost:1338/-/v1/login","integrity":null,"time":1547833230533} +ab714759e858dd475e99aa117986a040af48252a {"key":"make-fetch-happen:request-cache:http://localhost:1338/-/v1/login","integrity":null,"time":1547833231522} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/59/5d/20f410f92d365ec2b34c98856ae075582e2842b381809c76ffd12d24c450 b/deps/npm/test/npm_cache/_cacache/index-v5/59/5d/20f410f92d365ec2b34c98856ae075582e2842b381809c76ffd12d24c450 new file mode 100644 index 00000000000000..24d3ba16166a8f --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/59/5d/20f410f92d365ec2b34c98856ae075582e2842b381809c76ffd12d24c450 @@ -0,0 +1,3 @@ + +b845de941681d8414d49bfff3b681b1c11b1ecea {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-http","integrity":"sha512-NarqKzpZAiZMFGBhF7AOIEJa8UVgwyPpKFndhvTMVSFG/AZUijHqWbpu3VabakGiAXgfajmQAIL+qsgZI6EuVw==","time":1547833047675,"size":1106,"metadata":{"url":"http://localhost:1337/test-repo-url-http","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["e139e9c1a8b0ded0"],"referer":["bugs test-repo-url-http"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:test-repo-url-http"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:27 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +3b718ed3038b2e438372411659ab06e9dc7fd729 {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-http","integrity":"sha512-NarqKzpZAiZMFGBhF7AOIEJa8UVgwyPpKFndhvTMVSFG/AZUijHqWbpu3VabakGiAXgfajmQAIL+qsgZI6EuVw==","time":1547833264847,"size":1106,"metadata":{"url":"http://localhost:1337/test-repo-url-http","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["11f83a1c99f277cb"],"referer":["bugs test-repo-url-http"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:test-repo-url-http"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:04 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/59/8d/bede4978235a53fade60aedbfe40200d189691fae9d90c694f654422738c b/deps/npm/test/npm_cache/_cacache/index-v5/59/8d/bede4978235a53fade60aedbfe40200d189691fae9d90c694f654422738c new file mode 100644 index 00000000000000..56a821f840d423 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/59/8d/bede4978235a53fade60aedbfe40200d189691fae9d90c694f654422738c @@ -0,0 +1,5 @@ + +fd58a22661b0d656d8825f579b89bef2f5b48d09 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fanother/collaborators","integrity":"sha512-MshpkrpGcUCKKSuz8vrkzRBBbc7baiFMFpBUr2vMeStupW9yRTMzV8xZ5PhGYDgGBLX/M4JYrUaXMhjYZHmbXg==","time":1547832993749,"size":51,"metadata":{"url":"http://localhost:1337/-/package/%40scoped%2Fanother/collaborators?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["b43ad0fff025ebdf"],"referer":["access ls-collaborators [REDACTED]"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:33 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +32f2da9079c97ea55aeb6068c7b0c79ed44e80f5 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fanother/collaborators","integrity":"sha512-MshpkrpGcUCKKSuz8vrkzRBBbc7baiFMFpBUr2vMeStupW9yRTMzV8xZ5PhGYDgGBLX/M4JYrUaXMhjYZHmbXg==","time":1547832994448,"size":51,"metadata":{"url":"http://localhost:1337/-/package/%40scoped%2Fanother/collaborators?format=cli&user=zkat","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["e9916eb63e660f41"],"referer":["access ls-collaborators [REDACTED] zkat"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:34 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +1e7f2c2ce972add20f15798aac735bf0138599fa {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fanother/collaborators","integrity":"sha512-MshpkrpGcUCKKSuz8vrkzRBBbc7baiFMFpBUr2vMeStupW9yRTMzV8xZ5PhGYDgGBLX/M4JYrUaXMhjYZHmbXg==","time":1547833216881,"size":51,"metadata":{"url":"http://localhost:1337/-/package/%40scoped%2Fanother/collaborators?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["bb5528fa4898a9ac"],"referer":["access ls-collaborators [REDACTED]"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:16 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +217041f7ea524bd77d46ffa7dd880e59ca6fd581 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fanother/collaborators","integrity":"sha512-MshpkrpGcUCKKSuz8vrkzRBBbc7baiFMFpBUr2vMeStupW9yRTMzV8xZ5PhGYDgGBLX/M4JYrUaXMhjYZHmbXg==","time":1547833217426,"size":51,"metadata":{"url":"http://localhost:1337/-/package/%40scoped%2Fanother/collaborators?format=cli&user=zkat","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["3d89cf1663234567"],"referer":["access ls-collaborators [REDACTED] zkat"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:17 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/5e/04/1f94a3a706d4fc86a4e28c064e5182f98631dbc1156be71fa734471d1b31 b/deps/npm/test/npm_cache/_cacache/index-v5/5e/04/1f94a3a706d4fc86a4e28c064e5182f98631dbc1156be71fa734471d1b31 new file mode 100644 index 00000000000000..cd0bc97f25c395 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/5e/04/1f94a3a706d4fc86a4e28c064e5182f98631dbc1156be71fa734471d1b31 @@ -0,0 +1,2 @@ + +65f5f4d2d391adc1d0ef104079246ecffd6736ae {"key":"pacote:packed-dir:git://localhost:1234/child.git#65974106d8883632964be1da34eec5e85beead3a","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833223116,"size":143} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/5e/25/544dc931f40d3c9ec02d15a7754abc281ff227d3d4436045fc19bded3abb b/deps/npm/test/npm_cache/_cacache/index-v5/5e/25/544dc931f40d3c9ec02d15a7754abc281ff227d3d4436045fc19bded3abb new file mode 100644 index 00000000000000..7699b031bf977d --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/5e/25/544dc931f40d3c9ec02d15a7754abc281ff227d3d4436045fc19bded3abb @@ -0,0 +1,9 @@ + +86bc6c29fe0adc0d0b961ebe5427c43883b896eb {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/team/myorg/myteam/package","integrity":null,"time":1547832987480} +dca685c6d7d2f7e331ebee4e67f7da67dcf622d9 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/team/myorg/myteam/package","integrity":null,"time":1547832988107} +f471c72e7ec5b592533af18b692da5adf4cabf23 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/team/myorg/myteam/package","integrity":null,"time":1547832989180} +20e661a1569f9c61f06c1e753d344f7f42f4b89b {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/team/myorg/myteam/package","integrity":"sha512-3Cqk30LNQ1Yj9MLD4nT6CBzJQv9F3PqYzfSpMktqIcNyHDS7l+aAnuKAUfwQ9XdJz/YKqXCh44x6bDVKlANVTg==","time":1547832990308,"size":39,"metadata":{"url":"http://localhost:1337/-/team/myorg/myteam/package?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["cb9055f60b0e88f3"],"referer":["access ls-packages myorg:myteam"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:30 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +1edea5ab5acb2a3ffa7ee166e99c5a397358ed9c {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/team/myorg/myteam/package","integrity":null,"time":1547833211568} +8e5098cf2f5a2fee34d396006ea2e083396608a6 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/team/myorg/myteam/package","integrity":null,"time":1547833212080} +4c7dd36cf3e359243712dc145cbb681d713107b8 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/team/myorg/myteam/package","integrity":null,"time":1547833213058} +4d9236c47a4c5b81a22542da0187135569b5f420 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/team/myorg/myteam/package","integrity":"sha512-3Cqk30LNQ1Yj9MLD4nT6CBzJQv9F3PqYzfSpMktqIcNyHDS7l+aAnuKAUfwQ9XdJz/YKqXCh44x6bDVKlANVTg==","time":1547833214108,"size":39,"metadata":{"url":"http://localhost:1337/-/team/myorg/myteam/package?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["a18b23cf2e1926ff"],"referer":["access ls-packages myorg:myteam"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:14 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/5f/dc/61605b7783855ffa612d4a7dbf1f5e94e01b700897b6a69b1700a9575905 b/deps/npm/test/npm_cache/_cacache/index-v5/5f/dc/61605b7783855ffa612d4a7dbf1f5e94e01b700897b6a69b1700a9575905 new file mode 100644 index 00000000000000..cd047f668856f9 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/5f/dc/61605b7783855ffa612d4a7dbf1f5e94e01b700897b6a69b1700a9575905 @@ -0,0 +1,5 @@ + +ee14f65558fa8113fa92a2d1b9e51cc2eaf22abf {"key":"pacote:packed-dir:git://localhost:1234/child.git#e7cca1aeb6415ec51e938d6d26555a0aaa1a1c06","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833340517,"size":143} +42f6e39777d09e9e13f131e1484fd57ab61ac607 {"key":"pacote:packed-dir:git://localhost:1234/child.git#e7cca1aeb6415ec51e938d6d26555a0aaa1a1c06","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833340825,"size":143} +72e90600f6ae2c7fab275f68a155e0ace2ec205b {"key":"pacote:packed-dir:git://localhost:1234/child.git#e7cca1aeb6415ec51e938d6d26555a0aaa1a1c06","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833342148,"size":143} +39bafee4dfbccc66040a143fc9579626be6b6314 {"key":"pacote:packed-dir:git://localhost:1234/child.git#e7cca1aeb6415ec51e938d6d26555a0aaa1a1c06","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833342505,"size":143} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/60/3b/12bd2d0346c46847789322cfa6781845b7bac7c9830246b89d040ab35bfa b/deps/npm/test/npm_cache/_cacache/index-v5/60/3b/12bd2d0346c46847789322cfa6781845b7bac7c9830246b89d040ab35bfa new file mode 100644 index 00000000000000..31528ee49d2401 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/60/3b/12bd2d0346c46847789322cfa6781845b7bac7c9830246b89d040ab35bfa @@ -0,0 +1,5 @@ + +645ac7bc79519c12afa34011d80e6d62b9018851 {"key":"make-fetch-happen:request-cache:http://localhost:1337/@scope%2fcond","integrity":"sha512-9ZHafObjCNyqZyuGJcoEkcr+1nJs7aFv+83T92YeXrWxquK9mZYKyzovzGGhTt/3nde9YQsnxX/qiv9TXbxRnw==","time":1547833095792,"size":419,"metadata":{"url":"http://localhost:1337/@scope%2fcond?write=true","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["d9d4d05d4ef8b79e"],"referer":["deprecate [REDACTED] make it dead"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:15 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +742ff4bf0e34e21880b460496a4c52a0468831ec {"key":"make-fetch-happen:request-cache:http://localhost:1337/@scope%2fcond","integrity":null,"time":1547833095797} +0988bf9b72e018d90be88c7672d0cc06729a67fe {"key":"make-fetch-happen:request-cache:http://localhost:1337/@scope%2fcond","integrity":"sha512-9ZHafObjCNyqZyuGJcoEkcr+1nJs7aFv+83T92YeXrWxquK9mZYKyzovzGGhTt/3nde9YQsnxX/qiv9TXbxRnw==","time":1547833316699,"size":419,"metadata":{"url":"http://localhost:1337/@scope%2fcond?write=true","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["b7783e04af895db5"],"referer":["deprecate [REDACTED] make it dead"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:56 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +9c4251659fab821f2e477bdcfad27bd11d8a52e8 {"key":"make-fetch-happen:request-cache:http://localhost:1337/@scope%2fcond","integrity":null,"time":1547833316704} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/61/41/453946604fdfa210a19eb38d07610e8ad7007ffc3f0f3b25da20b9af281d b/deps/npm/test/npm_cache/_cacache/index-v5/61/41/453946604fdfa210a19eb38d07610e8ad7007ffc3f0f3b25da20b9af281d new file mode 100644 index 00000000000000..d0bfcbb8fec4cf --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/61/41/453946604fdfa210a19eb38d07610e8ad7007ffc3f0f3b25da20b9af281d @@ -0,0 +1,2 @@ + +6f6eea4cf6aed6824de9fbea12656c898d2d35df {"key":"pacote:git-manifest:git://github.com/isaacs/node-glob.git#67bda227fd7a559cca5620307c7d30a6732a792f","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1544485144332,"size":1,"metadata":{"id":"glob@3.1.5","manifest":{"name":"glob","version":"3.1.5","engines":{"node":"*"},"dependencies":{"minimatch":"0.2","graceful-fs":"~1.1.2","inherits":"1"},"optionalDependencies":{},"devDependencies":{"tap":"~0.2.3","mkdirp":"0","rimraf":"1"},"bundleDependencies":["minimatch"],"peerDependencies":{},"deprecated":false,"_resolved":"git://github.com/isaacs/node-glob.git#67bda227fd7a559cca5620307c7d30a6732a792f","_integrity":null,"_shasum":null,"_shrinkwrap":null,"bin":null,"_id":"glob@3.1.5"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/61/5a/c55f3eb9bc8031cdde40de9f1b4244b118714d5d156afca81319c4ed13be b/deps/npm/test/npm_cache/_cacache/index-v5/61/5a/c55f3eb9bc8031cdde40de9f1b4244b118714d5d156afca81319c4ed13be new file mode 100644 index 00000000000000..df333419d2869c --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/61/5a/c55f3eb9bc8031cdde40de9f1b4244b118714d5d156afca81319c4ed13be @@ -0,0 +1,3 @@ + +7b8c6ab3bd4ba738ff44663616fde10740343f61 {"key":"pacote:tag-manifest:http://localhost:1337/optimist/-/optimist-0.6.0.tgz:sha1-aUJIJvNAX3nxQub8PZrljU27kgA=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833046158,"size":1,"metadata":{"id":"optimist@0.6.0","manifest":{"name":"optimist","version":"0.6.0","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","dependencies":{"wordwrap":"~0.0.2","minimist":"~0.0.1"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.4.0"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"readmeFilename":"readme.markdown","bugs":{"url":"https://github.com/substack/node-optimist/issues"},"_id":"optimist@0.6.0","dist":{"shasum":"69424826f3405f79f142e6fc3d9ae58d4dbb9200","tarball":"http://localhost:1337/optimist/-/optimist-0.6.0.tgz"},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{},"_integrity":"sha1-aUJIJvNAX3nxQub8PZrljU27kgA=","_shasum":"69424826f3405f79f142e6fc3d9ae58d4dbb9200","_resolved":"http://localhost:1337/optimist/-/optimist-0.6.0.tgz","optionalDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_shrinkwrap":null,"bin":null,"homepage":"https://github.com/substack/node-optimist#readme"},"type":"finalized-manifest"}} +1540775aafe8f75c1484a63b8ffa068eb2b5a0ec {"key":"pacote:tag-manifest:http://localhost:1337/optimist/-/optimist-0.6.0.tgz:sha1-aUJIJvNAX3nxQub8PZrljU27kgA=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833263489,"size":1,"metadata":{"id":"optimist@0.6.0","manifest":{"name":"optimist","version":"0.6.0","description":"Light-weight option parsing with an argv hash. No optstrings attached.","main":"./index.js","dependencies":{"wordwrap":"~0.0.2","minimist":"~0.0.1"},"devDependencies":{"hashish":"~0.0.4","tap":"~0.4.0"},"scripts":{"test":"tap ./test/*.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/substack/node-optimist.git"},"keywords":["argument","args","option","parser","parsing","cli","command"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"readmeFilename":"readme.markdown","bugs":{"url":"https://github.com/substack/node-optimist/issues"},"_id":"optimist@0.6.0","dist":{"shasum":"69424826f3405f79f142e6fc3d9ae58d4dbb9200","tarball":"http://localhost:1337/optimist/-/optimist-0.6.0.tgz"},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{},"_integrity":"sha1-aUJIJvNAX3nxQub8PZrljU27kgA=","_shasum":"69424826f3405f79f142e6fc3d9ae58d4dbb9200","_resolved":"http://localhost:1337/optimist/-/optimist-0.6.0.tgz","optionalDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_shrinkwrap":null,"bin":null,"homepage":"https://github.com/substack/node-optimist#readme"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/64/32/09fccfaff76a1d99becccff3c9a0701f54d94e18ea19ff39aeb0a235d833 b/deps/npm/test/npm_cache/_cacache/index-v5/64/32/09fccfaff76a1d99becccff3c9a0701f54d94e18ea19ff39aeb0a235d833 new file mode 100644 index 00000000000000..38f2d89214afe0 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/64/32/09fccfaff76a1d99becccff3c9a0701f54d94e18ea19ff39aeb0a235d833 @@ -0,0 +1,4 @@ + +9be8adb9750c1eeda100a984b4c4ba96a2f823a8 {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist/-/minimist-0.0.5.tgz","integrity":"sha1-16oye87PUY+RBqxrjwA/o7zqhWY=","time":1547833073422,"size":5977,"metadata":{"url":"http://localhost:1337/minimist/-/minimist-0.0.5.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:minimist@http://localhost:1337/minimist/-/minimist-0.0.5.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +d93a297ad0b70077d34ae37fb280331124cbc8a3 {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist/-/minimist-0.0.5.tgz","integrity":"sha1-16oye87PUY+RBqxrjwA/o7zqhWY=","time":1547833073424,"size":5977,"metadata":{"url":"http://localhost:1337/minimist/-/minimist-0.0.5.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:minimist@http://localhost:1337/minimist/-/minimist-0.0.5.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +3395cf4593e324ddc0551640bbbb08ee5ffffabe {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist/-/minimist-0.0.5.tgz","integrity":"sha1-16oye87PUY+RBqxrjwA/o7zqhWY=","time":1547833093352,"size":5977,"metadata":{"url":"http://localhost:1337/minimist/-/minimist-0.0.5.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcd144259ba74815"],"referer":["install ."],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:minimist@http://localhost:1337/minimist/-/minimist-0.0.5.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/69/d2/6f1c982c4935f9c4a3b7181092bc6213963acf08be267556eed18c1ffcca b/deps/npm/test/npm_cache/_cacache/index-v5/69/d2/6f1c982c4935f9c4a3b7181092bc6213963acf08be267556eed18c1ffcca new file mode 100644 index 00000000000000..a4a87f51079216 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/69/d2/6f1c982c4935f9c4a3b7181092bc6213963acf08be267556eed18c1ffcca @@ -0,0 +1,4 @@ + +96c65273a5ca1e21de2ce14438e44bb84f5d6cc9 {"key":"pacote:packed-dir:git+file:///Users/zkat/Documents/code/work/npm/test/tap/add-remote-git-file/child.git#0274b9beca938a08345b32346159404f4bfa11a6","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833220799,"size":143} +d9c9328edc8966662239117fb0fb28274ec71617 {"key":"pacote:packed-dir:git+file:///Users/zkat/Documents/code/work/npm/test/tap/add-remote-git-file/child.git#0274b9beca938a08345b32346159404f4bfa11a6","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833221078,"size":143} +61d7a4e8be9f49766fa77d1b77e50bb54f489957 {"key":"pacote:packed-dir:git+file:///Users/zkat/Documents/code/work/npm/test/tap/add-remote-git-file/child.git#0274b9beca938a08345b32346159404f4bfa11a6","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833221359,"size":143} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/6b/27/515478d59b0ba28fcdaffd08317ec59071d08bdedd169a5f40c3b1fbb486 b/deps/npm/test/npm_cache/_cacache/index-v5/6b/27/515478d59b0ba28fcdaffd08317ec59071d08bdedd169a5f40c3b1fbb486 new file mode 100644 index 00000000000000..6a82a8316c4e01 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/6b/27/515478d59b0ba28fcdaffd08317ec59071d08bdedd169a5f40c3b1fbb486 @@ -0,0 +1,11 @@ + +c6f1e919801eb202acec5e74928931bfc0143d31 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/v1/login","integrity":null,"time":1547833009006} +81cb054ce7796a70d8eaded1dde6972fe29b8ec4 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/v1/login","integrity":null,"time":1547833012642} +0ceb1208bc12f21a1d651c13bf6bcad472d4a6f1 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/v1/login","integrity":null,"time":1547833013368} +dca7833202363dbffe65c00831707c67a235f345 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/v1/login","integrity":null,"time":1547833014038} +6ad6d7cab6ef9889434ffecfdf63caeaf80e89bf {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/v1/login","integrity":null,"time":1547833015068} +94adb474d9ee1b64473f30866b78ed74e5ea17dd {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/v1/login","integrity":null,"time":1547833229637} +c6f5a95c906827450801dd0a40cbe608b21e4de4 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/v1/login","integrity":null,"time":1547833232597} +e8203d86ee56303325ad8e3120905eb6466b63ce {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/v1/login","integrity":null,"time":1547833233300} +ab06232cf2023f61b7c15b9e13d167add7978000 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/v1/login","integrity":null,"time":1547833233886} +a737b363f7c939ce9cf107f81561bec15e3da935 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/v1/login","integrity":null,"time":1547833234785} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/6f/d4/db68ad12df42b50094e39edbd34fc9713c6c020ca44a5a0b426ff048428d b/deps/npm/test/npm_cache/_cacache/index-v5/6f/d4/db68ad12df42b50094e39edbd34fc9713c6c020ca44a5a0b426ff048428d new file mode 100644 index 00000000000000..ca32376a4c7305 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/6f/d4/db68ad12df42b50094e39edbd34fc9713c6c020ca44a5a0b426ff048428d @@ -0,0 +1,2 @@ + +962e11576a5c5c11ed45044a865b9b2ec3e5faa0 {"key":"pacote:range-manifest:http://localhost:1337/checker/-/checker-0.5.2.tgz:sha1-wno2vwDzp6PSSo+8eFPwb85OnIY=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833073433,"size":1,"metadata":{"id":"checker@0.5.2","manifest":{"name":"checker","version":"0.5.2","dependencies":{"async":"~0.2.9"},"optionalDependencies":{},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/checker/-/checker-0.5.2.tgz","_integrity":"sha1-wno2vwDzp6PSSo+8eFPwb85OnIY=","_shasum":"c27a36bf00f3a7a3d24a8fbc7853f06fce4e9c86","_shrinkwrap":null,"bin":null,"_id":"checker@0.5.2"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/6f/ed/7f64617d06ba2145efd7117d088c8431300750cd1c934e227cfecffa01f5 b/deps/npm/test/npm_cache/_cacache/index-v5/6f/ed/7f64617d06ba2145efd7117d088c8431300750cd1c934e227cfecffa01f5 new file mode 100644 index 00000000000000..382f6a83f88ca1 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/6f/ed/7f64617d06ba2145efd7117d088c8431300750cd1c934e227cfecffa01f5 @@ -0,0 +1,3 @@ + +ab2809233a72dbf06c79d9a3b11458fc00e6c239 {"key":"make-fetch-happen:request-cache:http://localhost:1337/npm-test-peer-deps","integrity":"sha512-h0Rmy0bQOcyRK9PuKb+ul6x/TdQFHNJAwbJVSHR/nxxv3DoqnmWwWKso8KIrSq7lgHXgx3/QDd9lZTa8VDKQvg==","time":1547833046941,"size":880,"metadata":{"url":"http://localhost:1337/npm-test-peer-deps","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["ece3b5a000cc3f02"],"referer":["bugs npm-test-peer-deps"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:npm-test-peer-deps"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:26 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +7ffd6078274f24f79c05c5de54520938b245d5ba {"key":"make-fetch-happen:request-cache:http://localhost:1337/npm-test-peer-deps","integrity":"sha512-h0Rmy0bQOcyRK9PuKb+ul6x/TdQFHNJAwbJVSHR/nxxv3DoqnmWwWKso8KIrSq7lgHXgx3/QDd9lZTa8VDKQvg==","time":1547833264138,"size":880,"metadata":{"url":"http://localhost:1337/npm-test-peer-deps","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["836b89e1cc0594ec"],"referer":["bugs npm-test-peer-deps"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:npm-test-peer-deps"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:04 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/77/52/b7394cb3a27a44448e3ac4d6834e73ca79c301c7108c94b0ba23ca97b71c b/deps/npm/test/npm_cache/_cacache/index-v5/77/52/b7394cb3a27a44448e3ac4d6834e73ca79c301c7108c94b0ba23ca97b71c new file mode 100644 index 00000000000000..8f51fb1caabba7 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/77/52/b7394cb3a27a44448e3ac4d6834e73ca79c301c7108c94b0ba23ca97b71c @@ -0,0 +1,3 @@ + +63aa615e0b263925ea3c7db1d18d2d7bbc2a6bf1 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/npm/v1/hooks","integrity":"sha512-djlLN4USxovyCbQz4Gtx3yekX357418XSg+DvOd5lii3Tb6ZPBixwS6Jmh7XsVlHCzghgNHwpcQJisYJLNoajw==","time":1547833362916,"size":206,"metadata":{"url":"http://localhost:1337/-/npm/v1/hooks?package=%40npm%2Fhooks","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["ae73fff74c690e4c"],"referer":["hook ls [REDACTED]"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"date":["Fri, 18 Jan 2019 17:42:42 GMT"],"connection":["keep-alive"],"content-length":["206"],"x-fetch-attempts":["1"]}}} +4fc4f4c828362c6649a93b7a68fc379f2154d781 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/npm/v1/hooks","integrity":"sha512-8+gtagt1rVzr0JF32T9XLb2Lh37p8VBbLoTgOBD6BBLkkEBgvn0qTfQiGxu5KITbiGgmv4zSZjRmei0QOpmUOA==","time":1547833363585,"size":52,"metadata":{"url":"http://localhost:1337/-/npm/v1/hooks?package=%40npm%2Fhooks","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["a9b65a6eaec4099e"],"referer":["hook ls [REDACTED]"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"date":["Fri, 18 Jan 2019 17:42:43 GMT"],"connection":["keep-alive"],"content-length":["52"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/80/e4/0b59aa33a0f8b0f183dcbcdf1d48b9436619bf5b6fd10474ef86e41a8c6f b/deps/npm/test/npm_cache/_cacache/index-v5/80/e4/0b59aa33a0f8b0f183dcbcdf1d48b9436619bf5b6fd10474ef86e41a8c6f new file mode 100644 index 00000000000000..9accb7b18dba92 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/80/e4/0b59aa33a0f8b0f183dcbcdf1d48b9436619bf5b6fd10474ef86e41a8c6f @@ -0,0 +1,3 @@ + +e36fdaa97d141c124f0a70c1724c460e93c338f4 {"key":"pacote:tag-manifest:http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz:sha1-4FAI8/+Cs08XselyRUoKtwomnH0=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833048539,"size":1,"metadata":{"id":"test-repo-url-https@0.0.1","manifest":{"name":"test-repo-url-https","version":"0.0.1","description":"Test repo with non-github https repository url","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://gitlab.com/evanlucas/test-repo-url-https.git"},"author":{"name":"Evan Lucas","email":"evanlucas@me.com"},"license":"ISC","_id":"test-repo-url-https@0.0.1","dist":{"shasum":"e05008f3ff82b34f17b1e972454a0ab70a269c7d","tarball":"http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"evanlucas","email":"evanlucas@me.com"},"maintainers":[{"name":"evanlucas","email":"evanlucas@me.com"}],"directories":{},"_integrity":"sha1-4FAI8/+Cs08XselyRUoKtwomnH0=","_shasum":"e05008f3ff82b34f17b1e972454a0ab70a269c7d","_resolved":"http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_shrinkwrap":null,"bin":null,"bugs":{"url":"https://gitlab.com/evanlucas/test-repo-url-https/issues"},"homepage":"https://gitlab.com/evanlucas/test-repo-url-https#readme"},"type":"finalized-manifest"}} +47b05a03fabaabfdcb4df36e899d517be2ea80eb {"key":"pacote:tag-manifest:http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz:sha1-4FAI8/+Cs08XselyRUoKtwomnH0=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833265549,"size":1,"metadata":{"id":"test-repo-url-https@0.0.1","manifest":{"name":"test-repo-url-https","version":"0.0.1","description":"Test repo with non-github https repository url","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://gitlab.com/evanlucas/test-repo-url-https.git"},"author":{"name":"Evan Lucas","email":"evanlucas@me.com"},"license":"ISC","_id":"test-repo-url-https@0.0.1","dist":{"shasum":"e05008f3ff82b34f17b1e972454a0ab70a269c7d","tarball":"http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"evanlucas","email":"evanlucas@me.com"},"maintainers":[{"name":"evanlucas","email":"evanlucas@me.com"}],"directories":{},"_integrity":"sha1-4FAI8/+Cs08XselyRUoKtwomnH0=","_shasum":"e05008f3ff82b34f17b1e972454a0ab70a269c7d","_resolved":"http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_shrinkwrap":null,"bin":null,"bugs":{"url":"https://gitlab.com/evanlucas/test-repo-url-https/issues"},"homepage":"https://gitlab.com/evanlucas/test-repo-url-https#readme"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/87/c9/f8b19f8ad4e5648c18927a0d7d21e557756b443699e6929fe420d5aa82a2 b/deps/npm/test/npm_cache/_cacache/index-v5/87/c9/f8b19f8ad4e5648c18927a0d7d21e557756b443699e6929fe420d5aa82a2 new file mode 100644 index 00000000000000..da95f703b8e0bb --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/87/c9/f8b19f8ad4e5648c18927a0d7d21e557756b443699e6929fe420d5aa82a2 @@ -0,0 +1,2 @@ + +30ea947fa3199c5e9fa3c7117767f9437a1bf2e4 {"key":"pacote:version-manifest:http://localhost:1337/checker/-/checker-0.5.2.tgz:sha1-wno2vwDzp6PSSo+8eFPwb85OnIY=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833093307,"size":1,"metadata":{"id":"checker@0.5.2","manifest":{"name":"checker","version":"0.5.2","dependencies":{"async":"~0.2.9"},"optionalDependencies":{},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/checker/-/checker-0.5.2.tgz","_integrity":"sha1-wno2vwDzp6PSSo+8eFPwb85OnIY=","_shasum":"c27a36bf00f3a7a3d24a8fbc7853f06fce4e9c86","_shrinkwrap":null,"bin":null,"_id":"checker@0.5.2"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/89/eb/a7a81ab3eeec3076546f7e1fce3892c4e717a9379d4ad43a7111b5dc8cc2 b/deps/npm/test/npm_cache/_cacache/index-v5/89/eb/a7a81ab3eeec3076546f7e1fce3892c4e717a9379d4ad43a7111b5dc8cc2 new file mode 100644 index 00000000000000..c8a7e1cc641314 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/89/eb/a7a81ab3eeec3076546f7e1fce3892c4e717a9379d4ad43a7111b5dc8cc2 @@ -0,0 +1,3 @@ + +7adceb1265ebb2ace488f13aa3b15b59f0f01dbf {"key":"pacote:packed-dir:git://github.com/isaacs/canonical-host.git#7d5ad6eda4ca2948f890b1d8169bc1029bf62364","integrity":"sha512-LOyK+tCWYYrmCtnNHPLS2dVZe2gBDMCHyaeHZe8NrNJcE6DjaUiUkxfwn2ZydO5fpxSr3BsVjlz+pcpUAWY0JQ==","time":1544485146869,"size":5787} +98a0e48f468ef1264acc4ad8ca234465f95411af {"key":"pacote:packed-dir:git://github.com/isaacs/canonical-host.git#7d5ad6eda4ca2948f890b1d8169bc1029bf62364","integrity":"sha512-LOyK+tCWYYrmCtnNHPLS2dVZe2gBDMCHyaeHZe8NrNJcE6DjaUiUkxfwn2ZydO5fpxSr3BsVjlz+pcpUAWY0JQ==","time":1544485150074,"size":5787} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/8b/2e/99af1be8f0aa3d6223b000c96edea31a1e6d923f7f3daf1ff06e04899cbb b/deps/npm/test/npm_cache/_cacache/index-v5/8b/2e/99af1be8f0aa3d6223b000c96edea31a1e6d923f7f3daf1ff06e04899cbb new file mode 100644 index 00000000000000..8a607552072a75 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/8b/2e/99af1be8f0aa3d6223b000c96edea31a1e6d923f7f3daf1ff06e04899cbb @@ -0,0 +1,3 @@ + +2cde6a16e5c38cc59035af402d47d758775c332b {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/package","integrity":"sha512-3Cqk30LNQ1Yj9MLD4nT6CBzJQv9F3PqYzfSpMktqIcNyHDS7l+aAnuKAUfwQ9XdJz/YKqXCh44x6bDVKlANVTg==","time":1547832990867,"size":39,"metadata":{"url":"http://localhost:1337/-/org/myorg/package?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["3130fc09c51bc7e6"],"referer":["access ls-packages myorg"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:30 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +f20d476c9d4375fd8d85195b984301b7795edbf2 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/package","integrity":"sha512-3Cqk30LNQ1Yj9MLD4nT6CBzJQv9F3PqYzfSpMktqIcNyHDS7l+aAnuKAUfwQ9XdJz/YKqXCh44x6bDVKlANVTg==","time":1547833214654,"size":39,"metadata":{"url":"http://localhost:1337/-/org/myorg/package?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["bb74308033dfab7e"],"referer":["access ls-packages myorg"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:14 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/8c/cf/08c44da29714d229eaceaad1d0ca321b8e5cc8080001efa90bd6e7cf2d10 b/deps/npm/test/npm_cache/_cacache/index-v5/8c/cf/08c44da29714d229eaceaad1d0ca321b8e5cc8080001efa90bd6e7cf2d10 new file mode 100644 index 00000000000000..4c93a0cfde066c --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/8c/cf/08c44da29714d229eaceaad1d0ca321b8e5cc8080001efa90bd6e7cf2d10 @@ -0,0 +1,3 @@ + +afa0c7f53e253a126cb28e830d7a278045895c8c {"key":"pacote:file-manifest:/Users/zkat/Documents/code/work/npm/test/tap/bundled-dependencies-nonarray/a-bundled-dep-2.0.0.tgz:sha512-qoZzDskyzbDwXbLzXh5Fb8mG2xn4P7P4FApYUUEfvPRJZjKEeasoDMgK4tdAzcAfj4gINqAMZnQ1ZazS6DUueg==","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833057466,"size":1,"metadata":{"id":"a-bundled-dep@2.0.0","manifest":{"name":"a-bundled-dep","version":"2.0.0","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"/Users/zkat/Documents/code/work/npm/test/tap/bundled-dependencies-nonarray/a-bundled-dep-2.0.0.tgz","_integrity":"sha512-qoZzDskyzbDwXbLzXh5Fb8mG2xn4P7P4FApYUUEfvPRJZjKEeasoDMgK4tdAzcAfj4gINqAMZnQ1ZazS6DUueg==","_shasum":"ffb9090887f8d12db11019efe29fd9c145533a64","_shrinkwrap":null,"bin":null,"_id":"a-bundled-dep@2.0.0"},"type":"finalized-manifest"}} +61b8f5be08fc715ef01e281391909246cfcbf497 {"key":"pacote:file-manifest:/Users/zkat/Documents/code/work/npm/test/tap/bundled-dependencies-nonarray/a-bundled-dep-2.0.0.tgz:sha512-qoZzDskyzbDwXbLzXh5Fb8mG2xn4P7P4FApYUUEfvPRJZjKEeasoDMgK4tdAzcAfj4gINqAMZnQ1ZazS6DUueg==","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833274133,"size":1,"metadata":{"id":"a-bundled-dep@2.0.0","manifest":{"name":"a-bundled-dep","version":"2.0.0","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"/Users/zkat/Documents/code/work/npm/test/tap/bundled-dependencies-nonarray/a-bundled-dep-2.0.0.tgz","_integrity":"sha512-qoZzDskyzbDwXbLzXh5Fb8mG2xn4P7P4FApYUUEfvPRJZjKEeasoDMgK4tdAzcAfj4gINqAMZnQ1ZazS6DUueg==","_shasum":"ffb9090887f8d12db11019efe29fd9c145533a64","_shrinkwrap":null,"bin":null,"_id":"a-bundled-dep@2.0.0"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/8e/53/8602d3aab48229cac8aeeb996d0c850341d8e832b38df45ce8b79f2d7f6a b/deps/npm/test/npm_cache/_cacache/index-v5/8e/53/8602d3aab48229cac8aeeb996d0c850341d8e832b38df45ce8b79f2d7f6a new file mode 100644 index 00000000000000..865ea6d95c2fed --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/8e/53/8602d3aab48229cac8aeeb996d0c850341d8e832b38df45ce8b79f2d7f6a @@ -0,0 +1,5 @@ + +86d07b775b7611ca1aea90abb40520f70359c2db {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags/c","integrity":null,"time":1547833100971} +fb2e849aa1afeb0f116eaf13831ec87542f606ad {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags/c","integrity":null,"time":1547833102196} +043fc0b8159c4cc7a460fb822f806aae3e42f159 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags/c","integrity":null,"time":1547833321327} +eb7ad592957eaef3efa2bf494179785031af811e {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags/c","integrity":null,"time":1547833322473} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/93/4e/425c049345ed549becd9e42f3ca7ad942331f73dd73c3e6f5549e910679b b/deps/npm/test/npm_cache/_cacache/index-v5/93/4e/425c049345ed549becd9e42f3ca7ad942331f73dd73c3e6f5549e910679b new file mode 100644 index 00000000000000..6467ee12d69ddd --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/93/4e/425c049345ed549becd9e42f3ca7ad942331f73dd73c3e6f5549e910679b @@ -0,0 +1,3 @@ + +aa600b0670543e98b0c7d38abca19b04ab212c41 {"key":"make-fetch-happen:request-cache:https://codeload.github.com/substack/jsonify/legacy.tar.gz/master","integrity":"sha1-7laKKx7665W+xNnlnlMB/GMzmGY=","time":1544485146877,"size":4733,"metadata":{"url":"https://codeload.github.com/substack/jsonify/legacy.tar.gz/master","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.5.0 node/v10.14.1 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["8afff98d6d30632a"],"pacote-pkg-id":["registry:undefined@https://github.com/substack/jsonify/tarball/master"],"pacote-req-type":["tarball"],"referer":["install [REDACTED]"]},"resHeaders":{"transfer-encoding":["chunked"],"access-control-allow-origin":["https://render.githubusercontent.com"],"content-security-policy":["default-src 'none'; style-src 'unsafe-inline'; sandbox"],"strict-transport-security":["max-age=31536000"],"vary":["Authorization,Accept-Encoding"],"x-content-type-options":["nosniff"],"x-frame-options":["deny"],"x-xss-protection":["1; mode=block"],"etag":["\"7064ab53e5f73fa31e2ce7aa47d210c539662f16\""],"content-type":["application/x-gzip"],"content-disposition":["attachment; filename=substack-jsonify-7064ab5.tar.gz"],"x-geo-block-list":[""],"date":["Mon, 10 Dec 2018 23:39:06 GMT"],"x-github-request-id":["EE37:2F59:46593:BB61F:5C0EF91A"],"x-fetch-attempts":["1"]}}} +daad1e6a48c667add8dbded2d3d19d15821df7a6 {"key":"make-fetch-happen:request-cache:https://codeload.github.com/substack/jsonify/legacy.tar.gz/master","integrity":"sha512-LjZI+XaDCuq6BySzgqCaamc239THVZY6T0Yvlj+eyyEcIljwB2bcOqaGZPZtOgHLJ4myz2FK6yktvrSv4LIGzA==","time":1544485149788,"size":4733,"metadata":{"url":"https://codeload.github.com/substack/jsonify/legacy.tar.gz/master","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.5.0 node/v10.14.1 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["8afff98d6d30632a"],"pacote-pkg-id":["registry:undefined@https://github.com/substack/jsonify/tarball/master"],"pacote-req-type":["tarball"],"referer":["install [REDACTED]"]},"resHeaders":{"transfer-encoding":["chunked"],"access-control-allow-origin":["https://render.githubusercontent.com"],"content-security-policy":["default-src 'none'; style-src 'unsafe-inline'; sandbox"],"strict-transport-security":["max-age=31536000"],"vary":["Authorization,Accept-Encoding"],"x-content-type-options":["nosniff"],"x-frame-options":["deny"],"x-xss-protection":["1; mode=block"],"etag":["\"7064ab53e5f73fa31e2ce7aa47d210c539662f16\""],"content-type":["application/x-gzip"],"content-disposition":["attachment; filename=substack-jsonify-7064ab5.tar.gz"],"x-geo-block-list":[""],"date":["Mon, 10 Dec 2018 23:39:09 GMT"],"x-github-request-id":["EE37:2F59:46596:BB622:5C0EF91A"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/96/66/5a9f2d90e8428d5b30418640b55c06029c2d36a3dc34ee91b90483a9973d b/deps/npm/test/npm_cache/_cacache/index-v5/96/66/5a9f2d90e8428d5b30418640b55c06029c2d36a3dc34ee91b90483a9973d new file mode 100644 index 00000000000000..7ac314ca71ceac --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/96/66/5a9f2d90e8428d5b30418640b55c06029c2d36a3dc34ee91b90483a9973d @@ -0,0 +1,3 @@ + +7f23855ebb1664944fac018738f56c84f2dc5458 {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz","integrity":"sha1-KncwfhCL+1cQfEwzSrte9Tldxoo=","time":1547833049336,"size":364,"metadata":{"url":"http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["0057a2b51b6e5b0a"],"referer":["bugs test-repo-url-ssh"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:test-repo-url-ssh@http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:29 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +ef49c09f1ae22cfdd8adeb94e6204f473d793e39 {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz","integrity":"sha1-KncwfhCL+1cQfEwzSrte9Tldxoo=","time":1547833266224,"size":364,"metadata":{"url":"http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["1b2e5a88bc1db2e9"],"referer":["bugs test-repo-url-ssh"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:test-repo-url-ssh@http://localhost:1337/test-repo-url-ssh/-/test-repo-url-ssh-0.0.1.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:06 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/9b/00/38d905a4cf8b1a291d0a7bca660b3b4f409bea196a8cea3f3e66c5a8e84b b/deps/npm/test/npm_cache/_cacache/index-v5/9b/00/38d905a4cf8b1a291d0a7bca660b3b4f409bea196a8cea3f3e66c5a8e84b new file mode 100644 index 00000000000000..333f93067bbb32 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/9b/00/38d905a4cf8b1a291d0a7bca660b3b4f409bea196a8cea3f3e66c5a8e84b @@ -0,0 +1,5 @@ + +81324d43613be05eddb8115659e2d90ef03496eb {"key":"pacote:packed-dir:git://localhost:1234/top.git#9e4db86f79e3dcb0cafe10d5f8f1e2de7a8cb9c9","integrity":"sha512-VJX+hA7b9dGN/CfF9NmzWeirgaR0H2Kw3rIJeTWYQ4KK5QESusTiWj/BCJ0mD9m4I25DSjpVWAt6q6Np5vi6hw==","time":1547833003642,"size":283} +221db6f36f5ddc4a83a4249ec9a7b2ecec9b8590 {"key":"pacote:packed-dir:git://localhost:1234/top.git#9e4db86f79e3dcb0cafe10d5f8f1e2de7a8cb9c9","integrity":"sha512-VJX+hA7b9dGN/CfF9NmzWeirgaR0H2Kw3rIJeTWYQ4KK5QESusTiWj/BCJ0mD9m4I25DSjpVWAt6q6Np5vi6hw==","time":1547833004271,"size":283} +35ea9b8ae3e33e5e3606f790fa48c1055e0b18b3 {"key":"pacote:packed-dir:git://localhost:1234/top.git#9e4db86f79e3dcb0cafe10d5f8f1e2de7a8cb9c9","integrity":"sha512-VJX+hA7b9dGN/CfF9NmzWeirgaR0H2Kw3rIJeTWYQ4KK5QESusTiWj/BCJ0mD9m4I25DSjpVWAt6q6Np5vi6hw==","time":1547833004908,"size":283} +524e1e8e8d9a690cb02d5fbd029cf1b15b61cf9b {"key":"pacote:packed-dir:git://localhost:1234/top.git#9e4db86f79e3dcb0cafe10d5f8f1e2de7a8cb9c9","integrity":"sha512-VJX+hA7b9dGN/CfF9NmzWeirgaR0H2Kw3rIJeTWYQ4KK5QESusTiWj/BCJ0mD9m4I25DSjpVWAt6q6Np5vi6hw==","time":1547833005495,"size":283} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/9b/03/54636aae9cb55a079d1cc7f9caf4f3e654df7abd1fc8279dde9f935c76aa b/deps/npm/test/npm_cache/_cacache/index-v5/9b/03/54636aae9cb55a079d1cc7f9caf4f3e654df7abd1fc8279dde9f935c76aa new file mode 100644 index 00000000000000..bd9c30d6a2a566 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/9b/03/54636aae9cb55a079d1cc7f9caf4f3e654df7abd1fc8279dde9f935c76aa @@ -0,0 +1,5 @@ + +7b38c2b7bb46182c0bef0cad488df298d4cc4df1 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/whoami","integrity":"sha512-6DaJqcIayTwqDvx+U2klAE5Si9O/66cIz1IW25mcXvzg1xOKfm7O2xJeQ7oq60ddWViiyjH0jGoUQvFk6Qo6Ig==","time":1547833016915,"size":25,"metadata":{"url":"http://localhost:1337/-/whoami","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["1b1860266820cd60"],"referer":["adduser"],"authorization":["Bearer foo"]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:56 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +827995ba80d0a09d195f4c6ba887cfbbab632a08 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/whoami","integrity":"sha512-6DaJqcIayTwqDvx+U2klAE5Si9O/66cIz1IW25mcXvzg1xOKfm7O2xJeQ7oq60ddWViiyjH0jGoUQvFk6Qo6Ig==","time":1547833018622,"size":25,"metadata":{"url":"http://localhost:1337/-/whoami","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["17b1054485dce89c"],"referer":["adduser"],"authorization":["Bearer foo"]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:58 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +30d09ec90a7fc5c17cd4bf637cf0354f29bede2f {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/whoami","integrity":"sha512-6DaJqcIayTwqDvx+U2klAE5Si9O/66cIz1IW25mcXvzg1xOKfm7O2xJeQ7oq60ddWViiyjH0jGoUQvFk6Qo6Ig==","time":1547833236392,"size":25,"metadata":{"url":"http://localhost:1337/-/whoami","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["883d0ceea29e732e"],"referer":["adduser"],"authorization":["Bearer foo"]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:36 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +f4e40cd490abf1b55d3c5b747c37cf434fff61d1 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/whoami","integrity":"sha512-6DaJqcIayTwqDvx+U2klAE5Si9O/66cIz1IW25mcXvzg1xOKfm7O2xJeQ7oq60ddWViiyjH0jGoUQvFk6Qo6Ig==","time":1547833237880,"size":25,"metadata":{"url":"http://localhost:1337/-/whoami","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["9c397efd8f029f31"],"referer":["adduser"],"authorization":["Bearer foo"]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:37 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/9c/df/2bf910aa7cba3cae28d9c34ba6cd492e2a0053b4aeea258df6763e8cd8a2 b/deps/npm/test/npm_cache/_cacache/index-v5/9c/df/2bf910aa7cba3cae28d9c34ba6cd492e2a0053b4aeea258df6763e8cd8a2 new file mode 100644 index 00000000000000..9c9e57d2dabf67 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/9c/df/2bf910aa7cba3cae28d9c34ba6cd492e2a0053b4aeea258df6763e8cd8a2 @@ -0,0 +1,9 @@ + +c8c512129461bf5bf6c12d3bf65d3db0dee072e5 {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist","integrity":"sha512-7fwtedDVW/TqArdOzDZX6oM7xtBXitsuH1rg1zOwmkhPjnKHkBV4x72qXW/TCsTepIdzphDKbuHgnjH2FH6SHQ==","time":1547833046108,"size":123815,"metadata":{"url":"http://localhost:1337/optimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["829b1dc23689fa30"],"referer":["bugs optimist"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:optimist"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:26 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +8143a4aff9dc3a1fe3e919397314168e02887d05 {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist","integrity":"sha512-7fwtedDVW/TqArdOzDZX6oM7xtBXitsuH1rg1zOwmkhPjnKHkBV4x72qXW/TCsTepIdzphDKbuHgnjH2FH6SHQ==","time":1547833073341,"size":123815,"metadata":{"url":"http://localhost:1337/optimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:optimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +22750763814933396f3b0af93f96699c2a461566 {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist","integrity":"sha512-7fwtedDVW/TqArdOzDZX6oM7xtBXitsuH1rg1zOwmkhPjnKHkBV4x72qXW/TCsTepIdzphDKbuHgnjH2FH6SHQ==","time":1547833079800,"size":123815,"metadata":{"url":"http://localhost:1337/optimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["d19ab2d4de48cace"],"referer":["install optimist"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:optimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:59 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +a43ce8446c2bc2394574224e4eab85ca71398f2d {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist","integrity":"sha512-7fwtedDVW/TqArdOzDZX6oM7xtBXitsuH1rg1zOwmkhPjnKHkBV4x72qXW/TCsTepIdzphDKbuHgnjH2FH6SHQ==","time":1547833093362,"size":123815,"metadata":{"url":"http://localhost:1337/optimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcd144259ba74815"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:optimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +c76762edb49942e9fd6ac9b94812e7e04c9209c2 {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist","integrity":"sha512-7fwtedDVW/TqArdOzDZX6oM7xtBXitsuH1rg1zOwmkhPjnKHkBV4x72qXW/TCsTepIdzphDKbuHgnjH2FH6SHQ==","time":1547833263459,"size":123815,"metadata":{"url":"http://localhost:1337/optimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["5735fc1a8674c7f7"],"referer":["bugs optimist"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:optimist"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:03 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +79c9c9829c39aabe6bfb55a6b4f8f314bfca8d65 {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist","integrity":"sha512-7fwtedDVW/TqArdOzDZX6oM7xtBXitsuH1rg1zOwmkhPjnKHkBV4x72qXW/TCsTepIdzphDKbuHgnjH2FH6SHQ==","time":1547833294122,"size":123815,"metadata":{"url":"http://localhost:1337/optimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["0a92a1a2bc33028a"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:optimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:34 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +832428c8a63fee4a20594fa4ed73f56f1bd686b0 {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist","integrity":"sha512-7fwtedDVW/TqArdOzDZX6oM7xtBXitsuH1rg1zOwmkhPjnKHkBV4x72qXW/TCsTepIdzphDKbuHgnjH2FH6SHQ==","time":1547833301193,"size":123815,"metadata":{"url":"http://localhost:1337/optimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["f4c81daeaa866c45"],"referer":["install optimist"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:optimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:41 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +149425ba494b07fca3f55079eef5dada2525c00a {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist","integrity":"sha512-7fwtedDVW/TqArdOzDZX6oM7xtBXitsuH1rg1zOwmkhPjnKHkBV4x72qXW/TCsTepIdzphDKbuHgnjH2FH6SHQ==","time":1547833314443,"size":123815,"metadata":{"url":"http://localhost:1337/optimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["ce2c0b941f6a62b8"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:optimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:54 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/9f/3f/3bc8b783702f297c0e0f134ecf35495d997ad1c67532fe520ac6709d28c5 b/deps/npm/test/npm_cache/_cacache/index-v5/9f/3f/3bc8b783702f297c0e0f134ecf35495d997ad1c67532fe520ac6709d28c5 new file mode 100644 index 00000000000000..1a67dcf697592a --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/9f/3f/3bc8b783702f297c0e0f134ecf35495d997ad1c67532fe520ac6709d28c5 @@ -0,0 +1,4 @@ + +8b72fc4a000ffb83714893ab799fbc8b84e035af {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist/-/optimist-0.6.0.tgz","integrity":"sha1-aUJIJvNAX3nxQub8PZrljU27kgA=","time":1547833046141,"size":12142,"metadata":{"url":"http://localhost:1337/optimist/-/optimist-0.6.0.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["829b1dc23689fa30"],"referer":["bugs optimist"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:optimist@http://localhost:1337/optimist/-/optimist-0.6.0.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:26 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +3d5e00fcad8a195890beaa5ebd8191db35438d03 {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist/-/optimist-0.6.0.tgz","integrity":"sha1-aUJIJvNAX3nxQub8PZrljU27kgA=","time":1547833073368,"size":12142,"metadata":{"url":"http://localhost:1337/optimist/-/optimist-0.6.0.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:optimist@http://localhost:1337/optimist/-/optimist-0.6.0.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +cbcbecbdc61e341bbef8203ba99b22f50edcbf61 {"key":"make-fetch-happen:request-cache:http://localhost:1337/optimist/-/optimist-0.6.0.tgz","integrity":"sha1-aUJIJvNAX3nxQub8PZrljU27kgA=","time":1547833263481,"size":12142,"metadata":{"url":"http://localhost:1337/optimist/-/optimist-0.6.0.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["5735fc1a8674c7f7"],"referer":["bugs optimist"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:optimist@http://localhost:1337/optimist/-/optimist-0.6.0.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:03 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/9f/5f/7b93b3b7f757730e79213f4cb7e73c072a15544da364e543df7bef989d9c b/deps/npm/test/npm_cache/_cacache/index-v5/9f/5f/7b93b3b7f757730e79213f4cb7e73c072a15544da364e543df7bef989d9c new file mode 100644 index 00000000000000..74398f08fb8165 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/9f/5f/7b93b3b7f757730e79213f4cb7e73c072a15544da364e543df7bef989d9c @@ -0,0 +1,3 @@ + +aa15a41bad294a56a31a8bcce8a25a879b1c5dbb {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-https","integrity":"sha512-OvWsbjQzIlnUVneciC2dDbRyvv6E/YBDrDKL9R4b3NR0N7F+/02S30rY6ZmywuFAd5zegfaUddjUWRgIEDuWSw==","time":1547833048509,"size":1871,"metadata":{"url":"http://localhost:1337/test-repo-url-https","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcfdb97957af4e03"],"referer":["bugs test-repo-url-https"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:test-repo-url-https"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:28 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +d3dc2f53b27389600b8b0dcb4ada9a6512cfc6e2 {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-https","integrity":"sha512-OvWsbjQzIlnUVneciC2dDbRyvv6E/YBDrDKL9R4b3NR0N7F+/02S30rY6ZmywuFAd5zegfaUddjUWRgIEDuWSw==","time":1547833265524,"size":1871,"metadata":{"url":"http://localhost:1337/test-repo-url-https","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["e76ebb11020bbcdd"],"referer":["bugs test-repo-url-https"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:test-repo-url-https"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:05 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/a2/4a/41538002c219a054a1ecf2e6be6e66dac4d4feb5407eb6ecb26af41a4de8 b/deps/npm/test/npm_cache/_cacache/index-v5/a2/4a/41538002c219a054a1ecf2e6be6e66dac4d4feb5407eb6ecb26af41a4de8 new file mode 100644 index 00000000000000..054b7f8024c556 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/a2/4a/41538002c219a054a1ecf2e6be6e66dac4d4feb5407eb6ecb26af41a4de8 @@ -0,0 +1,12 @@ + +6c5c990934e13926b51e6ab354f42e8d0779bf8f {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":null,"time":1547839103758} +c207b5deb1770f1dc3c1df34e081ffd9478e8188 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":null,"time":1547839104211} +0719d4a0a0cee9d90dd426594cac152fec62630d {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":null,"time":1547839104637} +f3843f28e872291acf6c2d1e28d7df6e87faa173 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":null,"time":1547839105071} +3cf344d77f10ce0dc25fe8de8bae90765df36f1a {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":null,"time":1547839105510} +9ed5744249929413155c6b342f8403ffc4d1c582 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":null,"time":1547839105949} +e209c7b8c5189b9a3004b4c190c1f522868a81d7 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":null,"time":1547839106387} +1896b456ddf22502794469d37fc32f30684439f0 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":null,"time":1547839106824} +91a0f1ced7d89fbc18eaf0b9aa8ce8ada9e090e8 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":null,"time":1547839107252} +86e26814b6776ed9e565fb70bbff4db467688c5f {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":"sha512-b8c91FCMLZ8X7rHP0ognaUihaJ699qjT9PdRbUxovmOQY+flQ373/3JUeqvoa0mmsb9cczvezjh32CvIvBqafQ==","time":1547839107274,"size":21,"metadata":{"url":"http://localhost:1337/-/org/myorg/user","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["782279b862f30d85"],"referer":["org rm myorg myuser"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"date":["Fri, 18 Jan 2019 19:18:27 GMT"],"connection":["keep-alive"],"content-length":["21"],"x-fetch-attempts":["1"]}}} +13b115c72fcda3731ffbd4076ac771992fdf690a {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/myorg/user","integrity":"sha512-/TdlwwFD2pvTZ1jk8ZzOCYSqyfamqQoqHqeauKzshIQbeyr0sg5SBR1YWsEr7xkw01I01lVjGTFdVlY5EldHLQ==","time":1547839107720,"size":38,"metadata":{"url":"http://localhost:1337/-/org/myorg/user","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["bb01753ed8b7a54a"],"referer":["org ls myorg"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"date":["Fri, 18 Jan 2019 19:18:27 GMT"],"connection":["keep-alive"],"content-length":["38"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/a2/ff/2fbedd19724625ef6060f72129b8494625e3e6fd08f7fd5886f65bf82e0d b/deps/npm/test/npm_cache/_cacache/index-v5/a2/ff/2fbedd19724625ef6060f72129b8494625e3e6fd08f7fd5886f65bf82e0d new file mode 100644 index 00000000000000..0f751b92301907 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/a2/ff/2fbedd19724625ef6060f72129b8494625e3e6fd08f7fd5886f65bf82e0d @@ -0,0 +1,2 @@ + +8754c947aa648ac5a1e7d7bd750cf206f19ddf2a {"key":"pacote:version-manifest:http://localhost:1337/clean/-/clean-2.1.6.tgz:sha1-QcgLK29UMsYM3bgZMqtWVjtET1I=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833073374,"size":1,"metadata":{"id":"clean@2.1.6","manifest":{"name":"clean","version":"2.1.6","dependencies":{"checker":"~0.5.1","minimist":"~0.0.5"},"optionalDependencies":{},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/clean/-/clean-2.1.6.tgz","_integrity":"sha1-QcgLK29UMsYM3bgZMqtWVjtET1I=","_shasum":"41c80b2b6f5432c60cddb81932ab56563b444f52","_shrinkwrap":null,"bin":null,"_id":"clean@2.1.6"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/a6/c9/dbe7acc04b7cea7b99c68f3821cf6d7f49caba301e383b31143bd9670f28 b/deps/npm/test/npm_cache/_cacache/index-v5/a6/c9/dbe7acc04b7cea7b99c68f3821cf6d7f49caba301e383b31143bd9670f28 new file mode 100644 index 00000000000000..7aee08fdb80832 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/a6/c9/dbe7acc04b7cea7b99c68f3821cf6d7f49caba301e383b31143bd9670f28 @@ -0,0 +1,5 @@ + +3002bf2472d538dd29ea7b342d57d5df22550e1b {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/npm/v1/hooks/hook/dead%40beef","integrity":null,"time":1547833361751} +8c135f20bdfb585426caf7fd49188a735d252fe0 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/npm/v1/hooks/hook/dead%40beef","integrity":null,"time":1547833362326} +95ae855df601d00c050d2a0aafffcfbbe7e512bf {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/npm/v1/hooks/hook/dead%40beef","integrity":null,"time":1547833364134} +7ce3a872de3f712c0df4a401f404423e8728ab90 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/npm/v1/hooks/hook/dead%40beef","integrity":null,"time":1547833364692} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/a8/15/13afeacd20fdb82b59ceeaa57b4d135c5def8209619ca09751fdae5bd803 b/deps/npm/test/npm_cache/_cacache/index-v5/a8/15/13afeacd20fdb82b59ceeaa57b4d135c5def8209619ca09751fdae5bd803 new file mode 100644 index 00000000000000..8b2d365594ab28 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/a8/15/13afeacd20fdb82b59ceeaa57b4d135c5def8209619ca09751fdae5bd803 @@ -0,0 +1,3 @@ + +30492be5d770c162fa1e38568cad83070b45d4cd {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-ssh","integrity":"sha512-zesPUGW+A+iVR6M+Bk2RGWmVPEXrBd9mTKTVN7lw3J92gSNGOm91zmuDbVDuc8GKx6Jedj8rmGlhLNv0JxldSw==","time":1547833049314,"size":1094,"metadata":{"url":"http://localhost:1337/test-repo-url-ssh","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["0057a2b51b6e5b0a"],"referer":["bugs test-repo-url-ssh"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:test-repo-url-ssh"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:29 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +aab489bc027e6f7280ac70934e3147555ed2ff15 {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-ssh","integrity":"sha512-zesPUGW+A+iVR6M+Bk2RGWmVPEXrBd9mTKTVN7lw3J92gSNGOm91zmuDbVDuc8GKx6Jedj8rmGlhLNv0JxldSw==","time":1547833266207,"size":1094,"metadata":{"url":"http://localhost:1337/test-repo-url-ssh","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["1b2e5a88bc1db2e9"],"referer":["bugs test-repo-url-ssh"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:test-repo-url-ssh"],"accept":["application/json"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:06 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/a8/88/3a6a0c55cde913db472fd92adee9edf0f507c4ea02b2703d926b06947341 b/deps/npm/test/npm_cache/_cacache/index-v5/a8/88/3a6a0c55cde913db472fd92adee9edf0f507c4ea02b2703d926b06947341 new file mode 100644 index 00000000000000..9a7f8a3b571c80 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/a8/88/3a6a0c55cde913db472fd92adee9edf0f507c4ea02b2703d926b06947341 @@ -0,0 +1,3 @@ + +dae0f572918acce3f6c847cef076673e992e3752 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fpkg/collaborators","integrity":"sha512-MshpkrpGcUCKKSuz8vrkzRBBbc7baiFMFpBUr2vMeStupW9yRTMzV8xZ5PhGYDgGBLX/M4JYrUaXMhjYZHmbXg==","time":1547832993103,"size":51,"metadata":{"url":"http://localhost:1337/-/package/%40scoped%2Fpkg/collaborators?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["9057e4dad1435f4e"],"referer":["access ls-collaborators"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:33 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +bf9a4b5940d5354ed240c9d19bf66aef181f6b37 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/%40scoped%2Fpkg/collaborators","integrity":"sha512-MshpkrpGcUCKKSuz8vrkzRBBbc7baiFMFpBUr2vMeStupW9yRTMzV8xZ5PhGYDgGBLX/M4JYrUaXMhjYZHmbXg==","time":1547833216272,"size":51,"metadata":{"url":"http://localhost:1337/-/package/%40scoped%2Fpkg/collaborators?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["8c53f175b90e89fb"],"referer":["access ls-collaborators"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:16 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/ad/29/4a034c1908dcd263dce381384f50b395b52e2addd35285efab8ec8f5b303 b/deps/npm/test/npm_cache/_cacache/index-v5/ad/29/4a034c1908dcd263dce381384f50b395b52e2addd35285efab8ec8f5b303 new file mode 100644 index 00000000000000..fdcee46164e5ca --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/ad/29/4a034c1908dcd263dce381384f50b395b52e2addd35285efab8ec8f5b303 @@ -0,0 +1,3 @@ + +11e87811e2df676a2b3f709f580b0a51b7eef996 {"key":"pacote:range-manifest:http://localhost:1337/minimist/-/minimist-0.0.5.tgz:sha1-16oye87PUY+RBqxrjwA/o7zqhWY=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833073431,"size":1,"metadata":{"id":"minimist@0.0.5","manifest":{"name":"minimist","version":"0.0.5","dependencies":{},"optionalDependencies":{},"devDependencies":{"tape":"~1.0.4","tap":"~0.4.0"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/minimist/-/minimist-0.0.5.tgz","_integrity":"sha1-16oye87PUY+RBqxrjwA/o7zqhWY=","_shasum":"d7aa327bcecf518f9106ac6b8f003fa3bcea8566","_shrinkwrap":null,"bin":null,"_id":"minimist@0.0.5"},"type":"finalized-manifest"}} +cf5b45eb3a283ea7041a23ef29c08de42ae86db3 {"key":"pacote:range-manifest:http://localhost:1337/minimist/-/minimist-0.0.5.tgz:sha1-16oye87PUY+RBqxrjwA/o7zqhWY=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833073432,"size":1,"metadata":{"id":"minimist@0.0.5","manifest":{"name":"minimist","version":"0.0.5","dependencies":{},"optionalDependencies":{},"devDependencies":{"tape":"~1.0.4","tap":"~0.4.0"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/minimist/-/minimist-0.0.5.tgz","_integrity":"sha1-16oye87PUY+RBqxrjwA/o7zqhWY=","_shasum":"d7aa327bcecf518f9106ac6b8f003fa3bcea8566","_shrinkwrap":null,"bin":null,"_id":"minimist@0.0.5"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/ad/e9/1d8533ddd67b495ca9cffd992a45de09faf0f0fe2ad2c446353a58288f6b b/deps/npm/test/npm_cache/_cacache/index-v5/ad/e9/1d8533ddd67b495ca9cffd992a45de09faf0f0fe2ad2c446353a58288f6b new file mode 100644 index 00000000000000..ce505cd9432c04 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/ad/e9/1d8533ddd67b495ca9cffd992a45de09faf0f0fe2ad2c446353a58288f6b @@ -0,0 +1,2 @@ + +64365f703c777ce905630f8f2e6287ec0dc87d2d {"key":"pacote:version-manifest:http://localhost:1337/optimist/-/optimist-0.6.0.tgz:sha1-aUJIJvNAX3nxQub8PZrljU27kgA=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833073374,"size":1,"metadata":{"id":"optimist@0.6.0","manifest":{"name":"optimist","version":"0.6.0","dependencies":{"wordwrap":"~0.0.2","minimist":"~0.0.1"},"optionalDependencies":{},"devDependencies":{"hashish":"~0.0.4","tap":"~0.4.0"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/optimist/-/optimist-0.6.0.tgz","_integrity":"sha1-aUJIJvNAX3nxQub8PZrljU27kgA=","_shasum":"69424826f3405f79f142e6fc3d9ae58d4dbb9200","_shrinkwrap":null,"bin":null,"_id":"optimist@0.6.0"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/b1/78/4ff2f1383234ce5feb54cec21589dfd82db09bd3c7016d436760a3e94f60 b/deps/npm/test/npm_cache/_cacache/index-v5/b1/78/4ff2f1383234ce5feb54cec21589dfd82db09bd3c7016d436760a3e94f60 new file mode 100644 index 00000000000000..73d8583ab229e1 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/b1/78/4ff2f1383234ce5feb54cec21589dfd82db09bd3c7016d436760a3e94f60 @@ -0,0 +1,3 @@ + +7f02995173e0bd08a3af0b45d82442eddce0e57d {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:npm_saml_auth_dummy_user","integrity":null,"time":1547833017995} +d0f3ef244b97c22054244c059d888d9abd7693ed {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:npm_saml_auth_dummy_user","integrity":null,"time":1547833237264} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/b2/47/c8196ddf74a5111fedbaf5abf24d446c017f7bfba330c19d63fc24000277 b/deps/npm/test/npm_cache/_cacache/index-v5/b2/47/c8196ddf74a5111fedbaf5abf24d446c017f7bfba330c19d63fc24000277 new file mode 100644 index 00000000000000..7ce40d69c5562d --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/b2/47/c8196ddf74a5111fedbaf5abf24d446c017f7bfba330c19d63fc24000277 @@ -0,0 +1,2 @@ + +c7a7b66fcdc42362855ee1ea0e4bacc86897cddb {"key":"pacote:git-manifest:git://localhost:1234/child.git#65974106d8883632964be1da34eec5e85beead3a","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833223116,"size":1,"metadata":{"id":"child@1.0.3","manifest":{"name":"child","version":"1.0.3","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"git://localhost:1234/child.git#65974106d8883632964be1da34eec5e85beead3a","_integrity":null,"_shasum":null,"_shrinkwrap":null,"bin":null,"_id":"child@1.0.3"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/b3/36/c25c35e75c8973f821f5a05ce4803a44826a0112390460da66c8c3c5de69 b/deps/npm/test/npm_cache/_cacache/index-v5/b3/36/c25c35e75c8973f821f5a05ce4803a44826a0112390460da66c8c3c5de69 new file mode 100644 index 00000000000000..36144f760f2837 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/b3/36/c25c35e75c8973f821f5a05ce4803a44826a0112390460da66c8c3c5de69 @@ -0,0 +1,5 @@ + +2203ec8d87dfdc33ca3f91fee36d62d7583b9fc7 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fpkg/dist-tags","integrity":"sha512-9b2mt4/PIEsewOYGkEW0T2Zp6aq4eL/IkblG5M7LhD9Oh+Qotnca57Sizo8wPpd0Z2OwZC+viamwBCUpfceNag==","time":1547833098623,"size":42,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fpkg/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["5fe2532912b524f2"],"referer":["dist-tag ls"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:18 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +6822b31385528e21a07e23d5a812925b3094f1b3 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fpkg/dist-tags","integrity":"sha512-9b2mt4/PIEsewOYGkEW0T2Zp6aq4eL/IkblG5M7LhD9Oh+Qotnca57Sizo8wPpd0Z2OwZC+viamwBCUpfceNag==","time":1547833099266,"size":42,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fpkg/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["a0862a2bfbf103a4"],"referer":["dist-tag"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:19 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +b38156acf618625f7b1386e8ba1cafc433525145 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fpkg/dist-tags","integrity":"sha512-9b2mt4/PIEsewOYGkEW0T2Zp6aq4eL/IkblG5M7LhD9Oh+Qotnca57Sizo8wPpd0Z2OwZC+viamwBCUpfceNag==","time":1547833319191,"size":42,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fpkg/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["cd0330de647ee848"],"referer":["dist-tag ls"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:59 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +86f80933dda8c18895069da9865c5285038deef9 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fpkg/dist-tags","integrity":"sha512-9b2mt4/PIEsewOYGkEW0T2Zp6aq4eL/IkblG5M7LhD9Oh+Qotnca57Sizo8wPpd0Z2OwZC+viamwBCUpfceNag==","time":1547833319738,"size":42,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fpkg/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["f98d50799fc74c0a"],"referer":["dist-tag"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:59 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/b4/2c/2aec38b0351146be02fc91be78e935c68f4608824732a06091fcf7cb550a b/deps/npm/test/npm_cache/_cacache/index-v5/b4/2c/2aec38b0351146be02fc91be78e935c68f4608824732a06091fcf7cb550a new file mode 100644 index 00000000000000..8f0c7506e9b16c --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/b4/2c/2aec38b0351146be02fc91be78e935c68f4608824732a06091fcf7cb550a @@ -0,0 +1,3 @@ + +20d59f6daec6eac2eb644733fe21c815e25ffaef {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/username/package","integrity":"sha512-3Cqk30LNQ1Yj9MLD4nT6CBzJQv9F3PqYzfSpMktqIcNyHDS7l+aAnuKAUfwQ9XdJz/YKqXCh44x6bDVKlANVTg==","time":1547832989714,"size":39,"metadata":{"url":"http://localhost:1337/-/org/username/package?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["b8545df12738f01b"],"referer":["access ls-packages"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:29 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +704866f7d6302ba3b3aeca7e3260af11b4317155 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/org/username/package","integrity":"sha512-3Cqk30LNQ1Yj9MLD4nT6CBzJQv9F3PqYzfSpMktqIcNyHDS7l+aAnuKAUfwQ9XdJz/YKqXCh44x6bDVKlANVTg==","time":1547833213589,"size":39,"metadata":{"url":"http://localhost:1337/-/org/username/package?format=cli","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["29cf4d7ca0f7ff48"],"referer":["access ls-packages"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/b4/a9/95ce79090bb3e6ab5e8a85aaef872bf4eca492fac6cab144fb2e45ffbd74 b/deps/npm/test/npm_cache/_cacache/index-v5/b4/a9/95ce79090bb3e6ab5e8a85aaef872bf4eca492fac6cab144fb2e45ffbd74 new file mode 100644 index 00000000000000..2ba32d7b4cfa16 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/b4/a9/95ce79090bb3e6ab5e8a85aaef872bf4eca492fac6cab144fb2e45ffbd74 @@ -0,0 +1,3 @@ + +135604e7716d4c2e6bd09f4398d108fbc29895c5 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u/-rev/3-deadcafebabebeef","integrity":null,"time":1547833015114} +d4d193f0e535e597bd98b501f7c5a1da3251bbbe {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/user/org.couchdb.user:u/-rev/3-deadcafebabebeef","integrity":null,"time":1547833234827} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/b7/1c/f06201305985169fc251111ddb9fa636ef144ff9fad15784c1e9620b0dac b/deps/npm/test/npm_cache/_cacache/index-v5/b7/1c/f06201305985169fc251111ddb9fa636ef144ff9fad15784c1e9620b0dac new file mode 100644 index 00000000000000..0a33108574d4ac --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/b7/1c/f06201305985169fc251111ddb9fa636ef144ff9fad15784c1e9620b0dac @@ -0,0 +1,2 @@ + +614363c24691f80d387b90f697b435cba6cb5ba4 {"key":"pacote:range-manifest:https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz:sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1544485144527,"size":1,"metadata":{"id":"inherits@1.0.2","manifest":{"name":"inherits","version":"1.0.2","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz","_integrity":"sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=","_shasum":"ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b","_shrinkwrap":null,"bin":null,"_id":"inherits@1.0.2"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/b8/16/bf6e49afbd1323783f2f5a63b3d871adc66f517669450807aec3b62e71b2 b/deps/npm/test/npm_cache/_cacache/index-v5/b8/16/bf6e49afbd1323783f2f5a63b3d871adc66f517669450807aec3b62e71b2 new file mode 100644 index 00000000000000..2a92a341f1b5fc --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/b8/16/bf6e49afbd1323783f2f5a63b3d871adc66f517669450807aec3b62e71b2 @@ -0,0 +1,2 @@ + +0fa6ae8d13ade52a785024d598ead22bc4a060df {"key":"make-fetch-happen:request-cache:https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz","integrity":"sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=","time":1544485144635,"size":1519,"metadata":{"url":"https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.5.0 node/v10.14.1 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["28a99044412a2230"],"referer":["install [REDACTED]"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:inherits@https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"date":["Mon, 10 Dec 2018 23:39:04 GMT"],"content-type":["application/octet-stream"],"content-length":["1519"],"connection":["keep-alive"],"set-cookie":["__cfduid=defb20c5371b88093aa383ac8c884d4171544485144; expires=Tue, 10-Dec-19 23:39:04 GMT; path=/; domain=.registry.npmjs.org; HttpOnly"],"cf-cache-status":["HIT"],"cache-control":["max-age=432000"],"accept-ranges":["bytes"],"cf-ray":["48738c79cc526c7c-SJC"],"etag":["\"54a4d8823795a0d30b28479c10e3d486\""],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"last-modified":["Sun, 27 May 2018 04:40:10 GMT"],"vary":["Accept-Encoding"],"server":["cloudflare"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/ba/41/d137c2778ea0d7167fbc730827a0a2c453ffea82d07c7b1481a46f7b1194 b/deps/npm/test/npm_cache/_cacache/index-v5/ba/41/d137c2778ea0d7167fbc730827a0a2c453ffea82d07c7b1481a46f7b1194 new file mode 100644 index 00000000000000..7f2979c9e70af2 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/ba/41/d137c2778ea0d7167fbc730827a0a2c453ffea82d07c7b1481a46f7b1194 @@ -0,0 +1,4 @@ + +9c2b5138ca19cd78e19d07ada8b5b3abfd0f4292 {"key":"pacote:remote-manifest:http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz:sha512-NycvWDeO1ZEZc3P0bTvhSL/IJknbshO+FKKxrEf1DX1IBMsQVZCTWnvNAt+uOiQhyTnK+1hrnxtsSS/f4JrKhg==","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833041019,"size":1,"metadata":{"id":"@scoped/underscore@1.3.1","manifest":{"name":"@scoped/underscore","version":"1.3.1","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","_integrity":"sha512-NycvWDeO1ZEZc3P0bTvhSL/IJknbshO+FKKxrEf1DX1IBMsQVZCTWnvNAt+uOiQhyTnK+1hrnxtsSS/f4JrKhg==","_shasum":"28eb847a949e71eb9041fd6567a36c9acfcf2bed","_shrinkwrap":null,"bin":null,"_id":"@scoped/underscore@1.3.1"},"type":"finalized-manifest"}} +b3884f202f09e0fc0656eb1b740f68243c0a3d0b {"key":"pacote:remote-manifest:http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz:sha512-NycvWDeO1ZEZc3P0bTvhSL/IJknbshO+FKKxrEf1DX1IBMsQVZCTWnvNAt+uOiQhyTnK+1hrnxtsSS/f4JrKhg==","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833259082,"size":1,"metadata":{"id":"@scoped/underscore@1.3.1","manifest":{"name":"@scoped/underscore","version":"1.3.1","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","_integrity":"sha512-NycvWDeO1ZEZc3P0bTvhSL/IJknbshO+FKKxrEf1DX1IBMsQVZCTWnvNAt+uOiQhyTnK+1hrnxtsSS/f4JrKhg==","_shasum":"28eb847a949e71eb9041fd6567a36c9acfcf2bed","_shrinkwrap":null,"bin":null,"_id":"@scoped/underscore@1.3.1"},"type":"finalized-manifest"}} +ceebf365613b857c1d00a513f871286b7575841a {"key":"pacote:remote-manifest:http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz:sha512-NycvWDeO1ZEZc3P0bTvhSL/IJknbshO+FKKxrEf1DX1IBMsQVZCTWnvNAt+uOiQhyTnK+1hrnxtsSS/f4JrKhg==","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1548718095641,"size":1,"metadata":{"id":"@scoped/underscore@1.3.1","manifest":{"name":"@scoped/underscore","version":"1.3.1","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://127.0.0.1:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz","_integrity":"sha512-NycvWDeO1ZEZc3P0bTvhSL/IJknbshO+FKKxrEf1DX1IBMsQVZCTWnvNAt+uOiQhyTnK+1hrnxtsSS/f4JrKhg==","_shasum":"28eb847a949e71eb9041fd6567a36c9acfcf2bed","_shrinkwrap":null,"bin":null,"_id":"@scoped/underscore@1.3.1"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/be/6a/458105f31e845d57376ed2b2019e46a63cff8cbb76981a37eac2100c8e55 b/deps/npm/test/npm_cache/_cacache/index-v5/be/6a/458105f31e845d57376ed2b2019e46a63cff8cbb76981a37eac2100c8e55 new file mode 100644 index 00000000000000..c7f616ca698625 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/be/6a/458105f31e845d57376ed2b2019e46a63cff8cbb76981a37eac2100c8e55 @@ -0,0 +1,3 @@ + +388060aca1924af6f5de8efc78b1292213e4e342 {"key":"pacote:packed-dir:github:isaacs/sax-js#5aee2163d55cff24b817bbf550bac44841f9df45","integrity":"sha512-Iv7u1C07q1/2mXITRvnF+npwrCdI7gztdbwLj26KupJPU6k0BLMPqNKODWTBSSLo8NHtHCEu8/FdAOlSexe5uQ==","time":1544485149568,"size":15108} +0e88f843ada3834c0f11764113f4441e3fd22c97 {"key":"pacote:packed-dir:github:isaacs/sax-js#5aee2163d55cff24b817bbf550bac44841f9df45","integrity":"sha512-Iv7u1C07q1/2mXITRvnF+npwrCdI7gztdbwLj26KupJPU6k0BLMPqNKODWTBSSLo8NHtHCEu8/FdAOlSexe5uQ==","time":1544485151587,"size":15108} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/c4/08/207afc5ca1803fa593124554206657c17eb6b2809df9f5ec1c10007a6465 b/deps/npm/test/npm_cache/_cacache/index-v5/c4/08/207afc5ca1803fa593124554206657c17eb6b2809df9f5ec1c10007a6465 new file mode 100644 index 00000000000000..79591a24fad5a1 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/c4/08/207afc5ca1803fa593124554206657c17eb6b2809df9f5ec1c10007a6465 @@ -0,0 +1,3 @@ + +d1bd3700ae4b819592862245ce99d2af2b6e95bb {"key":"pacote:tarball:file:/Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/test-whoops-1.0.0.tgz","integrity":"sha512-yaIGW7l0bldKVBrwYbeICUjTDkfbHcNWwxS9k0sBaYlNaW6DO9Y7bFPLlz0UuAZLWwQXfEAuNHdw3fu7x8kGyw==","time":1547833112237,"size":184} +1703cbc1f1f6594798a79f0cdff31e60198cbb3c {"key":"pacote:tarball:file:/Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/test-whoops-1.0.0.tgz","integrity":"sha512-yaIGW7l0bldKVBrwYbeICUjTDkfbHcNWwxS9k0sBaYlNaW6DO9Y7bFPLlz0UuAZLWwQXfEAuNHdw3fu7x8kGyw==","time":1547833333861,"size":184} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/c7/6a/1f6606232f53d41a78bcb0a155df04211a49d1fdb1b67e59ccb47e20c353 b/deps/npm/test/npm_cache/_cacache/index-v5/c7/6a/1f6606232f53d41a78bcb0a155df04211a49d1fdb1b67e59ccb47e20c353 new file mode 100644 index 00000000000000..3f8ca248851a31 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/c7/6a/1f6606232f53d41a78bcb0a155df04211a49d1fdb1b67e59ccb47e20c353 @@ -0,0 +1,5 @@ + +7b180a577935e416bdf212a54bbccaaea00610b6 {"key":"pacote:packed-dir:git://localhost:1234/top.git#ade345938057607d9e1b50afa2d6f627b911e596","integrity":"sha512-VJX+hA7b9dGN/CfF9NmzWeirgaR0H2Kw3rIJeTWYQ4KK5QESusTiWj/BCJ0mD9m4I25DSjpVWAt6q6Np5vi6hw==","time":1547833225545,"size":283} +214d8fe56262265b542137a1a6548a62487435f8 {"key":"pacote:packed-dir:git://localhost:1234/top.git#ade345938057607d9e1b50afa2d6f627b911e596","integrity":"sha512-VJX+hA7b9dGN/CfF9NmzWeirgaR0H2Kw3rIJeTWYQ4KK5QESusTiWj/BCJ0mD9m4I25DSjpVWAt6q6Np5vi6hw==","time":1547833226019,"size":283} +4fdb441a9fc384e4ff88825e523cacde7214daea {"key":"pacote:packed-dir:git://localhost:1234/top.git#ade345938057607d9e1b50afa2d6f627b911e596","integrity":"sha512-VJX+hA7b9dGN/CfF9NmzWeirgaR0H2Kw3rIJeTWYQ4KK5QESusTiWj/BCJ0mD9m4I25DSjpVWAt6q6Np5vi6hw==","time":1547833226573,"size":283} +a97ab2f9669f0bc0130eab10d42898af9ee4ae09 {"key":"pacote:packed-dir:git://localhost:1234/top.git#ade345938057607d9e1b50afa2d6f627b911e596","integrity":"sha512-VJX+hA7b9dGN/CfF9NmzWeirgaR0H2Kw3rIJeTWYQ4KK5QESusTiWj/BCJ0mD9m4I25DSjpVWAt6q6Np5vi6hw==","time":1547833227081,"size":283} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/ca/2f/42a626cb16aeb63c2dc04be95e67db8ea33ce033a3fadf0ba1061c174d3e b/deps/npm/test/npm_cache/_cacache/index-v5/ca/2f/42a626cb16aeb63c2dc04be95e67db8ea33ce033a3fadf0ba1061c174d3e new file mode 100644 index 00000000000000..d8c2490b516c4b --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/ca/2f/42a626cb16aeb63c2dc04be95e67db8ea33ce033a3fadf0ba1061c174d3e @@ -0,0 +1,3 @@ + +ce8332445d8663fd141a36216e677bd10ff6b9d7 {"key":"pacote:packed-dir:git://localhost:1234/child.git#28b560148ea11a46c70defbce4c485581ced33d1","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833007307,"size":143} +6fab7ca434f22c424fe295ff514b366202edc994 {"key":"pacote:packed-dir:git://localhost:1234/child.git#28b560148ea11a46c70defbce4c485581ced33d1","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833007721,"size":143} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/d0/a2/9b5933a9df317b031c4407f0d9cae19a4d56f253f7746786597a52daa76d b/deps/npm/test/npm_cache/_cacache/index-v5/d0/a2/9b5933a9df317b031c4407f0d9cae19a4d56f253f7746786597a52daa76d new file mode 100644 index 00000000000000..1e03e6602f77b6 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/d0/a2/9b5933a9df317b031c4407f0d9cae19a4d56f253f7746786597a52daa76d @@ -0,0 +1,2 @@ + +a30822a420ac48487cedbaf87ca2a38d9813fd74 {"key":"make-fetch-happen:request-cache:https://registry.npmjs.org/graceful-fs","integrity":"sha512-XSnW4a3SU2N5q8HrpS+DgkpgkaWvn/uhR5z0BPR4828GUE9mQ9uGMeC28FflUUDYRInKzBQGJ+ASgk+gc/l1aA==","time":1544485144512,"size":24332,"metadata":{"url":"https://registry.npmjs.org/graceful-fs","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.5.0 node/v10.14.1 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["28a99044412a2230"],"referer":["install [REDACTED]"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:graceful-fs"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"date":["Mon, 10 Dec 2018 23:39:04 GMT"],"content-type":["application/vnd.npm.install-v1+json"],"content-length":["24332"],"connection":["keep-alive"],"set-cookie":["__cfduid=defb20c5371b88093aa383ac8c884d4171544485144; expires=Tue, 10-Dec-19 23:39:04 GMT; path=/; domain=.registry.npmjs.org; HttpOnly"],"cf-cache-status":["HIT"],"cache-control":["max-age=300"],"accept-ranges":["bytes"],"cf-ray":["48738c790c166c7c-SJC"],"etag":["\"a61f5e425bc37e1f2ae6fff988a7f45c\""],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"last-modified":["Sun, 04 Nov 2018 20:51:58 GMT"],"vary":["accept-encoding, accept"],"x-amz-meta-rev":["204-3ea980c425725a63a5de5e3f020e8617"],"server":["cloudflare"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/d2/0a/0834f8c04d97b43d0f99901f9c56c3654221987030a0f86aac7f7caecccc b/deps/npm/test/npm_cache/_cacache/index-v5/d2/0a/0834f8c04d97b43d0f99901f9c56c3654221987030a0f86aac7f7caecccc new file mode 100644 index 00000000000000..b3e16f2babeb01 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/d2/0a/0834f8c04d97b43d0f99901f9c56c3654221987030a0f86aac7f7caecccc @@ -0,0 +1,3 @@ + +f560665c954f57c14f107bba0df77c536f9ddaa4 {"key":"make-fetch-happen:request-cache:http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz","integrity":"sha1-gvPMuhGRTciLyxhe47GzO1ZCcrw=","time":1547833046964,"size":220,"metadata":{"url":"http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["ece3b5a000cc3f02"],"referer":["bugs npm-test-peer-deps"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:npm-test-peer-deps@http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:26 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +e80b143e8a12e4112be260e9e1880db7c72404f3 {"key":"make-fetch-happen:request-cache:http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz","integrity":"sha1-gvPMuhGRTciLyxhe47GzO1ZCcrw=","time":1547833264155,"size":220,"metadata":{"url":"http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["836b89e1cc0594ec"],"referer":["bugs npm-test-peer-deps"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:npm-test-peer-deps@http://localhost:1337/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:04 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/d8/8f/1bf51f3ab635ab46a8693c919a915102645335a143056a5f12cafef915c0 b/deps/npm/test/npm_cache/_cacache/index-v5/d8/8f/1bf51f3ab635ab46a8693c919a915102645335a143056a5f12cafef915c0 new file mode 100644 index 00000000000000..17c9e80e488b30 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/d8/8f/1bf51f3ab635ab46a8693c919a915102645335a143056a5f12cafef915c0 @@ -0,0 +1,9 @@ + +5d6fb857bc4ef7fd6179300822ed60f39789695d {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist","integrity":"sha512-g6TXR7gGyq5zhXeBRbz5mfrmnutvFDQ/aAG3m2t4U1OJYWlKyLR5HHZ1wnkotUldEtL5RIZ9sRBeQk1fqbHgFQ==","time":1547833073399,"size":19834,"metadata":{"url":"http://localhost:1337/minimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:minimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +5d6fb857bc4ef7fd6179300822ed60f39789695d {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist","integrity":"sha512-g6TXR7gGyq5zhXeBRbz5mfrmnutvFDQ/aAG3m2t4U1OJYWlKyLR5HHZ1wnkotUldEtL5RIZ9sRBeQk1fqbHgFQ==","time":1547833073399,"size":19834,"metadata":{"url":"http://localhost:1337/minimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:minimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +f9f6f5b3805ab1d6047f104f2c0934da89029de3 {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist","integrity":"sha512-g6TXR7gGyq5zhXeBRbz5mfrmnutvFDQ/aAG3m2t4U1OJYWlKyLR5HHZ1wnkotUldEtL5RIZ9sRBeQk1fqbHgFQ==","time":1547833079826,"size":19834,"metadata":{"url":"http://localhost:1337/minimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["d19ab2d4de48cace"],"referer":["install optimist"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:minimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:59 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +0e670817744d3920a594bcd7a51151239cc6edb4 {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist","integrity":"sha512-g6TXR7gGyq5zhXeBRbz5mfrmnutvFDQ/aAG3m2t4U1OJYWlKyLR5HHZ1wnkotUldEtL5RIZ9sRBeQk1fqbHgFQ==","time":1547833093340,"size":19834,"metadata":{"url":"http://localhost:1337/minimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcd144259ba74815"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:minimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +6e3b3799d9593d6562149522f40f1bef85175ff5 {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist","integrity":"sha512-g6TXR7gGyq5zhXeBRbz5mfrmnutvFDQ/aAG3m2t4U1OJYWlKyLR5HHZ1wnkotUldEtL5RIZ9sRBeQk1fqbHgFQ==","time":1547833294159,"size":19834,"metadata":{"url":"http://localhost:1337/minimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["0a92a1a2bc33028a"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:minimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:34 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +6e3b3799d9593d6562149522f40f1bef85175ff5 {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist","integrity":"sha512-g6TXR7gGyq5zhXeBRbz5mfrmnutvFDQ/aAG3m2t4U1OJYWlKyLR5HHZ1wnkotUldEtL5RIZ9sRBeQk1fqbHgFQ==","time":1547833294159,"size":19834,"metadata":{"url":"http://localhost:1337/minimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["0a92a1a2bc33028a"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:minimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:34 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +aa4bf0541df5929840d07c70955c1ff23cfc6f5d {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist","integrity":"sha512-g6TXR7gGyq5zhXeBRbz5mfrmnutvFDQ/aAG3m2t4U1OJYWlKyLR5HHZ1wnkotUldEtL5RIZ9sRBeQk1fqbHgFQ==","time":1547833301219,"size":19834,"metadata":{"url":"http://localhost:1337/minimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["f4c81daeaa866c45"],"referer":["install optimist"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:minimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:41 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +be227b26dd91f727946a5e8ec671f62c400c2f84 {"key":"make-fetch-happen:request-cache:http://localhost:1337/minimist","integrity":"sha512-g6TXR7gGyq5zhXeBRbz5mfrmnutvFDQ/aAG3m2t4U1OJYWlKyLR5HHZ1wnkotUldEtL5RIZ9sRBeQk1fqbHgFQ==","time":1547833314424,"size":19834,"metadata":{"url":"http://localhost:1337/minimist","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["ce2c0b941f6a62b8"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:minimist"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:54 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/de/9f/35f1c704459881fb3c9e83a59e80c3482dd62f626939323f2b6bf511b53d b/deps/npm/test/npm_cache/_cacache/index-v5/de/9f/35f1c704459881fb3c9e83a59e80c3482dd62f626939323f2b6bf511b53d new file mode 100644 index 00000000000000..b41bc1a9202e62 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/de/9f/35f1c704459881fb3c9e83a59e80c3482dd62f626939323f2b6bf511b53d @@ -0,0 +1,3 @@ + +7bb832e347dbc62f1198afb35f8f7551bceacd72 {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz","integrity":"sha1-4FAI8/+Cs08XselyRUoKtwomnH0=","time":1547833048530,"size":371,"metadata":{"url":"http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcfdb97957af4e03"],"referer":["bugs test-repo-url-https"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:test-repo-url-https@http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:28 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +ac50fa8a2ea2326ad7cf56bca893b374b5bebb2c {"key":"make-fetch-happen:request-cache:http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz","integrity":"sha1-4FAI8/+Cs08XselyRUoKtwomnH0=","time":1547833265543,"size":371,"metadata":{"url":"http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["e76ebb11020bbcdd"],"referer":["bugs test-repo-url-https"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:test-repo-url-https@http://localhost:1337/test-repo-url-https/-/test-repo-url-https-0.0.1.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:05 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/df/88/3ff6bf48df44c29ce1193e883193e034208d95b6028728ef3902b78b694d b/deps/npm/test/npm_cache/_cacache/index-v5/df/88/3ff6bf48df44c29ce1193e883193e034208d95b6028728ef3902b78b694d new file mode 100644 index 00000000000000..9ac362316b2859 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/df/88/3ff6bf48df44c29ce1193e883193e034208d95b6028728ef3902b78b694d @@ -0,0 +1,5 @@ + +5608f36aeb6a5f59d34b08079615f760039073c5 {"key":"make-fetch-happen:request-cache:http://localhost:1337/async","integrity":"sha512-raHNkSLmvrld42u43BDCVaan17i/viG3KEOrbbQC7oy4veX7LQUKfrluozDovho5TEx8REyLVB+OGAt/ElBv6A==","time":1547833073441,"size":76163,"metadata":{"url":"http://localhost:1337/async","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:async"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +4e272da87db2d81cdf7e70054035943de9d7e693 {"key":"make-fetch-happen:request-cache:http://localhost:1337/async","integrity":"sha512-raHNkSLmvrld42u43BDCVaan17i/viG3KEOrbbQC7oy4veX7LQUKfrluozDovho5TEx8REyLVB+OGAt/ElBv6A==","time":1547833093317,"size":76163,"metadata":{"url":"http://localhost:1337/async","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcd144259ba74815"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:async"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +ae1039605ec582dd106d671660d7f190d91e3753 {"key":"make-fetch-happen:request-cache:http://localhost:1337/async","integrity":"sha512-raHNkSLmvrld42u43BDCVaan17i/viG3KEOrbbQC7oy4veX7LQUKfrluozDovho5TEx8REyLVB+OGAt/ElBv6A==","time":1547833294175,"size":76163,"metadata":{"url":"http://localhost:1337/async","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["0a92a1a2bc33028a"],"referer":["install"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:async"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:34 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +fb221ac87dd04ff1360ecfbe22be4df3e1033ad7 {"key":"make-fetch-happen:request-cache:http://localhost:1337/async","integrity":"sha512-raHNkSLmvrld42u43BDCVaan17i/viG3KEOrbbQC7oy4veX7LQUKfrluozDovho5TEx8REyLVB+OGAt/ElBv6A==","time":1547833314410,"size":76163,"metadata":{"url":"http://localhost:1337/async","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["ce2c0b941f6a62b8"],"referer":["install ."],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:async"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:41:54 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/e8/1b/a9b0963bde9d8cb31e0fe8762eac5e3d3c2cd27e8bb1fbcdc22399c3d89e b/deps/npm/test/npm_cache/_cacache/index-v5/e8/1b/a9b0963bde9d8cb31e0fe8762eac5e3d3c2cd27e8bb1fbcdc22399c3d89e new file mode 100644 index 00000000000000..87a7ff8957c504 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/e8/1b/a9b0963bde9d8cb31e0fe8762eac5e3d3c2cd27e8bb1fbcdc22399c3d89e @@ -0,0 +1,2 @@ + +253438baa1d440b6ce159e9f2875b750e6182cc1 {"key":"pacote:git-manifest:git://localhost:1234/child.git#aef7bbd091eeef812d6364c2e8250b1e4b39a5ba","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833000939,"size":1,"metadata":{"id":"child@1.0.3","manifest":{"name":"child","version":"1.0.3","dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"git://localhost:1234/child.git#aef7bbd091eeef812d6364c2e8250b1e4b39a5ba","_integrity":null,"_shasum":null,"_shrinkwrap":null,"bin":null,"_id":"child@1.0.3"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/ec/6e/39493289897b28d06119b515a4d107ae1cd16ef94cdbbbd34a1c5687e07d b/deps/npm/test/npm_cache/_cacache/index-v5/ec/6e/39493289897b28d06119b515a4d107ae1cd16ef94cdbbbd34a1c5687e07d new file mode 100644 index 00000000000000..52c1db7db9ff26 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/ec/6e/39493289897b28d06119b515a4d107ae1cd16ef94cdbbbd34a1c5687e07d @@ -0,0 +1,2 @@ + +d76e587682077896d26831eff1e0a565de513e48 {"key":"pacote:range-manifest:http://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.14.tgz:sha1-BweNtfY3f2Mh/Oqu30l94STclGU=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1544485144560,"size":1,"metadata":{"id":"graceful-fs@1.1.14","manifest":{"name":"graceful-fs","version":"1.1.14","engines":{"node":">=0.4.0"},"dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":"please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js","_resolved":"http://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.14.tgz","_integrity":"sha1-BweNtfY3f2Mh/Oqu30l94STclGU=","_shasum":"07078db5f6377f6321fceaaedf497de124dc9465","_shrinkwrap":null,"bin":null,"_id":"graceful-fs@1.1.14"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/ed/27/eea30d253f59f5df5e11155392ad66e8ee2a352798e5fe782b98c941c2c6 b/deps/npm/test/npm_cache/_cacache/index-v5/ed/27/eea30d253f59f5df5e11155392ad66e8ee2a352798e5fe782b98c941c2c6 new file mode 100644 index 00000000000000..ed9713ce31dcbc --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/ed/27/eea30d253f59f5df5e11155392ad66e8ee2a352798e5fe782b98c941c2c6 @@ -0,0 +1,3 @@ + +eeca4d82c272dcf056ae5ccedbee1bc36d0016e5 {"key":"make-fetch-happen:request-cache:http://localhost:1337/checker/-/checker-0.5.2.tgz","integrity":"sha1-wno2vwDzp6PSSo+8eFPwb85OnIY=","time":1547833073425,"size":7954,"metadata":{"url":"http://localhost:1337/checker/-/checker-0.5.2.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["871adf8f5053357c"],"referer":["install"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:checker@http://localhost:1337/checker/-/checker-0.5.2.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:37:53 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +372d7d61d7b9afb8dc42427e73af7c095a7c0b99 {"key":"make-fetch-happen:request-cache:http://localhost:1337/checker/-/checker-0.5.2.tgz","integrity":"sha1-wno2vwDzp6PSSo+8eFPwb85OnIY=","time":1547833093304,"size":7954,"metadata":{"url":"http://localhost:1337/checker/-/checker-0.5.2.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["fcd144259ba74815"],"referer":["install ."],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:checker@http://localhost:1337/checker/-/checker-0.5.2.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:13 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/ed/4a/09a226827d40ba61648afad16c456d1d0fbce7e14fc1c7a9dba42620f68a b/deps/npm/test/npm_cache/_cacache/index-v5/ed/4a/09a226827d40ba61648afad16c456d1d0fbce7e14fc1c7a9dba42620f68a new file mode 100644 index 00000000000000..c60c0db4778810 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/ed/4a/09a226827d40ba61648afad16c456d1d0fbce7e14fc1c7a9dba42620f68a @@ -0,0 +1,3 @@ + +57d3cd9efcea5462da06a3e9cc811ce05f70f512 {"key":"make-fetch-happen:request-cache:http://localhost:1337/registry/add-named-update-protocol-port/-/add-named-update-protocol-port-0.0.0.tgz","integrity":"sha1-NWoZK3kTsExUV00Ywo1G5jlUKKs=","time":1547832996631,"size":1,"metadata":{"url":"http://localhost:1337/registry/add-named-update-protocol-port/-/add-named-update-protocol-port-0.0.0.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["2b49fe996267b15d"],"referer":["cache add add-named-update-protocol-port@0.0.0"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:add-named-update-protocol-port@http://localhost:1337/registry/add-named-update-protocol-port/-/add-named-update-protocol-port-0.0.0.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:36 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +297227923865262e10cdf85969912988683723cc {"key":"make-fetch-happen:request-cache:http://localhost:1337/registry/add-named-update-protocol-port/-/add-named-update-protocol-port-0.0.0.tgz","integrity":"sha1-NWoZK3kTsExUV00Ywo1G5jlUKKs=","time":1547833219219,"size":1,"metadata":{"url":"http://localhost:1337/registry/add-named-update-protocol-port/-/add-named-update-protocol-port-0.0.0.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["302f70336b58dfc7"],"referer":["cache add add-named-update-protocol-port@0.0.0"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:add-named-update-protocol-port@http://localhost:1337/registry/add-named-update-protocol-port/-/add-named-update-protocol-port-0.0.0.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:19 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/ee/20/77825ded7fe59483cde11169fc083be6367490e46bce28208b4f7b5cb2f8 b/deps/npm/test/npm_cache/_cacache/index-v5/ee/20/77825ded7fe59483cde11169fc083be6367490e46bce28208b4f7b5cb2f8 new file mode 100644 index 00000000000000..a22def52c27479 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/ee/20/77825ded7fe59483cde11169fc083be6367490e46bce28208b4f7b5cb2f8 @@ -0,0 +1,2 @@ + +a18279e98f139d677e0afaef21df7110cd5d2407 {"key":"pacote:range-manifest:http://localhost:1337/async/-/async-0.2.10.tgz:sha1-trvgsGdLnXGXCMo43owjfLUmw9E=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833073453,"size":1,"metadata":{"id":"async@0.2.10","manifest":{"name":"async","version":"0.2.10","dependencies":{},"optionalDependencies":{},"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/async/-/async-0.2.10.tgz","_integrity":"sha1-trvgsGdLnXGXCMo43owjfLUmw9E=","_shasum":"b6bbe0b0674b9d719708ca38de8c237cb526c3d1","_shrinkwrap":null,"bin":null,"_id":"async@0.2.10"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/f2/8a/d9e34baa5c3e47b2bf8e975217eae2e4816c2a8e9cdee330a1e2acfbd7a6 b/deps/npm/test/npm_cache/_cacache/index-v5/f2/8a/d9e34baa5c3e47b2bf8e975217eae2e4816c2a8e9cdee330a1e2acfbd7a6 new file mode 100644 index 00000000000000..b2fbe3ca37e1e5 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/f2/8a/d9e34baa5c3e47b2bf8e975217eae2e4816c2a8e9cdee330a1e2acfbd7a6 @@ -0,0 +1,3 @@ + +be8503a914b4a9eb05323f6589baa6e95ac1ace5 {"key":"pacote:packed-dir:git://localhost:1234/child.git#3c75176bfda09442604d2a1a23d56f3e73d4655d","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833228437,"size":143} +db82585066c86ab6739fbbd6d29417c3bf41b0af {"key":"pacote:packed-dir:git://localhost:1234/child.git#3c75176bfda09442604d2a1a23d56f3e73d4655d","integrity":"sha512-tIpFTFX5X6A1HMpHl2H1/3kvj3q0RI8rE5mjrDd4pgopP3H+7aKWeM4VtxcSsIA/mGbpLAy8RUm0gHQ13PenZw==","time":1547833228736,"size":143} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/f2/dd/746a6d5b6232e793f562d37f6471e6bd96641b1670b43d01fca9e23884e3 b/deps/npm/test/npm_cache/_cacache/index-v5/f2/dd/746a6d5b6232e793f562d37f6471e6bd96641b1670b43d01fca9e23884e3 new file mode 100644 index 00000000000000..6f87578c6af746 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/f2/dd/746a6d5b6232e793f562d37f6471e6bd96641b1670b43d01fca9e23884e3 @@ -0,0 +1,2 @@ + +1484b5a751a41026c82f5e15df79dad5b49ec0b0 {"key":"pacote:version-manifest:http://localhost:1337/wordwrap/-/wordwrap-0.0.2.tgz:sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833093388,"size":1,"metadata":{"id":"wordwrap@0.0.2","manifest":{"name":"wordwrap","version":"0.0.2","engines":{"node":">=0.4.0"},"dependencies":{},"optionalDependencies":{},"devDependencies":{"expresso":"=0.7.x"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/wordwrap/-/wordwrap-0.0.2.tgz","_integrity":"sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=","_shasum":"b79669bb42ecb409f83d583cad52ca17eaa1643f","_shrinkwrap":null,"bin":null,"_id":"wordwrap@0.0.2"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/f6/6a/1afded1007145f766ff1dbaa948bd898062da50bed98d5b04f317278fa48 b/deps/npm/test/npm_cache/_cacache/index-v5/f6/6a/1afded1007145f766ff1dbaa948bd898062da50bed98d5b04f317278fa48 new file mode 100644 index 00000000000000..7d47a831f0eaa9 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/f6/6a/1afded1007145f766ff1dbaa948bd898062da50bed98d5b04f317278fa48 @@ -0,0 +1,13 @@ + +c496bdab66ee640e57ac94ecc9d022045efa0842 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-5wbenY5s4WFSvlN8vM3yYyGz1ng5TOQvtWqk5po3q6nVTfKEcA0Gb35tAF5GGrQdIg/W8mj/iJ5AWAkQinuGdg==","time":1547833099859,"size":42,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["b2a762637ebb6243"],"referer":["dist-tag ls [REDACTED]"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:19 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +7df52710572e8f306657a1d0dd6aabc3d8e7f5cc {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-5wbenY5s4WFSvlN8vM3yYyGz1ng5TOQvtWqk5po3q6nVTfKEcA0Gb35tAF5GGrQdIg/W8mj/iJ5AWAkQinuGdg==","time":1547833100433,"size":42,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["7e0824b4d5754fe0"],"referer":["dist-tag [REDACTED]"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:20 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +21038ebd62c8b343b8e8f462cada4028f187e1d8 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-5wbenY5s4WFSvlN8vM3yYyGz1ng5TOQvtWqk5po3q6nVTfKEcA0Gb35tAF5GGrQdIg/W8mj/iJ5AWAkQinuGdg==","time":1547833100966,"size":42,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["0aee77a11a611461"],"referer":["dist-tag add [REDACTED] c"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:20 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +d11897de6f93b8ee83147e14e3e94d21cb34fd86 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-oaEHLK5hbB9keREOPj7lT6FpeMCB2AMpmdYtIH5c1sdkPkY9c9P/SyGK1xdyTJGAE+A5VPlykZLL36HQvtb9OQ==","time":1547833101529,"size":30,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["06964db6715165d3"],"referer":["dist-tag set [REDACTED] b"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:21 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +cf1322bf05e7a817e46edba40a374e330227821a {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-NTlyH3BfYhz/4w28govjh+JTxQ7QX7Co4/QYdpmWvd4d0cuK8uR9/pQXqresPSONHwNu8umtuJjDhvDNqbaGHg==","time":1547833102191,"size":54,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["988ea95f43da9d36"],"referer":["dist-tag rm [REDACTED] c"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:22 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +9d153a064fd24e83593e524e4d4fe88cf33df00d {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-oPha6LSEvHH7E+9ja5ruRfVIq2NXSINp/7AvI5+Uc8a5TFwqXvOxuW4WzmFY3AXxPviLzvMt47xBWkjNxVADVQ==","time":1547833102764,"size":18,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["b718f0bf6694646a"],"referer":["dist-tag rm [REDACTED] nonexistent"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:38:22 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +7891988ddf3d1f7d07a3b3fef3a1824bd55e7a13 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-5wbenY5s4WFSvlN8vM3yYyGz1ng5TOQvtWqk5po3q6nVTfKEcA0Gb35tAF5GGrQdIg/W8mj/iJ5AWAkQinuGdg==","time":1547833320255,"size":42,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["184ec63f44d4f2af"],"referer":["dist-tag ls [REDACTED]"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:42:00 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +30f4ec8b2f2af36098df7b3092cf8605f09a2959 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-5wbenY5s4WFSvlN8vM3yYyGz1ng5TOQvtWqk5po3q6nVTfKEcA0Gb35tAF5GGrQdIg/W8mj/iJ5AWAkQinuGdg==","time":1547833320772,"size":42,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["90674af1a572a629"],"referer":["dist-tag [REDACTED]"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:42:00 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +b6c279032b629776673d4e5cdc4424181e1acc3f {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-5wbenY5s4WFSvlN8vM3yYyGz1ng5TOQvtWqk5po3q6nVTfKEcA0Gb35tAF5GGrQdIg/W8mj/iJ5AWAkQinuGdg==","time":1547833321318,"size":42,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["bfc4da9b2d97d1c7"],"referer":["dist-tag add [REDACTED] c"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:42:01 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +0fdfd60b28cb1869d83ca01b7b194e1b400a6bf3 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-oaEHLK5hbB9keREOPj7lT6FpeMCB2AMpmdYtIH5c1sdkPkY9c9P/SyGK1xdyTJGAE+A5VPlykZLL36HQvtb9OQ==","time":1547833321936,"size":30,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["576fdd8ec20fae78"],"referer":["dist-tag set [REDACTED] b"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:42:01 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +4c7b732b7c0ca0c535817874a053b602ba0ffd78 {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-NTlyH3BfYhz/4w28govjh+JTxQ7QX7Co4/QYdpmWvd4d0cuK8uR9/pQXqresPSONHwNu8umtuJjDhvDNqbaGHg==","time":1547833322468,"size":54,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["2b7cb98442d19d37"],"referer":["dist-tag rm [REDACTED] c"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:42:02 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +cbf1ecd55e1db2acc2575f79d62ab2527ff3b6ca {"key":"make-fetch-happen:request-cache:http://localhost:1337/-/package/@scoped%2fanother/dist-tags","integrity":"sha512-oPha6LSEvHH7E+9ja5ruRfVIq2NXSINp/7AvI5+Uc8a5TFwqXvOxuW4WzmFY3AXxPviLzvMt47xBWkjNxVADVQ==","time":1547833323093,"size":18,"metadata":{"url":"http://localhost:1337/-/package/@scoped%2fanother/dist-tags","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":["@scoped"],"npm-session":["d321519b8d5f7e23"],"referer":["dist-tag rm [REDACTED] nonexistent"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:42:03 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/fc/88/41f0501b29bfe9117061c190df783256e332cab7782a7484078354ddbb0f b/deps/npm/test/npm_cache/_cacache/index-v5/fc/88/41f0501b29bfe9117061c190df783256e332cab7782a7484078354ddbb0f new file mode 100644 index 00000000000000..9701c3fb55faf9 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/fc/88/41f0501b29bfe9117061c190df783256e332cab7782a7484078354ddbb0f @@ -0,0 +1,3 @@ + +e05851ada6a8b60a84358486f62dd100be2f8170 {"key":"make-fetch-happen:request-cache:http://127.0.0.1:1338/registry/add-named-update-protocol-porti/-/add-named-update-protocol-porti-0.0.0.tgz","integrity":"sha1-NWoZK3kTsExUV00Ywo1G5jlUKKs=","time":1547832997192,"size":1,"metadata":{"url":"http://127.0.0.1:1338/registry/add-named-update-protocol-porti/-/add-named-update-protocol-porti-0.0.0.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["8cb41ddc499c27b6"],"referer":["cache add add-named-update-protocol-porti@0.0.0"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:add-named-update-protocol-porti@http://127.0.0.1:1338/registry/add-named-update-protocol-porti/-/add-named-update-protocol-porti-0.0.0.tgz"]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:36:37 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} +bcd7495c1e69e7cbfd7cda387abb72f8454a0a9e {"key":"make-fetch-happen:request-cache:http://127.0.0.1:1338/registry/add-named-update-protocol-porti/-/add-named-update-protocol-porti-0.0.0.tgz","integrity":"sha1-NWoZK3kTsExUV00Ywo1G5jlUKKs=","time":1547833219779,"size":1,"metadata":{"url":"http://127.0.0.1:1338/registry/add-named-update-protocol-porti/-/add-named-update-protocol-porti-0.0.0.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.6.0 node/v11.6.0 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["87b598eff1cdd205"],"referer":["cache add add-named-update-protocol-porti@0.0.0"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:add-named-update-protocol-porti@http://127.0.0.1:1338/registry/add-named-update-protocol-porti/-/add-named-update-protocol-porti-0.0.0.tgz"]},"resHeaders":{"connection":["close"],"date":["Fri, 18 Jan 2019 17:40:19 GMT"],"transfer-encoding":["chunked"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/fd/a9/67911fbad568af62425934e3a7938145b60af92641734e54a8f50a418c03 b/deps/npm/test/npm_cache/_cacache/index-v5/fd/a9/67911fbad568af62425934e3a7938145b60af92641734e54a8f50a418c03 new file mode 100644 index 00000000000000..c035c359fd6d67 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/fd/a9/67911fbad568af62425934e3a7938145b60af92641734e54a8f50a418c03 @@ -0,0 +1,2 @@ + +cf643ea07623ca00c880b88ac8d9fbb1b1c76ba6 {"key":"pacote:version-manifest:http://localhost:1337/async/-/async-0.2.10.tgz:sha1-trvgsGdLnXGXCMo43owjfLUmw9E=","integrity":"sha512-C2EkHXwXvLsbrucJTRS3xFHv7Mf/y9klmKDxPTE8yevCoH5h8Ae69Y+/lP+ahpW91crnzgO78elOk2E6APJfIQ==","time":1547833093331,"size":1,"metadata":{"id":"async@0.2.10","manifest":{"name":"async","version":"0.2.10","dependencies":{},"optionalDependencies":{},"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"http://localhost:1337/async/-/async-0.2.10.tgz","_integrity":"sha1-trvgsGdLnXGXCMo43owjfLUmw9E=","_shasum":"b6bbe0b0674b9d719708ca38de8c237cb526c3d1","_shrinkwrap":null,"bin":null,"_id":"async@0.2.10"},"type":"finalized-manifest"}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/fe/7e/e4d136986019ebc5360c54baee7ae9bec37f513387665b57ac2bcd167b70 b/deps/npm/test/npm_cache/_cacache/index-v5/fe/7e/e4d136986019ebc5360c54baee7ae9bec37f513387665b57ac2bcd167b70 new file mode 100644 index 00000000000000..7d5b158124cf73 --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/fe/7e/e4d136986019ebc5360c54baee7ae9bec37f513387665b57ac2bcd167b70 @@ -0,0 +1,2 @@ + +8cdd51e878b62f99bcceb9269e1a21a0fa5474c3 {"key":"make-fetch-happen:request-cache:https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.14.tgz","integrity":"sha1-BweNtfY3f2Mh/Oqu30l94STclGU=","time":1544485144557,"size":4025,"metadata":{"url":"https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.14.tgz","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.5.0 node/v10.14.1 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["28a99044412a2230"],"referer":["install [REDACTED]"],"pacote-req-type":["tarball"],"pacote-pkg-id":["registry:graceful-fs@https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.14.tgz"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"date":["Mon, 10 Dec 2018 23:39:04 GMT"],"content-type":["application/octet-stream"],"content-length":["4025"],"connection":["keep-alive"],"set-cookie":["__cfduid=d9119cbf97c872d57754e45bf35e112b91544485144; expires=Tue, 10-Dec-19 23:39:04 GMT; path=/; domain=.registry.npmjs.org; HttpOnly"],"cf-cache-status":["HIT"],"cache-control":["max-age=432000"],"accept-ranges":["bytes"],"cf-ray":["48738c79492b6c4c-SJC"],"etag":["\"fb46c820a063a666be04b2c416d51b29\""],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"last-modified":["Sun, 27 May 2018 02:39:27 GMT"],"vary":["Accept-Encoding"],"server":["cloudflare"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_cacache/index-v5/ff/d3/eca629ba696cac5a91e13f61bb768d7cbf82072f798d17071572ab3943f2 b/deps/npm/test/npm_cache/_cacache/index-v5/ff/d3/eca629ba696cac5a91e13f61bb768d7cbf82072f798d17071572ab3943f2 new file mode 100644 index 00000000000000..2df72adaac8b1c --- /dev/null +++ b/deps/npm/test/npm_cache/_cacache/index-v5/ff/d3/eca629ba696cac5a91e13f61bb768d7cbf82072f798d17071572ab3943f2 @@ -0,0 +1,2 @@ + +f958db19324fd46983256770efb05e8753aac7f6 {"key":"make-fetch-happen:request-cache:https://registry.npmjs.org/inherits","integrity":"sha512-IYLqxPg+UPO2qovqVhxd/r3B1mlB4tp4WvQG4EXeVqD8QiA0yn+iq1+pkCLGuGAgPrSFPOhfFfJrlshLjZ5zIA==","time":1544485144511,"size":1494,"metadata":{"url":"https://registry.npmjs.org/inherits","reqHeaders":{"connection":["keep-alive"],"user-agent":["npm/6.5.0 node/v10.14.1 darwin x64"],"npm-in-ci":["false"],"npm-scope":[""],"npm-session":["28a99044412a2230"],"referer":["install [REDACTED]"],"pacote-req-type":["packument"],"pacote-pkg-id":["registry:inherits"],"accept":["application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"],"authorization":["Basic dXNlcm5hbWU6cGFzc3dvcmQ="]},"resHeaders":{"date":["Mon, 10 Dec 2018 23:39:04 GMT"],"content-type":["application/vnd.npm.install-v1+json"],"content-length":["1494"],"connection":["keep-alive"],"set-cookie":["__cfduid=d9119cbf97c872d57754e45bf35e112b91544485144; expires=Tue, 10-Dec-19 23:39:04 GMT; path=/; domain=.registry.npmjs.org; HttpOnly"],"cf-cache-status":["HIT"],"cache-control":["max-age=300"],"accept-ranges":["bytes"],"cf-ray":["48738c7909076c4c-SJC"],"etag":["\"419f7e0699d401599186150793ffd002\""],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"last-modified":["Fri, 03 Aug 2018 00:38:04 GMT"],"vary":["accept-encoding, accept"],"server":["cloudflare"],"x-fetch-attempts":["1"]}}} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_24_580Z-debug.log b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_24_580Z-debug.log new file mode 100644 index 00000000000000..c2cc5dbf59a8a0 --- /dev/null +++ b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_24_580Z-debug.log @@ -0,0 +1,54 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', +1 verbose cli '/Users/zkat/Documents/code/work/npm/bin/npm-cli.js', +1 verbose cli 'install', +1 verbose cli '--engine-strict', +1 verbose cli '/Users/zkat/Documents/code/work/npm/test/tap/check-engine-reqs/from', +1 verbose cli '--loglevel', +1 verbose cli 'silly' ] +2 info using npm@6.6.0 +3 info using node@v11.6.0 +4 verbose npm-session cf9ef66b93f6540b +5 silly install loadCurrentTree +6 silly install readLocalPackageData +7 silly pacote directory manifest for undefined@file:/Users/zkat/Documents/code/work/npm/test/tap/check-engine-reqs/from fetched in 7ms +8 timing stage:loadCurrentTree Completed in 22ms +9 silly install loadIdealTree +10 silly install cloneCurrentTreeToIdealTree +11 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms +12 silly install loadShrinkwrap +13 timing stage:loadIdealTree:loadShrinkwrap Completed in 1ms +14 silly install loadAllDepsIntoIdealTree +15 timing stage:rollbackFailedOptional Completed in 0ms +16 timing stage:runTopLevelLifecycles Completed in 26ms +17 silly saveTree in +18 verbose stack Error: Unsupported engine for check-engine-reqs@0.0.1: wanted: {"node":"1.0.0-not-a-real-version"} (current: {"node":"11.6.0","npm":"6.6.0"}) +18 verbose stack at checkEngine (/Users/zkat/Documents/code/work/npm/node_modules/npm-install-checks/index.js:13:14) +18 verbose stack at module.exports.isInstallable (/Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:49:3) +18 verbose stack at Array. (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/bind-actor.js:15:8) +18 verbose stack at LOOP (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:15:14) +18 verbose stack at /Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:18:7 +18 verbose stack at checkSelf (/Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:57:72) +18 verbose stack at Array. (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/bind-actor.js:15:8) +18 verbose stack at LOOP (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:15:14) +18 verbose stack at /Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:18:7 +18 verbose stack at hasMinimumFields (/Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:30:12) +18 verbose stack at Array. (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/bind-actor.js:15:8) +18 verbose stack at LOOP (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:15:14) +18 verbose stack at chain (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:20:5) +18 verbose stack at /Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:16:5 +18 verbose stack at /Users/zkat/Documents/code/work/npm/node_modules/slide/lib/async-map.js:52:35 +18 verbose stack at Array.forEach () +19 verbose pkgid check-engine-reqs@0.0.1 +20 verbose cwd /Users/zkat/Documents/code/work/npm/test/tap/check-engine-reqs/in +21 verbose Darwin 18.0.0 +22 verbose argv "/usr/local/bin/node" "/Users/zkat/Documents/code/work/npm/bin/npm-cli.js" "install" "--engine-strict" "/Users/zkat/Documents/code/work/npm/test/tap/check-engine-reqs/from" "--loglevel" "silly" +23 verbose node v11.6.0 +24 verbose npm v6.6.0 +25 error code ENOTSUP +26 error notsup Unsupported engine for check-engine-reqs@0.0.1: wanted: {"node":"1.0.0-not-a-real-version"} (current: {"node":"11.6.0","npm":"6.6.0"}) +27 error notsup Not compatible with your version of node/npm: check-engine-reqs@0.0.1 +28 error notsup Not compatible with your version of node/npm: check-engine-reqs@0.0.1 +28 error notsup Required: {"node":"1.0.0-not-a-real-version"} +28 error notsup Actual: {"npm":"6.6.0","node":"11.6.0"} +29 verbose exit [ 1, true ] diff --git a/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_26_268Z-debug.log b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_26_268Z-debug.log new file mode 100644 index 00000000000000..b8f0a259aa8d92 --- /dev/null +++ b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_26_268Z-debug.log @@ -0,0 +1,56 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', +1 verbose cli '/Users/zkat/Documents/code/work/npm/bin/npm-cli.js', +1 verbose cli 'install', +1 verbose cli '/Users/zkat/Documents/code/work/npm/test/tap/check-install-self/from' ] +2 info using npm@6.6.0 +3 info using node@v11.6.0 +4 verbose npm-session 61cb12d52a202aa0 +5 silly install loadCurrentTree +6 silly install readLocalPackageData +7 silly pacote directory manifest for undefined@file:/Users/zkat/Documents/code/work/npm/test/tap/check-install-self/from fetched in 5ms +8 timing stage:loadCurrentTree Completed in 27ms +9 silly install loadIdealTree +10 silly install cloneCurrentTreeToIdealTree +11 timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms +12 silly install loadShrinkwrap +13 timing stage:loadIdealTree:loadShrinkwrap Completed in 0ms +14 silly install loadAllDepsIntoIdealTree +15 timing stage:rollbackFailedOptional Completed in 1ms +16 timing stage:runTopLevelLifecycles Completed in 30ms +17 silly saveTree check-install-self@0.0.1 +18 verbose stack Error: Refusing to install package with name "check-install-self" under a package +18 verbose stack also called "check-install-self". Did you name your project the same +18 verbose stack as the dependency you're installing? +18 verbose stack +18 verbose stack For more information, see: +18 verbose stack +18 verbose stack at checkSelf (/Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:64:14) +18 verbose stack at Array. (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/bind-actor.js:15:8) +18 verbose stack at LOOP (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:15:14) +18 verbose stack at /Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:18:7 +18 verbose stack at hasMinimumFields (/Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:30:12) +18 verbose stack at Array. (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/bind-actor.js:15:8) +18 verbose stack at LOOP (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:15:14) +18 verbose stack at chain (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:20:5) +18 verbose stack at /Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:16:5 +18 verbose stack at /Users/zkat/Documents/code/work/npm/node_modules/slide/lib/async-map.js:52:35 +18 verbose stack at Array.forEach () +18 verbose stack at /Users/zkat/Documents/code/work/npm/node_modules/slide/lib/async-map.js:52:11 +18 verbose stack at Array.forEach () +18 verbose stack at asyncMap (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/async-map.js:51:8) +18 verbose stack at module.exports (/Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:15:3) +18 verbose stack at Array. (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/bind-actor.js:15:8) +19 verbose cwd /Users/zkat/Documents/code/work/npm/test/tap/check-install-self/in +20 verbose Darwin 18.0.0 +21 verbose argv "/usr/local/bin/node" "/Users/zkat/Documents/code/work/npm/bin/npm-cli.js" "install" "/Users/zkat/Documents/code/work/npm/test/tap/check-install-self/from" +22 verbose node v11.6.0 +23 verbose npm v6.6.0 +24 error code ENOSELF +25 error Refusing to install package with name "check-install-self" under a package +25 error also called "check-install-self". Did you name your project the same +25 error as the dependency you're installing? +25 error +25 error For more information, see: +25 error +26 verbose exit [ 1, true ] diff --git a/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_28_020Z-debug.log b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_28_020Z-debug.log new file mode 100644 index 00000000000000..27a7399a72cb36 --- /dev/null +++ b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_28_020Z-debug.log @@ -0,0 +1,53 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', +1 verbose cli '/Users/zkat/Documents/code/work/npm/bin/npm-cli.js', +1 verbose cli 'install', +1 verbose cli '/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/from', +1 verbose cli '--loglevel', +1 verbose cli 'silly' ] +2 info using npm@6.6.0 +3 info using node@v11.6.0 +4 verbose npm-session 0d53651f554c2a7e +5 silly install loadCurrentTree +6 silly install readLocalPackageData +7 silly pacote directory manifest for undefined@file:/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/from fetched in 5ms +8 timing stage:loadCurrentTree Completed in 20ms +9 silly install loadIdealTree +10 silly install cloneCurrentTreeToIdealTree +11 timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms +12 silly install loadShrinkwrap +13 timing stage:loadIdealTree:loadShrinkwrap Completed in 0ms +14 silly install loadAllDepsIntoIdealTree +15 timing stage:rollbackFailedOptional Completed in 1ms +16 timing stage:runTopLevelLifecycles Completed in 23ms +17 silly saveTree in +18 verbose stack Error: Unsupported platform for check-os-reqs@0.0.1: wanted {"name":"check-os-reqs","version":"0.0.1","os":["fake-os"],"dependencies":{},"optionalDependencies":{},"devDependencies":{},"bundleDependencies":false,"peerDependencies":{},"deprecated":false,"_resolved":"/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/from","_integrity":null,"_shasum":null,"_shrinkwrap":null,"bin":null,"_id":"check-os-reqs@0.0.1","_from":"file:/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/from","_requested":{"type":"directory","where":"/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/in","raw":"/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/from","rawSpec":"/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/from","saveSpec":"file:/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/from","fetchSpec":"/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/from"},"_spec":"/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/from","_where":"/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/in"} (current: {"os":"darwin","cpu":"x64"}) +18 verbose stack at checkPlatform (/Users/zkat/Documents/code/work/npm/node_modules/npm-install-checks/index.js:45:14) +18 verbose stack at thenWarnEngineIssues (/Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:52:5) +18 verbose stack at a (/Users/zkat/Documents/code/work/npm/node_modules/iferr/iferr.js:3:64) +18 verbose stack at checkEngine (/Users/zkat/Documents/code/work/npm/node_modules/npm-install-checks/index.js:10:20) +18 verbose stack at module.exports.isInstallable (/Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:49:3) +18 verbose stack at Array. (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/bind-actor.js:15:8) +18 verbose stack at LOOP (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:15:14) +18 verbose stack at /Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:18:7 +18 verbose stack at checkSelf (/Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:57:72) +18 verbose stack at Array. (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/bind-actor.js:15:8) +18 verbose stack at LOOP (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:15:14) +18 verbose stack at /Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:18:7 +18 verbose stack at hasMinimumFields (/Users/zkat/Documents/code/work/npm/lib/install/validate-args.js:30:12) +18 verbose stack at Array. (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/bind-actor.js:15:8) +18 verbose stack at LOOP (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:15:14) +18 verbose stack at chain (/Users/zkat/Documents/code/work/npm/node_modules/slide/lib/chain.js:20:5) +19 verbose pkgid check-os-reqs@0.0.1 +20 verbose cwd /Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/in +21 verbose Darwin 18.0.0 +22 verbose argv "/usr/local/bin/node" "/Users/zkat/Documents/code/work/npm/bin/npm-cli.js" "install" "/Users/zkat/Documents/code/work/npm/test/tap/check-os-reqs/from" "--loglevel" "silly" +23 verbose node v11.6.0 +24 verbose npm v6.6.0 +25 error code EBADPLATFORM +26 error notsup Unsupported platform for check-os-reqs@0.0.1: wanted {"os":"fake-os","arch":"any"} (current: {"os":"darwin","arch":"x64"}) +27 error notsup Valid OS: fake-os +27 error notsup Valid Arch: any +27 error notsup Actual OS: darwin +27 error notsup Actual Arch: x64 +28 verbose exit [ 1, true ] diff --git a/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_39_719Z-debug.log b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_39_719Z-debug.log new file mode 100644 index 00000000000000..078b12da87fd78 --- /dev/null +++ b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_39_719Z-debug.log @@ -0,0 +1,27 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', +1 verbose cli '/Users/zkat/Documents/code/work/npm/bin/npm-cli.js', +1 verbose cli 'ci', +1 verbose cli '--registry', +1 verbose cli 'http://localhost:1337', +1 verbose cli '--loglevel', +1 verbose cli 'warn' ] +2 info using npm@6.6.0 +3 info using node@v11.6.0 +4 verbose npm-session ebc502d2075f4b06 +5 info prepare initializing installer +6 verbose prepare starting workers +7 verbose prepare installation prefix: /Users/zkat/Documents/code/work/npm/test/tap/ci +8 verbose checkLock verifying package-lock data +9 verbose teardown shutting down workers. +10 info teardown Done in 0s +11 verbose stack Error: cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again. +11 verbose stack at Installer.checkLock (/Users/zkat/Documents/code/work/npm/node_modules/libcipm/index.js:184:9) +11 verbose stack at then.then.then.stat (/Users/zkat/Documents/code/work/npm/node_modules/libcipm/index.js:158:16) +12 verbose cwd /Users/zkat/Documents/code/work/npm/test/tap/ci +13 verbose Darwin 18.0.0 +14 verbose argv "/usr/local/bin/node" "/Users/zkat/Documents/code/work/npm/bin/npm-cli.js" "ci" "--registry" "http://localhost:1337" "--loglevel" "warn" +15 verbose node v11.6.0 +16 verbose npm v6.6.0 +17 error cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again. +18 verbose exit [ 1, true ] diff --git a/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_40_242Z-debug.log b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_40_242Z-debug.log new file mode 100644 index 00000000000000..b88b1c08ceb40c --- /dev/null +++ b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_40_242Z-debug.log @@ -0,0 +1,34 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', +1 verbose cli '/Users/zkat/Documents/code/work/npm/bin/npm-cli.js', +1 verbose cli 'ci', +1 verbose cli '--registry', +1 verbose cli 'http://localhost:1337', +1 verbose cli '--loglevel', +1 verbose cli 'warn' ] +2 info using npm@6.6.0 +3 info using node@v11.6.0 +4 verbose npm-session 81dd68c6da560193 +5 info prepare initializing installer +6 verbose prepare starting workers +7 verbose prepare installation prefix: /Users/zkat/Documents/code/work/npm/test/tap/ci +8 verbose prepare using package-lock.json +9 verbose checkLock verifying package-lock data +10 verbose teardown shutting down workers. +11 info teardown Done in 0s +12 verbose stack Error: cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing. +12 verbose stack +12 verbose stack +12 verbose stack Missing: optimist@0.6.0 +12 verbose stack +12 verbose stack at lockVerify.then.result (/Users/zkat/Documents/code/work/npm/node_modules/libcipm/index.js:191:15) +13 verbose cwd /Users/zkat/Documents/code/work/npm/test/tap/ci +14 verbose Darwin 18.0.0 +15 verbose argv "/usr/local/bin/node" "/Users/zkat/Documents/code/work/npm/bin/npm-cli.js" "ci" "--registry" "http://localhost:1337" "--loglevel" "warn" +16 verbose node v11.6.0 +17 verbose npm v6.6.0 +18 error cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing. +18 error +18 error +18 error Missing: optimist@0.6.0 +19 verbose exit [ 1, true ] diff --git a/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_47_912Z-debug.log b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_47_912Z-debug.log new file mode 100644 index 00000000000000..4013f3d68de771 --- /dev/null +++ b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_47_912Z-debug.log @@ -0,0 +1,21 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', +1 verbose cli '/Users/zkat/Documents/code/work/npm/bin/npm-cli.js', +1 verbose cli 'config', +1 verbose cli 'get', +1 verbose cli '_auth' ] +2 info using npm@6.6.0 +3 info using node@v11.6.0 +4 verbose stack Error: ---sekretz--- +4 verbose stack at get (/Users/zkat/Documents/code/work/npm/lib/config.js:166:15) +4 verbose stack at EventEmitter.config (/Users/zkat/Documents/code/work/npm/lib/config.js:68:14) +4 verbose stack at Object.commandCache.(anonymous function) (/Users/zkat/Documents/code/work/npm/lib/npm.js:156:13) +4 verbose stack at EventEmitter. (/Users/zkat/Documents/code/work/npm/bin/npm-cli.js:131:30) +4 verbose stack at process.internalTickCallback (internal/process/next_tick.js:70:11) +5 verbose cwd /Users/zkat/Documents/code/work/npm/test/tap/config-private +6 verbose Darwin 18.0.0 +7 verbose argv "/usr/local/bin/node" "/Users/zkat/Documents/code/work/npm/bin/npm-cli.js" "config" "get" "_auth" +8 verbose node v11.6.0 +9 verbose npm v6.6.0 +10 error ---sekretz--- +11 verbose exit [ 1, true ] diff --git a/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_48_220Z-debug.log b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_48_220Z-debug.log new file mode 100644 index 00000000000000..126eb27b68b912 --- /dev/null +++ b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_48_220Z-debug.log @@ -0,0 +1,21 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', +1 verbose cli '/Users/zkat/Documents/code/work/npm/bin/npm-cli.js', +1 verbose cli 'config', +1 verbose cli 'get', +1 verbose cli '//registry.npmjs.org/:_password' ] +2 info using npm@6.6.0 +3 info using node@v11.6.0 +4 verbose stack Error: ---sekretz--- +4 verbose stack at get (/Users/zkat/Documents/code/work/npm/lib/config.js:166:15) +4 verbose stack at EventEmitter.config (/Users/zkat/Documents/code/work/npm/lib/config.js:68:14) +4 verbose stack at Object.commandCache.(anonymous function) (/Users/zkat/Documents/code/work/npm/lib/npm.js:156:13) +4 verbose stack at EventEmitter. (/Users/zkat/Documents/code/work/npm/bin/npm-cli.js:131:30) +4 verbose stack at process.internalTickCallback (internal/process/next_tick.js:70:11) +5 verbose cwd /Users/zkat/Documents/code/work/npm/test/tap/config-private +6 verbose Darwin 18.0.0 +7 verbose argv "/usr/local/bin/node" "/Users/zkat/Documents/code/work/npm/bin/npm-cli.js" "config" "get" "//registry.npmjs.org/:_password" +8 verbose node v11.6.0 +9 verbose npm v6.6.0 +10 error ---sekretz--- +11 verbose exit [ 1, true ] diff --git a/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_57_730Z-debug.log b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_57_730Z-debug.log new file mode 100644 index 00000000000000..23b9aeb897e949 --- /dev/null +++ b/deps/npm/test/npm_cache/_logs/2019-01-18T17_41_57_730Z-debug.log @@ -0,0 +1,26 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', +1 verbose cli '/Users/zkat/Documents/code/work/npm/bin/npm-cli.js', +1 verbose cli 'deprecate', +1 verbose cli 'cond@-9001', +1 verbose cli 'make it dead', +1 verbose cli '--registry', +1 verbose cli 'http://localhost:1337' ] +2 info using npm@6.6.0 +3 info using node@v11.6.0 +4 verbose npm-session 754b761c5653fbe8 +5 verbose stack Error: invalid version range: -9001 +5 verbose stack at BB.try (/Users/zkat/Documents/code/work/npm/lib/deprecate.js:52:13) +5 verbose stack at tryCatcher (/Users/zkat/Documents/code/work/npm/node_modules/bluebird/js/release/util.js:16:23) +5 verbose stack at Function.Promise.attempt.Promise.try (/Users/zkat/Documents/code/work/npm/node_modules/bluebird/js/release/method.js:39:29) +5 verbose stack at EventEmitter.deprecate (/Users/zkat/Documents/code/work/npm/lib/deprecate.js:42:16) +5 verbose stack at Object.commandCache.(anonymous function) (/Users/zkat/Documents/code/work/npm/lib/npm.js:156:13) +5 verbose stack at EventEmitter. (/Users/zkat/Documents/code/work/npm/bin/npm-cli.js:131:30) +5 verbose stack at process.internalTickCallback (internal/process/next_tick.js:70:11) +6 verbose cwd /Users/zkat/Documents/code/work/npm +7 verbose Darwin 18.0.0 +8 verbose argv "/usr/local/bin/node" "/Users/zkat/Documents/code/work/npm/bin/npm-cli.js" "deprecate" "cond@-9001" "make it dead" "--registry" "http://localhost:1337" +9 verbose node v11.6.0 +10 verbose npm v6.6.0 +11 error invalid version range: -9001 +12 verbose exit [ 1, true ] diff --git a/deps/npm/test/npm_cache/_logs/2019-01-18T17_42_14_004Z-debug.log b/deps/npm/test/npm_cache/_logs/2019-01-18T17_42_14_004Z-debug.log new file mode 100644 index 00000000000000..737b59e4b61831 --- /dev/null +++ b/deps/npm/test/npm_cache/_logs/2019-01-18T17_42_14_004Z-debug.log @@ -0,0 +1,111 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', +1 verbose cli '/Users/zkat/Documents/code/work/npm/bin/npm-cli.js', +1 verbose cli 'install', +1 verbose cli '--no-save', +1 verbose cli '../test-whoops-1.0.0.tgz' ] +2 info using npm@6.6.0 +3 info using node@v11.6.0 +4 verbose npm-session 6b1152dff5d8deaa +5 silly install loadCurrentTree +6 silly install readLocalPackageData +7 silly pacote file manifest for undefined@file:../test-whoops-1.0.0.tgz fetched in 26ms +8 timing stage:loadCurrentTree Completed in 40ms +9 silly install loadIdealTree +10 silly install cloneCurrentTreeToIdealTree +11 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms +12 silly install loadShrinkwrap +13 timing stage:loadIdealTree:loadShrinkwrap Completed in 1ms +14 silly install loadAllDepsIntoIdealTree +15 silly resolveWithNewModule @test/whoops@1.0.0 checking installable status +16 timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 5ms +17 timing stage:loadIdealTree Completed in 7ms +18 silly currentTree gently-rm-overeager +19 silly idealTree gently-rm-overeager +19 silly idealTree └── @test/whoops@1.0.0 +20 silly install generateActionsToTake +21 timing stage:generateActionsToTake Completed in 4ms +22 silly diffTrees action count 1 +23 silly diffTrees add @test/whoops@1.0.0 +24 silly decomposeActions action count 8 +25 silly decomposeActions fetch @test/whoops@1.0.0 +26 silly decomposeActions extract @test/whoops@1.0.0 +27 silly decomposeActions preinstall @test/whoops@1.0.0 +28 silly decomposeActions build @test/whoops@1.0.0 +29 silly decomposeActions install @test/whoops@1.0.0 +30 silly decomposeActions postinstall @test/whoops@1.0.0 +31 silly decomposeActions finalize @test/whoops@1.0.0 +32 silly decomposeActions refresh-package-json @test/whoops@1.0.0 +33 silly install executeActions +34 silly doSerial global-install 8 +35 verbose correctMkdir /Users/zkat/Documents/code/work/npm/test/npm_cache/_locks correctMkdir not in flight; initializing +36 verbose lock using /Users/zkat/Documents/code/work/npm/test/npm_cache/_locks/staging-6ede0a15658ba472.lock for /Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager/node_modules/.staging +37 silly doParallel extract 1 +38 silly extract @test/whoops@1.0.0 +39 silly tarball trying file:../test-whoops-1.0.0.tgz by hash: sha512-yaIGW7l0bldKVBrwYbeICUjTDkfbHcNWwxS9k0sBaYlNaW6DO9Y7bFPLlz0UuAZLWwQXfEAuNHdw3fu7x8kGyw== +40 silly extract file:../test-whoops-1.0.0.tgz extracted to /Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager/node_modules/.staging/@test/whoops-283f4c1a (13ms) +41 timing action:extract Completed in 16ms +42 silly doReverseSerial unbuild 8 +43 silly doSerial remove 8 +44 silly doSerial move 8 +45 silly doSerial finalize 8 +46 silly finalize /Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager/node_modules/@test/whoops +47 timing action:finalize Completed in 4ms +48 silly doParallel refresh-package-json 1 +49 silly refresh-package-json /Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager/node_modules/@test/whoops +50 timing action:refresh-package-json Completed in 7ms +51 silly doParallel preinstall 1 +52 silly preinstall @test/whoops@1.0.0 +53 info lifecycle @test/whoops@1.0.0~preinstall: @test/whoops@1.0.0 +54 timing action:preinstall Completed in 1ms +55 silly doSerial build 8 +56 silly build @test/whoops@1.0.0 +57 info linkStuff @test/whoops@1.0.0 +58 silly linkStuff @test/whoops@1.0.0 has /Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager/node_modules as its parent node_modules +59 timing action:build Completed in 1ms +60 silly doSerial global-link 8 +61 silly doParallel update-linked 0 +62 silly doSerial install 8 +63 silly install @test/whoops@1.0.0 +64 info lifecycle @test/whoops@1.0.0~install: @test/whoops@1.0.0 +65 timing action:install Completed in 1ms +66 silly doSerial postinstall 8 +67 silly postinstall @test/whoops@1.0.0 +68 info lifecycle @test/whoops@1.0.0~postinstall: @test/whoops@1.0.0 +69 verbose lifecycle @test/whoops@1.0.0~postinstall: unsafe-perm in lifecycle true +70 verbose lifecycle @test/whoops@1.0.0~postinstall: PATH: /Users/zkat/Documents/code/work/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager/node_modules/@test/whoops/node_modules/.bin:/Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager/node_modules/.bin:/Users/zkat/Documents/code/work/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/zkat/Documents/code/work/npm/node_modules/.bin:/Users/zkat/Documents/code/work/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/zkat/Documents/code/work/npm/node_modules/.bin:/Users/zkat/Documents/code/work/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/zkat/Documents/code/work/npm/node_modules/.bin:/Users/zkat/bin:/usr/local/opt/coreutils/libexec/gnubin:/Users/zkat/.cargo/bin:/usr/local/heroku/bin:/usr/local/bin:/Users/zkat/bin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/opt/X11/bin +71 verbose lifecycle @test/whoops@1.0.0~postinstall: CWD: /Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager/node_modules/@test/whoops +72 silly lifecycle @test/whoops@1.0.0~postinstall: Args: [ '-c', "echo 'nope' && exit 1" ] +73 silly lifecycle @test/whoops@1.0.0~postinstall: Returned: code: 1 signal: null +74 info lifecycle @test/whoops@1.0.0~postinstall: Failed to exec postinstall script +75 timing action:postinstall Completed in 70ms +76 verbose unlock done using /Users/zkat/Documents/code/work/npm/test/npm_cache/_locks/staging-6ede0a15658ba472.lock for /Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager/node_modules/.staging +77 timing stage:rollbackFailedOptional Completed in 3ms +78 timing stage:runTopLevelLifecycles Completed in 163ms +79 warn enoent ENOENT: no such file or directory, open '/Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager/package.json' +80 verbose enoent This is related to npm not being able to find a file. +81 warn gently-rm-overeager No description +82 warn gently-rm-overeager No repository field. +83 warn gently-rm-overeager No README data +84 warn gently-rm-overeager No license field. +85 verbose stack Error: @test/whoops@1.0.0 postinstall: `echo 'nope' && exit 1` +85 verbose stack Exit status 1 +85 verbose stack at EventEmitter. (/Users/zkat/Documents/code/work/npm/node_modules/npm-lifecycle/index.js:301:16) +85 verbose stack at EventEmitter.emit (events.js:188:13) +85 verbose stack at ChildProcess. (/Users/zkat/Documents/code/work/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) +85 verbose stack at ChildProcess.emit (events.js:188:13) +85 verbose stack at maybeClose (internal/child_process.js:978:16) +85 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5) +86 verbose pkgid @test/whoops@1.0.0 +87 verbose cwd /Users/zkat/Documents/code/work/npm/test/tap/gently-rm-overeager/gently-rm-overeager +88 verbose Darwin 18.0.0 +89 verbose argv "/usr/local/bin/node" "/Users/zkat/Documents/code/work/npm/bin/npm-cli.js" "install" "--no-save" "../test-whoops-1.0.0.tgz" +90 verbose node v11.6.0 +91 verbose npm v6.6.0 +92 error code ELIFECYCLE +93 error errno 1 +94 error @test/whoops@1.0.0 postinstall: `echo 'nope' && exit 1` +94 error Exit status 1 +95 error Failed at the @test/whoops@1.0.0 postinstall script. +95 error This is probably not a problem with npm. There is likely additional logging output above. +96 verbose exit [ 1, true ] diff --git a/deps/npm/test/npm_cache/anonymous-cli-metrics.json b/deps/npm/test/npm_cache/anonymous-cli-metrics.json new file mode 100644 index 00000000000000..11494d570fed83 --- /dev/null +++ b/deps/npm/test/npm_cache/anonymous-cli-metrics.json @@ -0,0 +1 @@ +{"metricId":"74dc70f8-4d64-41cc-827f-aaa481242c7d","metrics":{"from":"2018-12-10T23:39:04.702Z","to":"2019-01-28T23:28:15.706Z","successfulInstalls":66,"failedInstalls":13}} \ No newline at end of file diff --git a/deps/npm/test/tap/404-private-registry-scoped.js b/deps/npm/test/tap/404-private-registry-scoped.js index 48889376caa379..f8a8c5b05a5721 100644 --- a/deps/npm/test/tap/404-private-registry-scoped.js +++ b/deps/npm/test/tap/404-private-registry-scoped.js @@ -3,7 +3,7 @@ var path = require('path') var mkdirp = require('mkdirp') var rimraf = require('rimraf') var common = require('../common-tap.js') -var mr = require('npm-registry-mock') +var mr = common.fakeRegistry.compat var server var testdir = path.join(__dirname, path.basename(__filename, '.js')) diff --git a/deps/npm/test/tap/404-private-registry.js b/deps/npm/test/tap/404-private-registry.js index a38fa02c12536e..da6e446918f924 100644 --- a/deps/npm/test/tap/404-private-registry.js +++ b/deps/npm/test/tap/404-private-registry.js @@ -3,7 +3,7 @@ var path = require('path') var mkdirp = require('mkdirp') var rimraf = require('rimraf') var common = require('../common-tap.js') -var mr = require('npm-registry-mock') +var mr = common.fakeRegistry.compat var server var packageName = path.basename(__filename, '.js') diff --git a/deps/npm/test/tap/access.js b/deps/npm/test/tap/access.js index 4bed4b4b257972..6a21ccc8fb3ef2 100644 --- a/deps/npm/test/tap/access.js +++ b/deps/npm/test/tap/access.js @@ -1,16 +1,18 @@ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') +'use strict' -var test = require('tap').test -var common = require('../common-tap.js') +const fs = require('fs') +const path = require('path') +const mkdirp = require('mkdirp') +const rimraf = require('rimraf') +const mr = require('npm-registry-mock') -var pkg = path.resolve(__dirname, 'access') -var server +const test = require('tap').test +const common = require('../common-tap.js') -var scoped = { +const pkg = path.resolve(__dirname, 'access') +let server + +const scoped = { name: '@scoped/pkg', version: '1.1.1' } @@ -160,19 +162,22 @@ test('npm change access on unscoped package', function (t) { function (er, code, stdout, stderr) { t.ok(code, 'exited with Error') t.matches( - stderr, /access commands are only accessible for scoped packages/) + stderr, /only available for scoped packages/) t.end() } ) }) test('npm access grant read-only', function (t) { - server.put('/-/team/myorg/myteam/package', { - permissions: 'read-only', - package: '@scoped/another' - }).reply(201, { - accessChaged: true + server.filteringRequestBody((body) => { + const data = JSON.parse(body) + t.deepEqual(data, { + permissions: 'read-only', + package: '@scoped/another' + }, 'got the right body') + return true }) + server.put('/-/team/myorg/myteam/package', true).reply(201) common.npm( [ 'access', @@ -191,12 +196,15 @@ test('npm access grant read-only', function (t) { }) test('npm access grant read-write', function (t) { - server.put('/-/team/myorg/myteam/package', { - permissions: 'read-write', - package: '@scoped/another' - }).reply(201, { - accessChaged: true + server.filteringRequestBody((body) => { + const data = JSON.parse(body) + t.deepEqual(data, { + permissions: 'read-write', + package: '@scoped/another' + }, 'got the right body') + return true }) + server.put('/-/team/myorg/myteam/package', true).reply(201) common.npm( [ 'access', diff --git a/deps/npm/test/tap/all-package-metadata-cache-stream-unit.js b/deps/npm/test/tap/all-package-metadata-cache-stream-unit.js index 51be836769050f..0b4dd0e26d5ce2 100644 --- a/deps/npm/test/tap/all-package-metadata-cache-stream-unit.js +++ b/deps/npm/test/tap/all-package-metadata-cache-stream-unit.js @@ -1,18 +1,20 @@ 'use strict' require('../common-tap.js') -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var path = require('path') -var ms = require('mississippi') -var Tacks = require('tacks') -var File = Tacks.File -var _createCacheEntryStream = require('../../lib/search/all-package-metadata.js')._createCacheEntryStream +const getStream = require('get-stream') +const mkdirp = require('mkdirp') +const path = require('path') +const rimraf = require('rimraf') +const Tacks = require('tacks') +const {test} = require('tap') -var PKG_DIR = path.resolve(__dirname, 'create-cache-entry-stream') -var CACHE_DIR = path.resolve(PKG_DIR, 'cache') +const {File} = Tacks + +const _createCacheEntryStream = require('../../lib/search/all-package-metadata.js')._createCacheEntryStream + +const PKG_DIR = path.resolve(__dirname, 'create-cache-entry-stream') +const CACHE_DIR = path.resolve(PKG_DIR, 'cache') function setup () { mkdirp.sync(CACHE_DIR) @@ -22,10 +24,10 @@ function cleanup () { rimraf.sync(PKG_DIR) } -test('createCacheEntryStream basic', function (t) { +test('createCacheEntryStream basic', t => { setup() - var cachePath = path.join(CACHE_DIR, '.cache.json') - var fixture = new Tacks(File({ + const cachePath = path.join(CACHE_DIR, '.cache.json') + const fixture = new Tacks(File({ '_updated': 1234, bar: { name: 'bar', @@ -37,16 +39,13 @@ test('createCacheEntryStream basic', function (t) { } })) fixture.create(cachePath) - _createCacheEntryStream(cachePath, function (err, stream, latest) { - if (err) throw err + return _createCacheEntryStream(cachePath, {}).then(({ + updateStream: stream, + updatedLatest: latest + }) => { t.equals(latest, 1234, '`latest` correctly extracted') t.ok(stream, 'returned a stream') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - if (err) throw err + return getStream.array(stream).then(results => { t.deepEquals(results, [{ name: 'bar', version: '1.0.0' @@ -55,82 +54,54 @@ test('createCacheEntryStream basic', function (t) { version: '1.0.0' }]) cleanup() - t.done() }) }) }) -test('createCacheEntryStream empty cache', function (t) { +test('createCacheEntryStream empty cache', t => { setup() - var cachePath = path.join(CACHE_DIR, '.cache.json') - var fixture = new Tacks(File({})) + const cachePath = path.join(CACHE_DIR, '.cache.json') + const fixture = new Tacks(File({})) fixture.create(cachePath) - _createCacheEntryStream(cachePath, function (err, stream, latest) { - t.ok(err, 'returned an error because there was no _updated') - t.match(err.message, /Empty or invalid stream/, 'useful error message') - t.notOk(stream, 'no stream returned') - t.notOk(latest, 'no latest returned') - cleanup() - t.done() - }) + return _createCacheEntryStream(cachePath, {}).then( + () => { throw new Error('should not succeed') }, + err => { + t.ok(err, 'returned an error because there was no _updated') + t.match(err.message, /Empty or invalid stream/, 'useful error message') + cleanup() + } + ) }) -test('createCacheEntryStream no entry cache', function (t) { +test('createCacheEntryStream no entry cache', t => { setup() - var cachePath = path.join(CACHE_DIR, '.cache.json') - var fixture = new Tacks(File({ + const cachePath = path.join(CACHE_DIR, '.cache.json') + const fixture = new Tacks(File({ '_updated': 1234 })) fixture.create(cachePath) - _createCacheEntryStream(cachePath, function (err, stream, latest) { - if (err) throw err + return _createCacheEntryStream(cachePath, {}).then(({ + updateStream: stream, + updatedLatest: latest + }) => { t.equals(latest, 1234, '`latest` correctly extracted') t.ok(stream, 'returned a stream') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - if (err) throw err + return getStream.array(stream).then(results => { t.deepEquals(results, [], 'no results') cleanup() - t.done() }) }) }) -test('createCacheEntryStream missing cache', function (t) { +test('createCacheEntryStream missing cache', t => { setup() - var cachePath = path.join(CACHE_DIR, '.cache.json') - _createCacheEntryStream(cachePath, function (err, stream, latest) { - t.ok(err, 'returned an error because there was no cache') - t.equals(err.code, 'ENOENT', 'useful error message') - t.notOk(stream, 'no stream returned') - t.notOk(latest, 'no latest returned') - cleanup() - t.done() - }) -}) - -test('createCacheEntryStream bad syntax', function (t) { - setup() - var cachePath = path.join(CACHE_DIR, '.cache.json') - var fixture = new Tacks(File('{"_updated": 1234, uh oh')) - fixture.create(cachePath) - _createCacheEntryStream(cachePath, function (err, stream, latest) { - if (err) throw err - t.equals(latest, 1234, '`latest` correctly extracted') - t.ok(stream, 'returned a stream') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - t.ok(err, 'stream errored') - t.match(err.message, /Invalid JSON/i, 'explains there\'s a syntax error') - t.deepEquals(results, [], 'no results') + const cachePath = path.join(CACHE_DIR, '.cache.json') + return _createCacheEntryStream(cachePath, {}).then( + () => { throw new Error('should not succeed') }, + err => { + t.ok(err, 'returned an error because there was no cache') + t.equals(err.code, 'ENOENT', 'useful error message') cleanup() - t.done() - }) - }) + } + ) }) diff --git a/deps/npm/test/tap/all-package-metadata-entry-stream-unit.js b/deps/npm/test/tap/all-package-metadata-entry-stream-unit.js index 0e02f848246ce9..4e916229cd852d 100644 --- a/deps/npm/test/tap/all-package-metadata-entry-stream-unit.js +++ b/deps/npm/test/tap/all-package-metadata-entry-stream-unit.js @@ -1,23 +1,23 @@ 'use strict' -var common = require('../common-tap.js') -var npm = require('../../') -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var path = require('path') -var mr = require('npm-registry-mock') -var ms = require('mississippi') -var Tacks = require('tacks') -var File = Tacks.File +const common = require('../common-tap.js') +const getStream = require('get-stream') +const mkdirp = require('mkdirp') +const mr = require('npm-registry-mock') +const npm = require('../../') +const path = require('path') +const rimraf = require('rimraf') +const Tacks = require('tacks') +const test = require('tap').test -var _createEntryStream = require('../../lib/search/all-package-metadata.js')._createEntryStream +const {File} = Tacks -var ALL = common.registry + '/-/all' -var PKG_DIR = path.resolve(__dirname, 'create-entry-update-stream') -var CACHE_DIR = path.resolve(PKG_DIR, 'cache') +const _createEntryStream = require('../../lib/search/all-package-metadata.js')._createEntryStream -var server +const PKG_DIR = path.resolve(__dirname, 'create-entry-update-stream') +const CACHE_DIR = path.resolve(PKG_DIR, 'cache') + +let server function setup () { mkdirp.sync(CACHE_DIR) @@ -27,10 +27,11 @@ function cleanup () { rimraf.sync(PKG_DIR) } -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { +test('setup', t => { + cleanup() + mr({port: common.port, throwOnUnmatched: true}, (err, s) => { t.ifError(err, 'registry mocked successfully') - npm.load({ cache: CACHE_DIR, registry: common.registry }, function (err) { + npm.load({ cache: CACHE_DIR, registry: common.registry }, err => { t.ifError(err, 'npm loaded successfully') server = s t.pass('all set up') @@ -39,10 +40,10 @@ test('setup', function (t) { }) }) -test('createEntryStream full request', function (t) { +test('createEntryStream full request', t => { setup() - var cachePath = path.join(CACHE_DIR, '.cache.json') - var dataTime = +(new Date()) + const cachePath = path.join(CACHE_DIR, '.cache.json') + const dataTime = +(new Date()) server.get('/-/all').once().reply(200, { '_updated': dataTime, 'bar': { name: 'bar', version: '1.0.0' }, @@ -50,37 +51,36 @@ test('createEntryStream full request', function (t) { }, { date: 1234 // should never be used. }) - _createEntryStream(cachePath, ALL, {}, 600, function (err, stream, latest, newEntries) { - if (err) throw err + return _createEntryStream(cachePath, 600, { + registry: common.registry + }).then(({ + entryStream: stream, + latest, + newEntries + }) => { t.equals(latest, dataTime, '`latest` correctly extracted') t.ok(newEntries, 'new entries need to be written to cache') t.ok(stream, 'returned a stream') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - if (err) throw err - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - server.done() - cleanup() - t.end() - }) + return getStream.array(stream) + }).then(results => { + t.deepEquals(results, [{ + name: 'bar', + version: '1.0.0' + }, { + name: 'foo', + version: '1.0.0' + }]) + server.done() + cleanup() }) }) test('createEntryStream cache only', function (t) { setup() - var now = Date.now() - var cacheTime = now - 100000 - var cachePath = path.join(CACHE_DIR, '.cache.json') - var fixture = new Tacks(File({ + const now = Date.now() + const cacheTime = now - 100000 + const cachePath = path.join(CACHE_DIR, '.cache.json') + const fixture = new Tacks(File({ '_updated': cacheTime, bar: { name: 'bar', version: '1.0.0' }, cool: { name: 'cool', version: '1.0.0' }, @@ -88,33 +88,32 @@ test('createEntryStream cache only', function (t) { other: { name: 'other', version: '1.0.0' } })) fixture.create(cachePath) - _createEntryStream(cachePath, ALL, {}, 600, function (err, stream, latest, newEntries) { - if (err) throw err + return _createEntryStream(cachePath, 600, { + registry: common.registry + }).then(({ + entryStream: stream, + latest, + newEntries + }) => { t.equals(latest, cacheTime, '`latest` is cache time') t.ok(stream, 'returned a stream') t.notOk(newEntries, 'cache only means no need to write to cache') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - t.ifError(err, 'stream finished without error') - t.deepEquals( - results.map(function (pkg) { return pkg.name }), - ['bar', 'cool', 'foo', 'other'], - 'packages deduped and sorted' - ) - server.done() - cleanup() - t.end() - }) + return getStream.array(stream) + }).then(results => { + t.deepEquals( + results.map(function (pkg) { return pkg.name }), + ['bar', 'cool', 'foo', 'other'], + 'packages deduped and sorted' + ) + server.done() + cleanup() }) }) test('createEntryStream merged stream', function (t) { setup() - var now = Date.now() - var cacheTime = now - 6000000 + const now = Date.now() + const cacheTime = now - 6000000 server.get('/-/all/since?stale=update_after&startkey=' + cacheTime).once().reply(200, { 'bar': { name: 'bar', version: '2.0.0' }, 'car': { name: 'car', version: '1.0.0' }, @@ -122,8 +121,8 @@ test('createEntryStream merged stream', function (t) { }, { date: (new Date(now)).toISOString() }) - var cachePath = path.join(CACHE_DIR, '.cache.json') - var fixture = new Tacks(File({ + const cachePath = path.join(CACHE_DIR, '.cache.json') + const fixture = new Tacks(File({ '_updated': cacheTime, bar: { name: 'bar', version: '1.0.0' }, cool: { name: 'cool', version: '1.0.0' }, @@ -131,50 +130,54 @@ test('createEntryStream merged stream', function (t) { other: { name: 'other', version: '1.0.0' } })) fixture.create(cachePath) - _createEntryStream(cachePath, ALL, {}, 600, function (err, stream, latest, newEntries) { - if (err) throw err + return _createEntryStream(cachePath, 600, { + registry: common.registry + }).then(({ + entryStream: stream, + latest, + newEntries + }) => { t.equals(latest, now, '`latest` correctly extracted from header') t.ok(stream, 'returned a stream') t.ok(newEntries, 'cache update means entries should be written') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - t.ifError(err, 'stream finished without error') - t.deepEquals( - results.map(function (pkg) { return pkg.name }), - ['bar', 'car', 'cool', 'foo', 'other'], - 'packages deduped and sorted' - ) - t.deepEquals(results[0], { - name: 'bar', - version: '2.0.0' - }, 'update stream version wins on dedupe') - t.deepEquals(results[3], { - name: 'foo', - version: '1.0.0' - }, 'update stream version wins on dedupe even when the newer one has a lower semver.') - server.done() - cleanup() - t.end() - }) + return getStream.array(stream) + }).then(results => { + t.deepEquals( + results.map(function (pkg) { return pkg.name }), + ['bar', 'car', 'cool', 'foo', 'other'], + 'packages deduped and sorted' + ) + t.deepEquals(results[0], { + name: 'bar', + version: '2.0.0' + }, 'update stream version wins on dedupe') + t.deepEquals(results[3], { + name: 'foo', + version: '1.0.0' + }, 'update stream version wins on dedupe even when the newer one has a lower semver.') + server.done() + cleanup() }) }) test('createEntryStream no sources', function (t) { setup() - var cachePath = path.join(CACHE_DIR, '.cache.json') + const cachePath = path.join(CACHE_DIR, '.cache.json') server.get('/-/all').once().reply(404, {}) - _createEntryStream(cachePath, ALL, {}, 600, function (err, stream, latest, newEntries) { + return _createEntryStream(cachePath, 600, { + registry: common.registry + }).then(({ + entryStream: stream, + latest, + newEntries + }) => { + throw new Error('should not succeed') + }, err => { t.ok(err, 'no sources, got an error') - t.notOk(stream, 'no stream returned') - t.notOk(latest, 'no latest returned') - t.notOk(newEntries, 'no entries need to be written') t.match(err.message, /No search sources available/, 'useful error message') + }).then(() => { server.done() cleanup() - t.end() }) }) diff --git a/deps/npm/test/tap/all-package-metadata-update-stream-unit.js b/deps/npm/test/tap/all-package-metadata-update-stream-unit.js index b9cf337eb9a086..2c08ac347ed697 100644 --- a/deps/npm/test/tap/all-package-metadata-update-stream-unit.js +++ b/deps/npm/test/tap/all-package-metadata-update-stream-unit.js @@ -1,17 +1,16 @@ 'use strict' -var common = require('../common-tap.js') -var npm = require('../../') -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var path = require('path') -var mr = require('npm-registry-mock') -var ms = require('mississippi') +const common = require('../common-tap.js') +const getStream = require('get-stream') +const npm = require('../../') +const test = require('tap').test +const mkdirp = require('mkdirp') +const rimraf = require('rimraf') +const path = require('path') +const mr = require('npm-registry-mock') var _createEntryUpdateStream = require('../../lib/search/all-package-metadata.js')._createEntryUpdateStream -var ALL = common.registry + '/-/all' var PKG_DIR = path.resolve(__dirname, 'create-entry-update-stream') var CACHE_DIR = path.resolve(PKG_DIR, 'cache') @@ -46,27 +45,25 @@ test('createEntryUpdateStream full request', function (t) { }, { date: Date.now() // should never be used. }) - _createEntryUpdateStream(ALL, {}, 600, 0, function (err, stream, latest) { - if (err) throw err + return _createEntryUpdateStream(600, 0, { + registry: common.registry + }).then(({ + updateStream: stream, + updatedLatest: latest + }) => { t.equals(latest, 1234, '`latest` correctly extracted') t.ok(stream, 'returned a stream') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - if (err) throw err - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - server.done() - cleanup() - t.end() - }) + return getStream.array(stream) + }).then(results => { + t.deepEquals(results, [{ + name: 'bar', + version: '1.0.0' + }, { + name: 'foo', + version: '1.0.0' + }]) + server.done() + cleanup() }) }) @@ -79,27 +76,25 @@ test('createEntryUpdateStream partial update', function (t) { }, { date: (new Date(now)).toISOString() }) - _createEntryUpdateStream(ALL, {}, 600, 1234, function (err, stream, latest) { - if (err) throw err + return _createEntryUpdateStream(600, 1234, { + registry: common.registry + }).then(({ + updateStream: stream, + updatedLatest: latest + }) => { t.equals(latest, now, '`latest` correctly extracted from header') t.ok(stream, 'returned a stream') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - if (err) throw err - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - server.done() - cleanup() - t.end() - }) + return getStream.array(stream) + }).then(results => { + t.deepEquals(results, [{ + name: 'bar', + version: '1.0.0' + }, { + name: 'foo', + version: '1.0.0' + }]) + server.done() + cleanup() }) }) @@ -113,27 +108,26 @@ test('createEntryUpdateStream authed request', function (t) { }, { date: Date.now() // should never be used. }) - _createEntryUpdateStream(ALL, { token: token }, 600, 0, function (err, stream, latest) { - if (err) throw err + return _createEntryUpdateStream(600, 0, { + registry: common.registry, + token + }).then(({ + updateStream: stream, + updatedLatest: latest + }) => { t.equals(latest, 1234, '`latest` correctly extracted') t.ok(stream, 'returned a stream') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - if (err) throw err - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - server.done() - cleanup() - t.end() - }) + return getStream.array(stream) + }).then(results => { + t.deepEquals(results, [{ + name: 'bar', + version: '1.0.0' + }, { + name: 'foo', + version: '1.0.0' + }]) + server.done() + cleanup() }) }) @@ -143,14 +137,17 @@ test('createEntryUpdateStream bad auth', function (t) { server.get('/-/all', { authorization: 'Bearer ' + token }).once().reply(401, { error: 'unauthorized search request' }) - _createEntryUpdateStream(ALL, { token: token }, 600, 0, function (err, stream, latest) { + return _createEntryUpdateStream(600, 0, { + registry: common.registry, + token + }).then(() => { + throw new Error('should not succeed') + }, err => { t.ok(err, 'got an error from auth failure') - t.notOk(stream, 'no stream returned') - t.notOk(latest, 'no latest returned') t.match(err, /unauthorized/, 'failure message from request used') + }).then(() => { server.done() cleanup() - t.end() }) }) @@ -158,8 +155,12 @@ test('createEntryUpdateStream not stale', function (t) { setup() var now = Date.now() var staleness = 600 - _createEntryUpdateStream(ALL, {}, staleness, now, function (err, stream, latest) { - t.ifError(err, 'completed successfully') + return _createEntryUpdateStream(staleness, now, { + registry: common.registry + }).then(({ + updateStream: stream, + updatedLatest: latest + }) => { t.notOk(stream, 'no stream returned') t.notOk(latest, 'no latest returned') server.done() diff --git a/deps/npm/test/tap/all-package-metadata-write-stream-unit.js b/deps/npm/test/tap/all-package-metadata-write-stream-unit.js index 410f7f9e9d9273..94bb7413f1b321 100644 --- a/deps/npm/test/tap/all-package-metadata-write-stream-unit.js +++ b/deps/npm/test/tap/all-package-metadata-write-stream-unit.js @@ -1,18 +1,19 @@ 'use strict' -var common = require('../common-tap.js') -var npm = require('../../') -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var path = require('path') -var fs = require('fs') -var ms = require('mississippi') +const common = require('../common-tap.js') +const getStream = require('get-stream') +const npm = require('../../') +const test = require('tap').test +const mkdirp = require('mkdirp') +const rimraf = require('rimraf') +const path = require('path') +const fs = require('fs') +const ms = require('mississippi') -var _createCacheWriteStream = require('../../lib/search/all-package-metadata.js')._createCacheWriteStream +const _createCacheWriteStream = require('../../lib/search/all-package-metadata.js')._createCacheWriteStream -var PKG_DIR = path.resolve(__dirname, 'create-cache-write-stream') -var CACHE_DIR = path.resolve(PKG_DIR, 'cache') +const PKG_DIR = path.resolve(__dirname, 'create-cache-write-stream') +const CACHE_DIR = path.resolve(PKG_DIR, 'cache') function setup () { mkdirp.sync(CACHE_DIR) @@ -46,60 +47,54 @@ test('createCacheEntryStream basic', function (t) { { name: 'foo', version: '1.0.0' } ] var srcStream = fromArray(src) - _createCacheWriteStream(cachePath, latest, function (err, stream) { - if (err) throw err + return _createCacheWriteStream(cachePath, latest, { + cache: CACHE_DIR + }).then(stream => { t.ok(stream, 'returned a stream') stream = ms.pipeline.obj(srcStream, stream) - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - if (err) throw err - t.deepEquals(results, [{ + return getStream.array(stream) + }).then(results => { + t.deepEquals(results, [{ + name: 'bar', + version: '1.0.0' + }, { + name: 'foo', + version: '1.0.0' + }]) + var fileData = JSON.parse(fs.readFileSync(cachePath)) + t.ok(fileData, 'cache contents written to the right file') + t.deepEquals(fileData, { + '_updated': latest, + bar: { name: 'bar', version: '1.0.0' - }, { + }, + foo: { name: 'foo', version: '1.0.0' - }]) - var fileData = JSON.parse(fs.readFileSync(cachePath)) - t.ok(fileData, 'cache contents written to the right file') - t.deepEquals(fileData, { - '_updated': latest, - bar: { - name: 'bar', - version: '1.0.0' - }, - foo: { - name: 'foo', - version: '1.0.0' - } - }, 'cache contents based on what was written') - cleanup() - t.done() - }) + } + }, 'cache contents based on what was written') + cleanup() }) }) test('createCacheEntryStream no entries', function (t) { - cleanup() // wipe out the cache dir - var cachePath = path.join(CACHE_DIR, '.cache.json') + setup() + const cachePath = path.join(CACHE_DIR, '.cache.json') var latest = 12345 - var src = [] - var srcStream = fromArray(src) - _createCacheWriteStream(cachePath, latest, function (err, stream) { - if (err) throw err + const src = [] + const srcStream = fromArray(src) + return _createCacheWriteStream(cachePath, latest, { + cache: CACHE_DIR + }).then(stream => { t.ok(stream, 'returned a stream') stream = ms.pipeline.obj(srcStream, stream) stream.resume() - ms.finished(stream, function (err) { - if (err) throw err - var fileData = JSON.parse(fs.readFileSync(cachePath)) - t.ok(fileData, 'cache file exists and has stuff in it') - cleanup() - t.done() - }) + return getStream(stream) + }).then(() => { + const fileData = JSON.parse(fs.readFileSync(cachePath)) + t.ok(fileData, 'cache file exists and has stuff in it') + cleanup() }) }) @@ -109,22 +104,19 @@ test('createCacheEntryStream missing cache dir', function (t) { var latest = 12345 var src = [] var srcStream = fromArray(src) - _createCacheWriteStream(cachePath, latest, function (err, stream) { - if (err) throw err + return _createCacheWriteStream(cachePath, latest, { + cache: CACHE_DIR + }).then(stream => { t.ok(stream, 'returned a stream') stream = ms.pipeline.obj(srcStream, stream) - stream.on('data', function (pkg) { - t.notOk(pkg, 'stream should not have output any data') - }) - ms.finished(stream, function (err) { - if (err) throw err - var fileData = JSON.parse(fs.readFileSync(cachePath)) - t.ok(fileData, 'cache contents written to the right file') - t.deepEquals(fileData, { - '_updated': latest - }, 'cache still contains `_updated`') - cleanup() - t.done() - }) + return getStream.array(stream) + }).then(res => { + t.deepEqual(res, [], 'no data returned') + var fileData = JSON.parse(fs.readFileSync(cachePath)) + t.ok(fileData, 'cache contents written to the right file') + t.deepEquals(fileData, { + '_updated': latest + }, 'cache still contains `_updated`') + cleanup() }) }) diff --git a/deps/npm/test/tap/all-package-metadata.js b/deps/npm/test/tap/all-package-metadata.js index 9b60822e4eb00c..99d3fa26c52b87 100644 --- a/deps/npm/test/tap/all-package-metadata.js +++ b/deps/npm/test/tap/all-package-metadata.js @@ -1,26 +1,26 @@ 'use strict' -var common = require('../common-tap.js') -var npm = require('../../') -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var path = require('path') -var fs = require('fs') -var cacheFile = require('npm-cache-filename') -var mr = require('npm-registry-mock') -var ms = require('mississippi') -var Tacks = require('tacks') -var File = Tacks.File +const common = require('../common-tap.js') +const npm = require('../../') +const test = require('tap').test +const mkdirp = require('mkdirp') +const rimraf = require('rimraf') +const path = require('path') +const fs = require('fs') +const cacheFile = require('npm-cache-filename') +const mr = require('npm-registry-mock') +const ms = require('mississippi') +const Tacks = require('tacks') +const File = Tacks.File -var allPackageMetadata = require('../../lib/search/all-package-metadata.js') +const allPackageMetadata = require('../../lib/search/all-package-metadata.js') -var PKG_DIR = path.resolve(__dirname, 'update-index') -var CACHE_DIR = path.resolve(PKG_DIR, 'cache') -var cacheBase -var cachePath +const PKG_DIR = path.resolve(__dirname, path.basename(__filename, '.js'), 'update-index') +const CACHE_DIR = path.resolve(PKG_DIR, 'cache', '_cacache') +let cacheBase +let cachePath -var server +let server function setup () { mkdirp.sync(cacheBase) @@ -33,9 +33,9 @@ function cleanup () { test('setup', function (t) { mr({port: common.port, throwOnUnmatched: true}, function (err, s) { t.ifError(err, 'registry mocked successfully') - npm.load({ cache: CACHE_DIR, registry: common.registry }, function (err) { + npm.load({ cache: path.dirname(CACHE_DIR), registry: common.registry }, function (err) { t.ifError(err, 'npm loaded successfully') - npm.config.set('cache', CACHE_DIR) + npm.config.set('cache', path.dirname(CACHE_DIR)) cacheBase = cacheFile(npm.config.get('cache'))(common.registry + '/-/all') cachePath = path.join(cacheBase, '.cache.json') server = s @@ -55,7 +55,11 @@ test('allPackageMetadata full request', function (t) { }, { date: updated }) - var stream = allPackageMetadata(600) + var stream = allPackageMetadata({ + cache: CACHE_DIR, + registry: common.registry, + staleness: 600 + }) t.ok(stream, 'returned a stream') var results = [] stream.on('data', function (pkg) { @@ -101,7 +105,11 @@ test('allPackageMetadata cache only', function (t) { } var fixture = new Tacks(File(cacheContents)) fixture.create(cachePath) - var stream = allPackageMetadata(10000000) + var stream = allPackageMetadata({ + cache: CACHE_DIR, + registry: common.registry, + staleness: 10000000 + }) t.ok(stream, 'returned a stream') var results = [] stream.on('data', function (pkg) { @@ -143,7 +151,11 @@ test('createEntryStream merged stream', function (t) { other: { name: 'other', version: '1.0.0' } })) fixture.create(cachePath) - var stream = allPackageMetadata(600) + var stream = allPackageMetadata({ + cache: CACHE_DIR, + registry: common.registry, + staleness: 600 + }) t.ok(stream, 'returned a stream') var results = [] stream.on('data', function (pkg) { @@ -184,7 +196,11 @@ test('createEntryStream merged stream', function (t) { test('allPackageMetadata no sources', function (t) { setup() server.get('/-/all').once().reply(404, {}) - var stream = allPackageMetadata(600) + var stream = allPackageMetadata({ + cache: CACHE_DIR, + registry: common.registry, + staleness: 600 + }) ms.finished(stream, function (err) { t.ok(err, 'no sources, got an error') t.match(err.message, /No search sources available/, 'useful error message') diff --git a/deps/npm/test/tap/cache-add-unpublished.js b/deps/npm/test/tap/cache-add-unpublished.js index 8966e43ae40a2f..0e8a9de8bfa67a 100644 --- a/deps/npm/test/tap/cache-add-unpublished.js +++ b/deps/npm/test/tap/cache-add-unpublished.js @@ -18,7 +18,7 @@ test('cache add', function (t) { if (er) throw er t.ok(c, 'got non-zero exit code') t.equal(so, '', 'nothing printed to stdout') - t.similar(se, /404 Not Found: superfoo/, 'got expected error') + t.similar(se, /404 Not Found.*superfoo/, 'got expected error') s.close() t.end() } diff --git a/deps/npm/test/tap/config-meta.js b/deps/npm/test/tap/config-meta.js index 735c161fb87e2e..97918b8897f8f8 100644 --- a/deps/npm/test/tap/config-meta.js +++ b/deps/npm/test/tap/config-meta.js @@ -110,25 +110,26 @@ test('check configs', function (t) { } } - for (var c2 in DOC) { - if (c2 !== 'versions' && c2 !== 'version' && c2 !== 'init.version' && c2 !== 'ham-it-up') { - t.ok(CONFS[c2], 'config in doc should be used somewhere ' + c2) - t.ok(types.indexOf(c2) !== -1, 'should be defined in npmconf ' + c2) - t.ok(defaults.indexOf(c2) !== -1, 'should have default in npmconf ' + c2) - } - } + // TODO - needs better figgy-pudding introspection + // for (var c2 in DOC) { + // if (c2 !== 'versions' && c2 !== 'version' && c2 !== 'init.version' && c2 !== 'ham-it-up') { + // t.ok(CONFS[c2], 'config in doc should be used somewhere ' + c2) + // t.ok(types.indexOf(c2) !== -1, 'should be defined in npmconf ' + c2) + // t.ok(defaults.indexOf(c2) !== -1, 'should have default in npmconf ' + c2) + // } + // } types.forEach(function (c) { if (!c.match(/^_/) && c !== 'argv' && !c.match(/^versions?$/) && c !== 'ham-it-up') { t.ok(DOC[c], 'defined type should be documented ' + c) - t.ok(CONFS[c], 'defined type should be used ' + c) + // t.ok(CONFS[c], 'defined type should be used ' + c) } }) defaults.forEach(function (c) { if (!c.match(/^_/) && c !== 'argv' && !c.match(/^versions?$/) && c !== 'ham-it-up') { t.ok(DOC[c], 'defaulted type should be documented ' + c) - t.ok(CONFS[c], 'defaulted type should be used ' + c) + // t.ok(CONFS[c], 'defaulted type should be used ' + c) } }) diff --git a/deps/npm/test/tap/dist-tag.js b/deps/npm/test/tap/dist-tag.js index 651639f32a5fed..3631a598e9c684 100644 --- a/deps/npm/test/tap/dist-tag.js +++ b/deps/npm/test/tap/dist-tag.js @@ -20,10 +20,16 @@ function mocks (server) { server.get('/-/package/@scoped%2fpkg/dist-tags') .reply(200, { latest: '1.0.0', a: '0.0.1', b: '0.5.0' }) + server.get('/-/package/@scoped%2fpkg/dist-tags') + .reply(200, { latest: '1.0.0', a: '0.0.1', b: '0.5.0' }) + // ls named package server.get('/-/package/@scoped%2fanother/dist-tags') .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) + server.get('/-/package/@scoped%2fanother/dist-tags') + .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) + // add c server.get('/-/package/@scoped%2fanother/dist-tags') .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) @@ -83,6 +89,25 @@ test('npm dist-tags ls in current package', function (t) { ) }) +test('npm dist-tags ls default in current package', function (t) { + common.npm( + [ + 'dist-tags', + '--registry', common.registry, + '--loglevel', 'silent' + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.notOk(code, 'exited OK') + t.notOk(stderr, 'no error output') + t.equal(stdout, 'a: 0.0.1\nb: 0.5.0\nlatest: 1.0.0\n') + + t.end() + } + ) +}) + test('npm dist-tags ls on named package', function (t) { common.npm( [ @@ -103,6 +128,26 @@ test('npm dist-tags ls on named package', function (t) { ) }) +test('npm dist-tags ls default, named package', function (t) { + common.npm( + [ + 'dist-tags', + '@scoped/another', + '--registry', common.registry, + '--loglevel', 'silent' + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.notOk(code, 'exited OK') + t.notOk(stderr, 'no error output') + t.equal(stdout, 'a: 0.0.2\nb: 0.6.0\nlatest: 2.0.0\n') + + t.end() + } + ) +}) + test('npm dist-tags add @scoped/another@7.7.7 c', function (t) { common.npm( [ diff --git a/deps/npm/test/tap/get.js b/deps/npm/test/tap/get.js deleted file mode 100644 index c939ed071e8006..00000000000000 --- a/deps/npm/test/tap/get.js +++ /dev/null @@ -1,103 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var rimraf = require('rimraf') -var path = require('path') -var mr = require('npm-registry-mock') - -function nop () {} - -var URI = 'https://npm.registry:8043/rewrite' -var TIMEOUT = 3600 -var FOLLOW = false -var STALE_OK = true -var TOKEN = 'lolbutts' -var AUTH = { token: TOKEN } -var PARAMS = { - timeout: TIMEOUT, - follow: FOLLOW, - staleOk: STALE_OK, - auth: AUTH -} -var PKG_DIR = path.resolve(__dirname, 'get-basic') -var BIGCO_SAMPLE = { - name: '@bigco/sample', - version: '1.2.3' -} - -// mock server reference -var server - -var mocks = { - 'get': { - '/@bigco%2fsample/1.2.3': [200, BIGCO_SAMPLE] - } -} - -test('setup', function (t) { - mr({port: common.port, mocks: mocks}, function (er, s) { - t.ifError(er) - npm.load({registry: common.registry}, function (er) { - t.ifError(er) - server = s - t.end() - }) - }) -}) - -test('get call contract', function (t) { - t.throws(function () { - npm.registry.get(undefined, PARAMS, nop) - }, 'requires a URI') - - t.throws(function () { - npm.registry.get([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - npm.registry.get(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - npm.registry.get(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - npm.registry.get(URI, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - npm.registry.get(URI, PARAMS, 'callback') - }, 'callback must be function') - - t.end() -}) - -test('basic request', function (t) { - t.plan(6) - - var versioned = common.registry + '/underscore/1.3.3' - npm.registry.get(versioned, PARAMS, function (er, data) { - t.ifError(er, 'loaded specified version underscore data') - t.equal(data.version, '1.3.3') - }) - - var rollup = common.registry + '/underscore' - npm.registry.get(rollup, PARAMS, function (er, data) { - t.ifError(er, 'loaded all metadata') - t.deepEqual(data.name, 'underscore') - }) - - var scoped = common.registry + '/@bigco%2fsample/1.2.3' - npm.registry.get(scoped, PARAMS, function (er, data) { - t.ifError(er, 'loaded all metadata') - t.equal(data.name, '@bigco/sample') - }) -}) - -test('cleanup', function (t) { - server.close() - rimraf.sync(PKG_DIR) - - t.end() -}) diff --git a/deps/npm/test/tap/install-dep-classification.js b/deps/npm/test/tap/install-dep-classification.js new file mode 100644 index 00000000000000..153a7f3927ec19 --- /dev/null +++ b/deps/npm/test/tap/install-dep-classification.js @@ -0,0 +1,167 @@ +'use strict' +const path = require('path') +const test = require('tap').test +const Tacks = require('tacks') +const File = Tacks.File +const Dir = Tacks.Dir +const common = require('../common-tap.js') +const fs = require('fs') + +const basedir = path.join(__dirname, path.basename(__filename, '.js')) +const testdir = path.join(basedir, 'testdir') +const cachedir = path.join(basedir, 'cache') +const globaldir = path.join(basedir, 'global') +const tmpdir = path.join(basedir, 'tmp') +const optionaldir = path.join(testdir, 'optional') +const devdir = path.join(testdir, 'dev') + +const env = common.newEnv().extend({ + npm_config_cache: cachedir, + npm_config_tmp: tmpdir, + npm_config_prefix: globaldir, + npm_config_registry: common.registry, + npm_config_loglevel: 'error' +}) + +const fixture = new Tacks(Dir({ + cache: Dir(), + global: Dir(), + tmp: Dir(), + testdir: Dir({ + 'a-1.0.0.tgz': File(Buffer.from( + '1f8b0800000000000003edcfc10e82300c0660ce3ec5d2b38e4eb71d789b' + + '010d41e358187890f0ee56493c71319218937d977feb9aa50daebab886f2' + + 'b0a43cc7ce671b4344abb558ab3f2934223b198b4a598bdcc707a38f9c5b' + + '0fb2668c83eb79946fff597611effc131378772528c0c11e6ed4c7b6f37c' + + '53122572a5a640be265fb514a198a0e43729f3f2f06a9043738779defd7a' + + '89244992e4630fd69e456800080000', + 'hex' + )), + 'b-1.0.0.tgz': File(Buffer.from( + '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + + '06066626260ad8c4c1c0d85c81c1d8d4ccc0d0d0cccc00a80ec830353103' + + 'd2d4760836505a5c925804740aa5e640bca200a78708a856ca4bcc4d55b2' + + '524a52d2512a4b2d2acecccf03f20cf50cf40c946ab906da79a360148c82' + + '51300a680400106986b400080000', + 'hex' + )), + dev: Dir({ + 'package.json': File({ + name: 'dev', + version: '1.0.0', + devDependencies: { + example: '../example-1.0.0.tgz' + } + }) + }), + 'example-1.0.0.tgz': File(Buffer.from( + '1f8b0800000000000003ed8fc10ac2300c8677f62946cedaa5d8f5e0db64' + + '5b1853d795758a38f6ee4607e261370722f4bbfce5cb4f493c9527aa39f3' + + '73aa63e85cb23288688d4997fc136d304df6b945adad45e9c923375a72ed' + + '4596b884817a59e5db7fe65bd277fe0923386a190ec0376afd99610b57ee' + + '43d339715aa14231157b7615bbb2e100871148664a65b47b15d450dfa554' + + 'ccb2f890d3b4f9f57d9148241259e60112d8208a00080000', + 'hex' + )), + optional: Dir({ + 'package.json': File({ + name: 'optional', + version: '1.0.0', + optionalDependencies: { + example: '../example-1.0.0.tgz' + } + }) + }) + }) +})) + +function setup () { + cleanup() + fixture.create(basedir) +} + +function cleanup () { + fixture.remove(basedir) +} + +test('setup', function (t) { + setup() + return common.fakeRegistry.listen() +}) + +test('optional dependency identification', function (t) { + return common.npm(['install', '--no-optional'], {cwd: optionaldir, env}).then(([code, stdout, stderr]) => { + t.is(code, 0, 'no error code') + t.is(stderr, '', 'no error output') + t.notOk(fs.existsSync(path.join(optionaldir, 'node_modules')), 'did not install anything') + t.similar(JSON.parse(fs.readFileSync(path.join(optionaldir, 'package-lock.json'), 'utf8')), { + dependencies: { + a: { + version: 'file:../a-1.0.0.tgz', + optional: true + }, + b: { + version: 'file:../b-1.0.0.tgz', + optional: true + }, + example: { + version: '1.0.0', + optional: true + } + } + }, 'locks dependencies as optional') + }) +}) + +test('development dependency identification', function (t) { + return common.npm(['install', '--only=prod'], {cwd: devdir, env}).then(([code, stdout, stderr]) => { + t.is(code, 0, 'no error code') + t.is(stderr, '', 'no error output') + t.notOk(fs.existsSync(path.join(devdir, 'node_modules')), 'did not install anything') + t.similar(JSON.parse(fs.readFileSync(path.join(devdir, 'package-lock.json'), 'utf8')), { + dependencies: { + a: { + version: 'file:../a-1.0.0.tgz', + dev: true + }, + b: { + version: 'file:../b-1.0.0.tgz', + dev: true + }, + example: { + version: '1.0.0', + dev: true + } + } + }, 'locks dependencies as dev') + }) +}) + +test('default dependency identification', function (t) { + return common.npm(['install'], {cwd: optionaldir, env}).then(([code, stdout, stderr]) => { + t.is(code, 0, 'no error code') + t.is(stderr, '', 'no error output') + t.similar(JSON.parse(fs.readFileSync(path.join(optionaldir, 'package-lock.json'), 'utf8')), { + dependencies: { + a: { + version: 'file:../a-1.0.0.tgz', + optional: true + }, + b: { + version: 'file:../b-1.0.0.tgz', + optional: true + }, + example: { + version: '1.0.0', + optional: true + } + } + }, 'locks dependencies as optional') + }) +}) + +test('cleanup', function (t) { + common.fakeRegistry.close() + cleanup() + t.done() +}) diff --git a/deps/npm/test/tap/map-to-registry.js b/deps/npm/test/tap/map-to-registry.js deleted file mode 100644 index f6fdef5f10c3e3..00000000000000 --- a/deps/npm/test/tap/map-to-registry.js +++ /dev/null @@ -1,166 +0,0 @@ -var test = require('tap').test -var npm = require('../../') - -var common = require('../common-tap.js') -var mapRegistry = require('../../lib/utils/map-to-registry.js') - -var creds = { - '//registry.npmjs.org/:username': 'u', - '//registry.npmjs.org/:_password': Buffer.from('p').toString('base64'), - '//registry.npmjs.org/:email': 'e', - cache: common.npm_config_cache -} -test('setup', function (t) { - npm.load(creds, function (err) { - t.ifError(err) - t.end() - }) -}) - -test('mapRegistryToURI', function (t) { - t.plan(16) - - mapRegistry('basic', npm.config, function (er, uri, auth, registry) { - t.ifError(er, 'mapRegistryToURI worked') - t.equal(uri, 'https://registry.npmjs.org/basic') - t.deepEqual(auth, { - scope: '//registry.npmjs.org/', - token: undefined, - username: 'u', - password: 'p', - email: 'e', - auth: 'dTpw', - alwaysAuth: false - }) - t.equal(registry, 'https://registry.npmjs.org/') - }) - - npm.config.set('scope', 'test') - npm.config.set('@test:registry', 'http://reg.npm/design/-/rewrite/') - npm.config.set('//reg.npm/design/-/rewrite/:_authToken', 'a-token') - mapRegistry('simple', npm.config, function (er, uri, auth, registry) { - t.ifError(er, 'mapRegistryToURI worked') - t.equal(uri, 'http://reg.npm/design/-/rewrite/simple') - t.deepEqual(auth, { - scope: '//reg.npm/design/-/rewrite/', - token: 'a-token', - username: undefined, - password: undefined, - email: undefined, - auth: undefined, - alwaysAuth: false - }) - t.equal(registry, 'http://reg.npm/design/-/rewrite/') - }) - - npm.config.set('scope', '') - npm.config.set('@test2:registry', 'http://reg.npm/-/rewrite/') - npm.config.set('//reg.npm/-/rewrite/:_authToken', 'b-token') - mapRegistry('@test2/easy', npm.config, function (er, uri, auth, registry) { - t.ifError(er, 'mapRegistryToURI worked') - t.equal(uri, 'http://reg.npm/-/rewrite/@test2%2feasy') - t.deepEqual(auth, { - scope: '//reg.npm/-/rewrite/', - token: 'b-token', - username: undefined, - password: undefined, - email: undefined, - auth: undefined, - alwaysAuth: false - }) - t.equal(registry, 'http://reg.npm/-/rewrite/') - }) - - npm.config.set('scope', 'test') - npm.config.set('@test3:registry', 'http://reg.npm/design/-/rewrite/relative') - npm.config.set('//reg.npm/design/-/rewrite/:_authToken', 'c-token') - mapRegistry('@test3/basic', npm.config, function (er, uri, auth, registry) { - t.ifError(er, 'mapRegistryToURI worked') - t.equal(uri, 'http://reg.npm/design/-/rewrite/relative/@test3%2fbasic') - t.deepEqual(auth, { - scope: '//reg.npm/design/-/rewrite/', - token: 'c-token', - username: undefined, - password: undefined, - email: undefined, - auth: undefined, - alwaysAuth: false - }) - t.equal(registry, 'http://reg.npm/design/-/rewrite/relative/') - }) -}) - -test('mapToRegistry token scoping', function (t) { - npm.config.set('scope', '') - npm.config.set('registry', 'https://reg.npm/') - npm.config.set('//reg.npm/:_authToken', 'r-token') - - t.test('pass token to registry host', function (t) { - mapRegistry( - 'https://reg.npm/packages/e/easy-1.0.0.tgz', - npm.config, - function (er, uri, auth, registry) { - t.ifError(er, 'mapRegistryToURI worked') - t.equal(uri, 'https://reg.npm/packages/e/easy-1.0.0.tgz') - t.deepEqual(auth, { - scope: '//reg.npm/', - token: 'r-token', - username: undefined, - password: undefined, - email: undefined, - auth: undefined, - alwaysAuth: false - }) - t.equal(registry, 'https://reg.npm/') - } - ) - t.end() - }) - - t.test("don't pass token to non-registry host", function (t) { - mapRegistry( - 'https://butts.lol/packages/e/easy-1.0.0.tgz', - npm.config, - function (er, uri, auth, registry) { - t.ifError(er, 'mapRegistryToURI worked') - t.equal(uri, 'https://butts.lol/packages/e/easy-1.0.0.tgz') - t.deepEqual(auth, { - scope: '//reg.npm/', - token: undefined, - username: undefined, - password: undefined, - email: undefined, - auth: undefined, - alwaysAuth: false - }) - t.equal(registry, 'https://reg.npm/') - } - ) - t.end() - }) - - t.test('pass token to non-registry host with always-auth', function (t) { - npm.config.set('always-auth', true) - mapRegistry( - 'https://butts.lol/packages/e/easy-1.0.0.tgz', - npm.config, - function (er, uri, auth, registry) { - t.ifError(er, 'mapRegistryToURI worked') - t.equal(uri, 'https://butts.lol/packages/e/easy-1.0.0.tgz') - t.deepEqual(auth, { - scope: '//reg.npm/', - token: 'r-token', - username: undefined, - password: undefined, - email: undefined, - auth: undefined, - alwaysAuth: true - }) - t.equal(registry, 'https://reg.npm/') - } - ) - t.end() - }) - - t.end() -}) diff --git a/deps/npm/test/tap/org.js b/deps/npm/test/tap/org.js new file mode 100644 index 00000000000000..7315cf0b6faf1b --- /dev/null +++ b/deps/npm/test/tap/org.js @@ -0,0 +1,136 @@ +'use strict' + +var test = require('tap').test +var common = require('../common-tap.js') + +var mr = common.fakeRegistry.compat + +var server + +test('setup', function (t) { + mr({port: common.port}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) + +const names = ['add', 'set'] +const roles = ['developer', 'admin', 'owner'] + +names.forEach(function (name) { + test('org ' + name + ' [orgname] [username]: defaults to developer', function (t) { + const membershipData = { + org: { + name: 'myorg', + size: 1 + }, + user: 'myuser', + role: 'developer' + } + server.put('/-/org/myorg/user', JSON.stringify({ + user: 'myuser' + })).reply(200, membershipData) + common.npm([ + 'org', 'add', 'myorg', 'myuser', + '--json', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm org') + + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + + t.same(JSON.parse(stdout), membershipData) + t.end() + }) + }) + + roles.forEach(function (role) { + test('org ' + name + ' [orgname] [username]: accepts role ' + role, function (t) { + const membershipData = { + org: { + name: 'myorg', + size: 1 + }, + user: 'myuser', + role: role + } + server.put('/-/org/myorg/user', JSON.stringify({ + user: 'myuser' + })).reply(200, membershipData) + common.npm([ + 'org', name, 'myorg', 'myuser', + '--json', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm org') + + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + + t.same(JSON.parse(stdout), membershipData) + t.end() + }) + }) + }) +}) + +test('org rm [orgname] [username]', function (t) { + const membershipData = { + otheruser: 'admin' + } + server.delete('/-/org/myorg/user', JSON.stringify({ + user: 'myuser' + })).reply(204, {}) + server.get('/-/org/myorg/user') + .reply(200, membershipData) + common.npm([ + 'org', 'rm', 'myorg', 'myuser', + '--json', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm org') + + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.deepEqual(JSON.parse(stdout), { + user: 'myuser', + org: 'myorg', + deleted: true, + userCount: 1 + }, 'got useful info') + t.end() + }) +}) + +test('org ls [orgname]', function (t) { + const membershipData = { + username: 'admin', + username2: 'foo' + } + server.get('/-/org/myorg/user') + .reply(200, membershipData) + common.npm([ + 'org', 'ls', 'myorg', + '--json', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm org') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.same(JSON.parse(stdout), membershipData, 'outputs members') + t.end() + }) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + server.done() + server.close() + t.end() +}) diff --git a/deps/npm/test/tap/ping.js b/deps/npm/test/tap/ping.js index 76d115a482343d..3562f25a3be97a 100644 --- a/deps/npm/test/tap/ping.js +++ b/deps/npm/test/tap/ping.js @@ -40,14 +40,41 @@ test('npm ping', function (t) { common.npm([ 'ping', '--registry', common.registry, - '--loglevel', 'silent', + '--loglevel', 'notice', '--userconfig', outfile - ], opts, function (err, code, stdout) { + ], opts, function (err, code, stdout, stderr) { s.close() - t.ifError(err, 'no error output') + t.ifError(err, 'command completed') t.notOk(code, 'exited OK') - t.same(stdout, 'Ping success: ' + JSON.stringify(pingResponse) + '\n') + t.match(stderr, /PING/, 'ping notification output') + t.match(stderr, /PONG/, 'pong response output') + t.end() + }) + }) +}) + +test('npm ping --json', function (t) { + mr({ port: common.port, plugin: mocks }, function (err, s) { + if (err) throw err + + common.npm([ + 'ping', + '--json', + '--registry', common.registry, + '--loglevel', 'notice', + '--userconfig', outfile + ], opts, function (err, code, stdout, stderr) { + s.close() + t.ifError(err, 'command completed') + t.notOk(code, 'exited OK') + + const json = JSON.parse(stdout.trim()) + t.similar(json, { + registry: common.registry, + details: pingResponse + }, 'JSON info returned') + t.equal(typeof json.time, 'number', 'got a timestamp') t.end() }) }) diff --git a/deps/npm/test/tap/publish-config.js b/deps/npm/test/tap/publish-config.js index 0566795dbe3f5e..14fd40311a7c03 100644 --- a/deps/npm/test/tap/publish-config.js +++ b/deps/npm/test/tap/publish-config.js @@ -47,9 +47,13 @@ test(function (t) { // itself functions normally. // // Make sure that we don't sit around waiting for lock files - child = common.npm(['publish', '--userconfig=' + pkg + '/fixture_npmrc', '--tag=beta'], { + child = common.npm([ + 'publish', + '--userconfig=' + pkg + '/fixture_npmrc', + '--tag=beta', + '--loglevel', 'error' + ], { cwd: pkg, - stdio: 'inherit', env: { 'npm_config_cache_lock_stale': 1000, 'npm_config_cache_lock_wait': 1000, @@ -58,7 +62,9 @@ test(function (t) { PATH: process.env.PATH, USERPROFILE: osenv.home() } - }, function (err, code) { + }, function (err, code, stdout, stderr) { + t.comment(stdout) + t.comment(stderr) t.ifError(err, 'publish command finished successfully') t.notOk(code, 'npm install exited with code 0') }) diff --git a/deps/npm/test/tap/search.all-package-search.js b/deps/npm/test/tap/search.all-package-search.js index c70f4f8e7ef074..51c1ffcf90157b 100644 --- a/deps/npm/test/tap/search.all-package-search.js +++ b/deps/npm/test/tap/search.all-package-search.js @@ -1,21 +1,25 @@ -var path = require('path') -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var rimraf = require('rimraf') -var cacheFile = require('npm-cache-filename') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File +'use strict' -var common = require('../common-tap.js') +const cacheFile = require('npm-cache-filename') +const mkdirp = require('mkdirp') +const mr = require('npm-registry-mock') +const osenv = require('osenv') +const path = require('path') +const qs = require('querystring') +const rimraf = require('rimraf') +const Tacks = require('tacks') +const test = require('tap').test -var PKG_DIR = path.resolve(__dirname, 'search') -var CACHE_DIR = path.resolve(PKG_DIR, 'cache') -var cacheBase = cacheFile(CACHE_DIR)(common.registry + '/-/all') -var cachePath = path.join(cacheBase, '.cache.json') +const {File} = Tacks -var server +const common = require('../common-tap.js') + +const PKG_DIR = path.resolve(__dirname, 'search') +const CACHE_DIR = path.resolve(PKG_DIR, 'cache') +const cacheBase = cacheFile(CACHE_DIR)(common.registry + '/-/all') +const cachePath = path.join(cacheBase, '.cache.json') + +let server test('setup', function (t) { mr({port: common.port, throwOnUnmatched: true}, function (err, s) { @@ -26,7 +30,7 @@ test('setup', function (t) { }) }) -var searches = [ +const searches = [ { term: 'cool', description: 'non-regex search', @@ -139,19 +143,26 @@ var searches = [ searches.forEach(function (search) { test(search.description, function (t) { setup() - server.get('/-/v1/search?text=' + encodeURIComponent(search.term) + '&size=20').once().reply(404, {}) - var now = Date.now() - var cacheContents = { + const query = qs.stringify({ + text: search.term, + size: 20, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + server.get(`/-/v1/search?${query}`).once().reply(404, {}) + const now = Date.now() + const cacheContents = { '_updated': now, bar: { name: 'bar', version: '1.0.0' }, cool: { name: 'cool', version: '5.0.0' }, foo: { name: 'foo', version: '2.0.0' }, other: { name: 'other', version: '1.0.0' } } - for (var k in search.inject) { + for (let k in search.inject) { cacheContents[k] = search.inject[k] } - var fixture = new Tacks(File(cacheContents)) + const fixture = new Tacks(File(cacheContents)) fixture.create(cachePath) common.npm([ 'search', search.term, @@ -167,12 +178,12 @@ searches.forEach(function (search) { t.equal(code, 0, 'search finished successfully') t.ifErr(err, 'search finished successfully') // \033 == \u001B - var markStart = '\u001B\\[[0-9][0-9]m' - var markEnd = '\u001B\\[0m' + const markStart = '\u001B\\[[0-9][0-9]m' + const markEnd = '\u001B\\[0m' - var re = new RegExp(markStart + '.*?' + markEnd) + const re = new RegExp(markStart + '.*?' + markEnd) - var cnt = stdout.search(re) + const cnt = stdout.search(re) t.equal( cnt, search.location, diff --git a/deps/npm/test/tap/search.esearch.js b/deps/npm/test/tap/search.esearch.js deleted file mode 100644 index d892aec95759c3..00000000000000 --- a/deps/npm/test/tap/search.esearch.js +++ /dev/null @@ -1,192 +0,0 @@ -var common = require('../common-tap.js') -var finished = require('mississippi').finished -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var npm = require('../../') -var osenv = require('osenv') -var path = require('path') -var rimraf = require('rimraf') -var test = require('tap').test - -var SEARCH = '/-/v1/search' -var PKG_DIR = path.resolve(__dirname, 'create-entry-update-stream') -var CACHE_DIR = path.resolve(PKG_DIR, 'cache') - -var esearch = require('../../lib/search/esearch') - -var server - -function setup () { - cleanup() - mkdirp.sync(CACHE_DIR) - process.chdir(CACHE_DIR) -} - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(PKG_DIR) -} - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - npm.load({ cache: CACHE_DIR, registry: common.registry }, function (err) { - t.ifError(err, 'npm loaded successfully') - server = s - t.pass('all set up') - t.done() - }) - }) -}) - -test('basic test', function (t) { - setup() - server.get(SEARCH + '?text=oo&size=1').once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'foo', version: '2.0.0' } } - ] - }) - var results = [] - var s = esearch({ - include: ['oo'], - limit: 1 - }) - t.ok(s, 'got a stream') - s.on('data', function (d) { - results.push(d) - }) - finished(s, function (err) { - if (err) { throw err } - t.ok(true, 'stream finished without error') - t.deepEquals(results, [{ - name: 'cool', - version: '1.0.0', - description: null, - maintainers: null, - keywords: null, - date: null - }, { - name: 'foo', - version: '2.0.0', - description: null, - maintainers: null, - keywords: null, - date: null - }]) - server.done() - t.done() - }) -}) - -test('only returns certain fields for each package', function (t) { - setup() - var date = new Date() - server.get(SEARCH + '?text=oo&size=1').once().reply(200, { - objects: [{ - package: { - name: 'cool', - version: '1.0.0', - description: 'desc', - maintainers: [ - {username: 'x', email: 'a@b.c'}, - {username: 'y', email: 'c@b.a'} - ], - keywords: ['a', 'b', 'c'], - date: date.toISOString(), - extra: 'lol' - } - }] - }) - var results = [] - var s = esearch({ - include: ['oo'], - limit: 1 - }) - t.ok(s, 'got a stream') - s.on('data', function (d) { - results.push(d) - }) - finished(s, function (err) { - if (err) { throw err } - t.ok(true, 'stream finished without error') - t.deepEquals(results, [{ - name: 'cool', - version: '1.0.0', - description: 'desc', - maintainers: [ - {username: 'x', email: 'a@b.c'}, - {username: 'y', email: 'c@b.a'} - ], - keywords: ['a', 'b', 'c'], - date: date - }]) - server.done() - t.done() - }) -}) - -test('accepts a limit option', function (t) { - setup() - server.get(SEARCH + '?text=oo&size=3').once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } } - ] - }) - var results = 0 - var s = esearch({ - include: ['oo'], - limit: 3 - }) - s.on('data', function () { results++ }) - finished(s, function (err) { - if (err) { throw err } - t.ok(true, 'request sent with correct size') - t.equal(results, 2, 'behaves fine with fewer results than size') - server.done() - t.done() - }) -}) - -test('passes foo:bar syntax params directly', function (t) { - setup() - server.get(SEARCH + '?text=foo%3Abar&size=1').once().reply(200, { - objects: [] - }) - var s = esearch({ - include: ['foo:bar'], - limit: 1 - }) - s.on('data', function () {}) - finished(s, function (err) { - if (err) { throw err } - t.ok(true, 'request sent with correct params') - server.done() - t.done() - }) -}) - -test('space-separates and URI-encodes multiple search params', function (t) { - setup() - server.get(SEARCH + '?text=foo%20bar%3Abaz%20quux%3F%3D&size=1').once().reply(200, { - objects: [] - }) - var s = esearch({ - include: ['foo', 'bar:baz', 'quux?='], - limit: 1 - }) - s.on('data', function () {}) - finished(s, function (err) { - if (err) { throw err } - t.ok(true, 'request sent with correct params') - server.done() - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/search.js b/deps/npm/test/tap/search.js index df7ff0fe375b77..bbd293c3a1a3fc 100644 --- a/deps/npm/test/tap/search.js +++ b/deps/npm/test/tap/search.js @@ -1,21 +1,25 @@ -var path = require('path') -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var rimraf = require('rimraf') -var cacheFile = require('npm-cache-filename') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File +'use strict' -var common = require('../common-tap.js') +const cacheFile = require('npm-cache-filename') +const mkdirp = require('mkdirp') +const mr = require('npm-registry-mock') +const osenv = require('osenv') +const path = require('path') +const qs = require('querystring') +const rimraf = require('rimraf') +const test = require('tap').test -var PKG_DIR = path.resolve(__dirname, 'search') -var CACHE_DIR = path.resolve(PKG_DIR, 'cache') -var cacheBase = cacheFile(CACHE_DIR)(common.registry + '/-/all') -var cachePath = path.join(cacheBase, '.cache.json') +const Tacks = require('tacks') +const File = Tacks.File -var server +const common = require('../common-tap.js') + +const PKG_DIR = path.resolve(__dirname, 'search') +const CACHE_DIR = path.resolve(PKG_DIR, 'cache') +const cacheBase = cacheFile(CACHE_DIR)(common.registry + '/-/all') +const cachePath = path.join(cacheBase, '.cache.json') + +let server test('setup', function (t) { mr({port: common.port, throwOnUnmatched: true}, function (err, s) { @@ -28,7 +32,14 @@ test('setup', function (t) { test('notifies when there are no results', function (t) { setup() - server.get('/-/v1/search?text=none&size=20').once().reply(200, { + const query = qs.stringify({ + text: 'none', + size: 20, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + server.get(`/-/v1/search?${query}`).once().reply(200, { objects: [] }) common.npm([ @@ -46,10 +57,17 @@ test('notifies when there are no results', function (t) { test('spits out a useful error when no cache nor network', function (t) { setup() - server.get('/-/v1/search?text=foo&size=20').once().reply(404, {}) + const query = qs.stringify({ + text: 'foo', + size: 20, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + server.get(`/-/v1/search?${query}`).once().reply(404, {}) server.get('/-/all').many().reply(404, {}) - var cacheContents = {} - var fixture = new Tacks(File(cacheContents)) + const cacheContents = {} + const fixture = new Tacks(File(cacheContents)) fixture.create(cachePath) common.npm([ 'search', 'foo', @@ -70,7 +88,14 @@ test('spits out a useful error when no cache nor network', function (t) { test('can switch to JSON mode', function (t) { setup() - server.get('/-/v1/search?text=oo&size=20').once().reply(200, { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + server.get(`/-/v1/search?${query}`).once().reply(200, { objects: [ { package: { name: 'cool', version: '1.0.0' } }, { package: { name: 'foo', version: '2.0.0' } } @@ -86,9 +111,15 @@ test('can switch to JSON mode', function (t) { if (err) throw err t.equal(stderr, '', 'no error output') t.equal(code, 0, 'search gives 0 error code even if no matches') - t.deepEquals(JSON.parse(stdout), [ - { name: 'cool', version: '1.0.0', date: null }, - { name: 'foo', version: '2.0.0', date: null } + t.similar(JSON.parse(stdout), [ + { + name: 'cool', + version: '1.0.0' + }, + { + name: 'foo', + version: '2.0.0' + } ], 'results returned as valid json') t.done() }) @@ -96,7 +127,14 @@ test('can switch to JSON mode', function (t) { test('JSON mode does not notify on empty', function (t) { setup() - server.get('/-/v1/search?text=oo&size=20').once().reply(200, { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + server.get(`/-/v1/search?${query}`).once().reply(200, { objects: [] }) common.npm([ @@ -116,7 +154,14 @@ test('JSON mode does not notify on empty', function (t) { test('can switch to tab separated mode', function (t) { setup() - server.get('/-/v1/search?text=oo&size=20').once().reply(200, { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + server.get(`/-/v1/search?${query}`).once().reply(200, { objects: [ { package: { name: 'cool', version: '1.0.0' } }, { package: { name: 'foo', description: 'this\thas\ttabs', version: '2.0.0' } } @@ -139,7 +184,14 @@ test('can switch to tab separated mode', function (t) { test('tab mode does not notify on empty', function (t) { setup() - server.get('/-/v1/search?text=oo&size=20').once().reply(200, { + const query = qs.stringify({ + text: 'oo', + size: 20, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5 + }) + server.get(`/-/v1/search?${query}`).once().reply(200, { objects: [] }) common.npm([ diff --git a/deps/npm/test/tap/team.js b/deps/npm/test/tap/team.js index 38caadde538704..939da45b77883a 100644 --- a/deps/npm/test/tap/team.js +++ b/deps/npm/test/tap/team.js @@ -22,17 +22,19 @@ test('team create basic', function (t) { deleted: null } server.put('/-/org/myorg/team', JSON.stringify({ - name: teamData.name + name: teamData.name, + description: null })).reply(200, teamData) common.npm([ 'team', 'create', 'myorg:' + teamData.name, '--registry', common.registry, - '--loglevel', 'silent' + '--loglevel', 'error', + '--json' ], {}, function (err, code, stdout, stderr) { t.ifError(err, 'npm team') t.equal(code, 0, 'exited OK') t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), teamData) + t.same(JSON.parse(stdout), {created: true, team: `myorg:${teamData.name}`}) t.end() }) }) @@ -46,17 +48,19 @@ test('team create (allow optional @ prefix on scope)', function (t) { deleted: null } server.put('/-/org/myorg/team', JSON.stringify({ - name: teamData.name + name: teamData.name, + description: null })).reply(200, teamData) common.npm([ 'team', 'create', '@myorg:' + teamData.name, '--registry', common.registry, - '--loglevel', 'silent' + '--loglevel', 'silent', + '--json' ], {}, function (err, code, stdout, stderr) { t.ifError(err, 'npm team') t.equal(code, 0, 'exited OK') t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), teamData) + t.same(JSON.parse(stdout), {created: true, team: `myorg:${teamData.name}`}) t.end() }) }) @@ -73,12 +77,13 @@ test('team destroy', function (t) { common.npm([ 'team', 'destroy', 'myorg:' + teamData.name, '--registry', common.registry, - '--loglevel', 'silent' + '--loglevel', 'silent', + '--json' ], {}, function (err, code, stdout, stderr) { t.ifError(err, 'npm team') t.equal(code, 0, 'exited OK') t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), teamData) + t.same(JSON.parse(stdout), {deleted: true, team: `myorg:${teamData.name}`}) t.end() }) }) @@ -87,11 +92,12 @@ test('team add', function (t) { var user = 'zkat' server.put('/-/team/myorg/myteam/user', JSON.stringify({ user: user - })).reply(200) + })).reply(200, {}) common.npm([ 'team', 'add', 'myorg:myteam', user, '--registry', common.registry, - '--loglevel', 'silent' + '--loglevel', 'error', + '--json' ], {}, function (err, code, stdout, stderr) { t.ifError(err, 'npm team') t.equal(code, 0, 'exited OK') @@ -104,11 +110,12 @@ test('team rm', function (t) { var user = 'zkat' server.delete('/-/team/myorg/myteam/user', JSON.stringify({ user: user - })).reply(200) + })).reply(200, {}) common.npm([ 'team', 'rm', 'myorg:myteam', user, '--registry', common.registry, - '--loglevel', 'silent' + '--loglevel', 'silent', + '--json' ], {}, function (err, code, stdout, stderr) { t.ifError(err, 'npm team') t.equal(code, 0, 'exited OK') @@ -123,7 +130,8 @@ test('team ls (on org)', function (t) { common.npm([ 'team', 'ls', 'myorg', '--registry', common.registry, - '--loglevel', 'silent' + '--loglevel', 'silent', + '--json' ], {}, function (err, code, stdout, stderr) { t.ifError(err, 'npm team') t.equal(code, 0, 'exited OK') @@ -139,12 +147,13 @@ test('team ls (on team)', function (t) { common.npm([ 'team', 'ls', 'myorg:myteam', '--registry', common.registry, - '--loglevel', 'silent' + '--loglevel', 'silent', + '--json' ], {}, function (err, code, stdout, stderr) { t.ifError(err, 'npm team') t.equal(code, 0, 'exited OK') t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), users) + t.same(JSON.parse(stdout).sort(), users.sort()) t.end() }) }) diff --git a/deps/npm/test/tap/view.js b/deps/npm/test/tap/view.js index 30ccdb471cf588..a01fa903a253d4 100644 --- a/deps/npm/test/tap/view.js +++ b/deps/npm/test/tap/view.js @@ -97,7 +97,7 @@ test('npm view . with no published package', function (t) { ], { cwd: t3dir }, function (err, code, stdout, stderr) { t.ifError(err, 'view command finished successfully') t.equal(code, 1, 'exit not ok') - t.similar(stderr, /version not found/m) + t.similar(stderr, /not in the npm registry/m) t.end() }) }) From e629afa6ae1f6e4075d79bbcc60f219054728cd1 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 12 Feb 2019 14:00:51 +0100 Subject: [PATCH 201/223] doc: fix minor typo in dgram.md PR-URL: https://github.com/nodejs/node/pull/26055 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Vse Mozhet Byt Reviewed-By: Rich Trott --- doc/api/dgram.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 01ec28e63ca4d9..bb492b56c2728a 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -206,7 +206,7 @@ Note that specifying both a `'listening'` event listener and passing a useful. The `options` object may contain an additional `exclusive` property that is -use when using `dgram.Socket` objects with the [`cluster`] module. When +used when using `dgram.Socket` objects with the [`cluster`] module. When `exclusive` is set to `false` (the default), cluster workers will use the same underlying socket handle allowing connection handling duties to be shared. When `exclusive` is `true`, however, the handle is not shared and attempted From bd932a347e659bc02f83449662c78ff535fd5f09 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 10 Feb 2019 17:10:17 +0800 Subject: [PATCH 202/223] lib: move per_context.js under lib/internal/bootstrap PR-URL: https://github.com/nodejs/node/pull/26033 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- lib/internal/bootstrap/cache.js | 3 +-- lib/internal/{per_context.js => bootstrap/context.js} | 0 node.gyp | 2 +- src/api/environment.cc | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) rename lib/internal/{per_context.js => bootstrap/context.js} (100%) diff --git a/lib/internal/bootstrap/cache.js b/lib/internal/bootstrap/cache.js index 9cfa30aef7ee6f..3dc6650cd3e35b 100644 --- a/lib/internal/bootstrap/cache.js +++ b/lib/internal/bootstrap/cache.js @@ -18,10 +18,9 @@ const cannotBeRequired = [ 'internal/v8_prof_polyfill', 'internal/v8_prof_processor', - 'internal/per_context', - 'internal/test/binding', + 'internal/bootstrap/context', 'internal/bootstrap/primordials', 'internal/bootstrap/loaders', 'internal/bootstrap/node' diff --git a/lib/internal/per_context.js b/lib/internal/bootstrap/context.js similarity index 100% rename from lib/internal/per_context.js rename to lib/internal/bootstrap/context.js diff --git a/node.gyp b/node.gyp index 29441019a48067..d29db8da3b89db 100644 --- a/node.gyp +++ b/node.gyp @@ -26,7 +26,7 @@ 'node_lib_target_name%': 'node_lib', 'node_intermediate_lib_type%': 'static_library', 'library_files': [ - 'lib/internal/per_context.js', + 'lib/internal/bootstrap/context.js', 'lib/internal/bootstrap/primordials.js', 'lib/internal/bootstrap/cache.js', 'lib/internal/bootstrap/loaders.js', diff --git a/src/api/environment.cc b/src/api/environment.cc index 2f4a35b975d1c1..a1320c0761d0b5 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -183,7 +183,7 @@ Local NewContext(Isolate* isolate, True(isolate)); { - // Run lib/internal/per_context.js + // Run lib/internal/bootstrap/context.js Context::Scope context_scope(context); std::vector> parameters = { @@ -191,7 +191,7 @@ Local NewContext(Isolate* isolate, Local arguments[] = {context->Global()}; MaybeLocal maybe_fn = per_process::native_module_loader.LookupAndCompile( - context, "internal/per_context", ¶meters, nullptr); + context, "internal/bootstrap/context", ¶meters, nullptr); if (maybe_fn.IsEmpty()) { return Local(); } From 85bc64a5c90b940ef7273b7bd2de3a4e18043734 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 10 Feb 2019 17:31:51 +0800 Subject: [PATCH 203/223] process: document the bootstrap process in node.js PR-URL: https://github.com/nodejs/node/pull/26033 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- lib/internal/bootstrap/node.js | 39 +++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 995495532886b1..5745bb482492b6 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -1,19 +1,38 @@ // Hello, and welcome to hacking node.js! // -// This file is invoked by node::LoadEnvironment in src/node.cc, and is -// responsible for bootstrapping the node.js core. As special caution is given -// to the performance of the startup process, many dependencies are invoked -// lazily. +// This file is invoked by `node::RunBootstrapping()` in `src/node.cc`, and is +// responsible for setting up node.js core before executing main scripts +// under `lib/internal/main/`. +// This file is currently run to bootstrap both the main thread and the worker +// threads. Some setups are conditional, controlled with isMainThread and +// ownsProcessState. +// This file is expected not to perform any asynchronous operations itself +// when being executed - those should be done in either +// `lib/internal/bootstrap/pre_execution.js` or in main scripts. The majority +// of the code here focus on setting up the global proxy and the process +// object in a synchronous manner. +// As special caution is given to the performance of the startup process, +// many dependencies are invoked lazily. // -// Before this file is run, lib/internal/bootstrap/loaders.js gets run first -// to bootstrap the internal binding and module loaders, including -// process.binding(), process._linkedBinding(), internalBinding() and -// NativeModule. And then { internalBinding, NativeModule } will be passed -// into this bootstrapper to bootstrap Node.js core. +// Scripts run before this file: +// - `lib/internal/bootstrap/context.js`: to setup the v8::Context with +// Node.js-specific tweaks - this is also done in vm contexts. +// - `lib/internal/bootstrap/primordials.js`: to save copies of JavaScript +// builtins that won't be affected by user land monkey-patching for internal +// modules to use. +// - `lib/internal/bootstrap/loaders.js`: to setup internal binding and +// module loaders, including `process.binding()`, `process._linkedBinding()`, +// `internalBinding()` and `NativeModule`. +// +// After this file is run, one of the main scripts under `lib/internal/main/` +// will be selected by C++ to start the actual execution. The main scripts may +// run additional setups exported by `lib/internal/bootstrap/pre_execution.js`, +// depending on the execution mode. + 'use strict'; // This file is compiled as if it's wrapped in a function with arguments -// passed by node::LoadEnvironment() +// passed by node::RunBootstrapping() /* global process, loaderExports, isMainThread, ownsProcessState */ const { internalBinding, NativeModule } = loaderExports; From d5f4a1f2acfa60ff1ab25e5bead47886113be402 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 10 Feb 2019 17:40:43 +0800 Subject: [PATCH 204/223] lib: save a copy of Symbol in primordials PR-URL: https://github.com/nodejs/node/pull/26033 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- lib/internal/bootstrap/primordials.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/bootstrap/primordials.js b/lib/internal/bootstrap/primordials.js index 2a97e74542a964..85f1f54c1ccf7e 100644 --- a/lib/internal/bootstrap/primordials.js +++ b/lib/internal/bootstrap/primordials.js @@ -72,7 +72,8 @@ primordials.SafePromise = makeSafe( 'Function', 'Object', 'RegExp', - 'String' + 'String', + 'Symbol', ].forEach((name) => { const target = primordials[name] = Object.create(null); copyProps(global[name], target); From 8d3eb47d48536ed569cc4861b6c7f14b8a9482b7 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 10 Feb 2019 17:42:22 +0800 Subject: [PATCH 205/223] process: use primordials in bootstrap/node.js PR-URL: https://github.com/nodejs/node/pull/26033 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- lib/internal/bootstrap/node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 5745bb482492b6..9ee28d24367457 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -34,9 +34,10 @@ // This file is compiled as if it's wrapped in a function with arguments // passed by node::RunBootstrapping() /* global process, loaderExports, isMainThread, ownsProcessState */ +/* global primordials */ const { internalBinding, NativeModule } = loaderExports; - +const { Object, Symbol } = primordials; const { getOptionValue } = NativeModule.require('internal/options'); const config = internalBinding('config'); From b1a8927adca60c1490c1c2328e061ea50e1ae560 Mon Sep 17 00:00:00 2001 From: MaleDong Date: Sun, 10 Feb 2019 19:57:52 +0800 Subject: [PATCH 206/223] lib: fix the typo error Fix a typo error ('the' before 'any'). PR-URL: https://github.com/nodejs/node/pull/26032 Reviewed-By: Luigi Pinca Reviewed-By: Richard Lau Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Beth Griggs Reviewed-By: Michael Dawson Reviewed-By: Lance Ball Reviewed-By: Anto Aravinth Reviewed-By: James M Snell --- lib/internal/repl/recoverable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/repl/recoverable.js b/lib/internal/repl/recoverable.js index bb5af0ec225aa1..9d4fb11fa87733 100644 --- a/lib/internal/repl/recoverable.js +++ b/lib/internal/repl/recoverable.js @@ -10,7 +10,7 @@ const { tokTypes: tt, Parser: AcornParser } = acorn; function isRecoverableError(e, code) { let recoverable = false; - // Determine if the point of the any error raised is at the end of the input. + // Determine if the point of any error raised is at the end of the input. // There are two cases to consider: // // 1. Any error raised after we have encountered the 'eof' token. From b2b37c631a510112025069a1940bc570e202fb4d Mon Sep 17 00:00:00 2001 From: MaleDong Date: Sun, 10 Feb 2019 21:06:54 +0800 Subject: [PATCH 207/223] lib: simplify 'umask' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just check: if 'mask' is not undefined, just call 'validateMode' and then return the unmask value, we don't need split them into two returns. PR-URL: https://github.com/nodejs/node/pull/26035 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Ruben Bridgewater Reviewed-By: Jeremiah Senkpiel Reviewed-By: Michaël Zasso Reviewed-By: Sakthipriyan Vairamani Reviewed-By: James M Snell --- lib/internal/process/main_thread_only.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/internal/process/main_thread_only.js b/lib/internal/process/main_thread_only.js index 96c57fda35c755..2572402f620c27 100644 --- a/lib/internal/process/main_thread_only.js +++ b/lib/internal/process/main_thread_only.js @@ -26,11 +26,9 @@ function wrapProcessMethods(binding) { } function umask(mask) { - if (mask === undefined) { - // Get the mask - return binding.umask(mask); + if (mask !== undefined) { + mask = validateMode(mask, 'mask'); } - mask = validateMode(mask, 'mask'); return binding.umask(mask); } From 8b5a2c4f610a33ae1d7e68c056e127a387459a61 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 10 Feb 2019 11:55:38 -0500 Subject: [PATCH 208/223] deps: upgrade to libuv 1.26.0 Notable changes: - A bug that could result in 100% CPU utilization in Node has been fixed (https://github.com/libuv/libuv/issues/2162) - Node's report module will now include the entire Windows product name (https://github.com/libuv/libuv/pull/2170) PR-URL: https://github.com/nodejs/node/pull/26037 Fixes: https://github.com/nodejs/node/issues/26013 Fixes: https://github.com/nodejs/node/issues/25875 Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: Jeremiah Senkpiel --- deps/uv/AUTHORS | 3 + deps/uv/CMakeLists.txt | 1 + deps/uv/ChangeLog | 23 ++ deps/uv/Makefile.am | 1 + deps/uv/configure.ac | 2 +- deps/uv/docs/src/misc.rst | 9 +- deps/uv/docs/src/threading.rst | 29 +++ deps/uv/include/uv.h | 29 +++ deps/uv/include/uv/unix.h | 3 +- deps/uv/include/uv/version.h | 2 +- deps/uv/src/unix/aix.c | 1 + deps/uv/src/unix/core.c | 15 +- deps/uv/src/unix/kqueue.c | 1 + deps/uv/src/unix/linux-core.c | 1 + deps/uv/src/unix/os390.c | 1 + deps/uv/src/unix/pipe.c | 2 +- deps/uv/src/unix/posix-poll.c | 2 + deps/uv/src/unix/sunos.c | 1 + deps/uv/src/unix/tcp.c | 14 +- deps/uv/src/unix/thread.c | 25 +- deps/uv/src/win/thread.c | 27 ++- deps/uv/src/win/tty.c | 4 +- deps/uv/src/win/util.c | 80 +++++-- deps/uv/test/test-gethostname.c | 8 +- deps/uv/test/test-list.h | 8 + deps/uv/test/test-thread.c | 57 ++++- deps/uv/test/test-tty-duplicate-key.c | 321 ++++++++++++++++++++++++++ deps/uv/test/test.gyp | 1 + 28 files changed, 613 insertions(+), 58 deletions(-) create mode 100644 deps/uv/test/test-tty-duplicate-key.c diff --git a/deps/uv/AUTHORS b/deps/uv/AUTHORS index 3317efeb1ac8af..25447eb0e6e834 100644 --- a/deps/uv/AUTHORS +++ b/deps/uv/AUTHORS @@ -366,3 +366,6 @@ ptlomholt Victor Costan sid Kevin Adler +Stephen Belanger +yeyuanfeng +erw7 diff --git a/deps/uv/CMakeLists.txt b/deps/uv/CMakeLists.txt index fa268a13ed6661..5dc61eb825a2c5 100644 --- a/deps/uv/CMakeLists.txt +++ b/deps/uv/CMakeLists.txt @@ -149,6 +149,7 @@ set(uv_test_sources test/test-timer-from-check.c test/test-timer.c test/test-tmpdir.c + test/test-tty-duplicate-key.c test/test-tty.c test/test-udp-alloc-cb-fail.c test/test-udp-bind.c diff --git a/deps/uv/ChangeLog b/deps/uv/ChangeLog index 3652829ce7790b..7f02045e03ef7b 100644 --- a/deps/uv/ChangeLog +++ b/deps/uv/ChangeLog @@ -1,3 +1,26 @@ +2019.02.11, Version 1.26.0 (Stable), 8669d8d3e93cddb62611b267ef62a3ddb5ba3ca0 + +Changes since version 1.25.0: + +* doc: fix uv_get_free_memory doc (Stephen Belanger) + +* unix: fix epoll cpu 100% issue (yeyuanfeng) + +* openbsd,tcp: special handling of EINVAL on connect (ptlomholt) + +* win: simplify registry closing in uv_cpu_info() (cjihrig) + +* src,include: define UV_MAXHOSTNAMESIZE (cjihrig) + +* win: return product name in uv_os_uname() version (cjihrig) + +* thread: allow specifying stack size for new thread (Anna Henningsen) + +* win: fix duplicate tty vt100 fn key (erw7) + +* unix: don't attempt to invalidate invalid fd (Ben Noordhuis) + + 2019.01.19, Version 1.25.0 (Stable), 4a10a9d425863330af199e4b74bd688e62d945f1 Changes since version 1.24.1: diff --git a/deps/uv/Makefile.am b/deps/uv/Makefile.am index d8a01574f3cf2c..7e49d8ad0bee16 100644 --- a/deps/uv/Makefile.am +++ b/deps/uv/Makefile.am @@ -277,6 +277,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \ test/test-timer-from-check.c \ test/test-timer.c \ test/test-tmpdir.c \ + test/test-tty-duplicate-key.c \ test/test-tty.c \ test/test-udp-alloc-cb-fail.c \ test/test-udp-bind.c \ diff --git a/deps/uv/configure.ac b/deps/uv/configure.ac index ab656c83d23502..931ac3e3615e33 100644 --- a/deps/uv/configure.ac +++ b/deps/uv/configure.ac @@ -13,7 +13,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_PREREQ(2.57) -AC_INIT([libuv], [1.25.0], [https://github.com/libuv/libuv/issues]) +AC_INIT([libuv], [1.26.0], [https://github.com/libuv/libuv/issues]) AC_CONFIG_MACRO_DIR([m4]) m4_include([m4/libuv-extra-automake-flags.m4]) m4_include([m4/as_case.m4]) diff --git a/deps/uv/docs/src/misc.rst b/deps/uv/docs/src/misc.rst index 81c03a85303180..14e9acce9abb2b 100644 --- a/deps/uv/docs/src/misc.rst +++ b/deps/uv/docs/src/misc.rst @@ -431,7 +431,10 @@ API .. versionadded:: 1.9.0 -.. uint64_t uv_get_free_memory(void) +.. c:function:: uint64_t uv_get_free_memory(void) + + Gets memory information (in bytes). + .. c:function:: uint64_t uv_get_total_memory(void) Gets memory information (in bytes). @@ -531,6 +534,10 @@ API .. versionadded:: 1.12.0 + .. versionchanged:: 1.26.0 `UV_MAXHOSTNAMESIZE` is available and represents + the maximum `buffer` size required to store a + hostname and terminating `nul` character. + .. c:function:: int uv_os_getpriority(uv_pid_t pid, int* priority) Retrieves the scheduling priority of the process specified by `pid`. The diff --git a/deps/uv/docs/src/threading.rst b/deps/uv/docs/src/threading.rst index 89bb4a6f3ae14e..a5759a38a67f06 100644 --- a/deps/uv/docs/src/threading.rst +++ b/deps/uv/docs/src/threading.rst @@ -55,10 +55,39 @@ API Threads ^^^^^^^ +.. c:type:: uv_thread_options_t + + Options for spawning a new thread (passed to :c:func:`uv_thread_create_ex`). + + :: + + typedef struct uv_process_options_s { + enum { + UV_THREAD_NO_FLAGS = 0x00, + UV_THREAD_HAS_STACK_SIZE = 0x01 + } flags; + size_t stack_size; + } uv_process_options_t; + + More fields may be added to this struct at any time, so its exact + layout and size should not be relied upon. + + .. versionadded:: 1.26.0 + .. c:function:: int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg) .. versionchanged:: 1.4.1 returns a UV_E* error code on failure +.. c:function:: int uv_thread_create_ex(uv_thread_t* tid, const uv_thread_options_t* params, uv_thread_cb entry, void* arg) + + Like :c:func:`uv_thread_create`, but additionally specifies options for creating a new thread. + + If `UV_THREAD_HAS_STACK_SIZE` is set, `stack_size` specifies a stack size for the new thread. + `0` indicates that the default value should be used, i.e. behaves as if the flag was not set. + Other values will be rounded up to the nearest page boundary. + + .. versionadded:: 1.26.0 + .. c:function:: uv_thread_t uv_thread_self(void) .. c:function:: int uv_thread_join(uv_thread_t *tid) .. c:function:: int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2) diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h index a46b229dfd166e..1578bbd5682e40 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h @@ -1144,6 +1144,17 @@ UV_EXTERN int uv_os_getenv(const char* name, char* buffer, size_t* size); UV_EXTERN int uv_os_setenv(const char* name, const char* value); UV_EXTERN int uv_os_unsetenv(const char* name); +#ifdef MAXHOSTNAMELEN +# define UV_MAXHOSTNAMESIZE (MAXHOSTNAMELEN + 1) +#else + /* + Fallback for the maximum hostname size, including the null terminator. The + Windows gethostname() documentation states that 256 bytes will always be + large enough to hold the null-terminated hostname. + */ +# define UV_MAXHOSTNAMESIZE 256 +#endif + UV_EXTERN int uv_os_gethostname(char* buffer, size_t* size); UV_EXTERN int uv_os_uname(uv_utsname_t* buffer); @@ -1574,6 +1585,24 @@ UV_EXTERN void uv_key_set(uv_key_t* key, void* value); typedef void (*uv_thread_cb)(void* arg); UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg); + +typedef enum { + UV_THREAD_NO_FLAGS = 0x00, + UV_THREAD_HAS_STACK_SIZE = 0x01 +} uv_thread_create_flags; + +struct uv_thread_options_s { + unsigned int flags; + size_t stack_size; + /* More fields may be added at any time. */ +}; + +typedef struct uv_thread_options_s uv_thread_options_t; + +UV_EXTERN int uv_thread_create_ex(uv_thread_t* tid, + const uv_thread_options_t* params, + uv_thread_cb entry, + void* arg); UV_EXTERN uv_thread_t uv_thread_self(void); UV_EXTERN int uv_thread_join(uv_thread_t *tid); UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2); diff --git a/deps/uv/include/uv/unix.h b/deps/uv/include/uv/unix.h index d887d7211f1d1e..2363701b414728 100644 --- a/deps/uv/include/uv/unix.h +++ b/deps/uv/include/uv/unix.h @@ -31,13 +31,14 @@ #include #include #include -#include +#include /* MAXHOSTNAMELEN on Solaris */ #include #include #if !defined(__MVS__) #include +#include /* MAXHOSTNAMELEN on Linux and the BSDs */ #endif #include #include diff --git a/deps/uv/include/uv/version.h b/deps/uv/include/uv/version.h index 136772128ab35a..fa7320cf4d4a11 100644 --- a/deps/uv/include/uv/version.h +++ b/deps/uv/include/uv/version.h @@ -31,7 +31,7 @@ */ #define UV_VERSION_MAJOR 1 -#define UV_VERSION_MINOR 25 +#define UV_VERSION_MINOR 26 #define UV_VERSION_PATCH 0 #define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_SUFFIX "" diff --git a/deps/uv/src/unix/aix.c b/deps/uv/src/unix/aix.c index 337e58e0adc02f..ec1fb8b01e1823 100644 --- a/deps/uv/src/unix/aix.c +++ b/deps/uv/src/unix/aix.c @@ -1041,6 +1041,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { struct poll_ctl pc; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct pollfd*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c index cd57ce20ba2edb..7e42337b9aae05 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c @@ -43,7 +43,6 @@ #include #ifdef __sun -# include /* MAXHOSTNAMELEN on Solaris */ # include # include # include @@ -88,15 +87,6 @@ #include #endif -#if !defined(__MVS__) -#include /* MAXHOSTNAMELEN on Linux and the BSDs */ -#endif - -/* Fallback for the maximum hostname length */ -#ifndef MAXHOSTNAMELEN -# define MAXHOSTNAMELEN 256 -#endif - static int uv__run_pending(uv_loop_t* loop); /* Verify that uv_buf_t is ABI-compatible with struct iovec. */ @@ -892,7 +882,8 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) { QUEUE_REMOVE(&w->pending_queue); /* Remove stale events for this file descriptor */ - uv__platform_invalidate_fd(loop, w->fd); + if (w->fd != -1) + uv__platform_invalidate_fd(loop, w->fd); } @@ -1291,7 +1282,7 @@ int uv_os_gethostname(char* buffer, size_t* size) { instead by creating a large enough buffer and comparing the hostname length to the size input. */ - char buf[MAXHOSTNAMELEN + 1]; + char buf[UV_MAXHOSTNAMESIZE]; size_t len; if (buffer == NULL || size == NULL || *size == 0) diff --git a/deps/uv/src/unix/kqueue.c b/deps/uv/src/unix/kqueue.c index c24f96e1399c69..38c88d7da732af 100644 --- a/deps/uv/src/unix/kqueue.c +++ b/deps/uv/src/unix/kqueue.c @@ -387,6 +387,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { uintptr_t nfds; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct kevent*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; diff --git a/deps/uv/src/unix/linux-core.c b/deps/uv/src/unix/linux-core.c index 3341b94e1f26fd..7165fe2fb4dd1b 100644 --- a/deps/uv/src/unix/linux-core.c +++ b/deps/uv/src/unix/linux-core.c @@ -141,6 +141,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { uintptr_t nfds; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct epoll_event*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; diff --git a/deps/uv/src/unix/os390.c b/deps/uv/src/unix/os390.c index dc146e31108108..70e389ece3bc73 100644 --- a/deps/uv/src/unix/os390.c +++ b/deps/uv/src/unix/os390.c @@ -657,6 +657,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { uintptr_t nfds; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct epoll_event*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; diff --git a/deps/uv/src/unix/pipe.c b/deps/uv/src/unix/pipe.c index d3b554cfc3d896..228d158800acdc 100644 --- a/deps/uv/src/unix/pipe.c +++ b/deps/uv/src/unix/pipe.c @@ -215,7 +215,7 @@ void uv_pipe_connect(uv_connect_t* req, } if (err == 0) - uv__io_start(handle->loop, &handle->io_watcher, POLLIN | POLLOUT); + uv__io_start(handle->loop, &handle->io_watcher, POLLOUT); out: handle->delayed_error = err; diff --git a/deps/uv/src/unix/posix-poll.c b/deps/uv/src/unix/posix-poll.c index f3181f9b726278..a3b9f2196d5872 100644 --- a/deps/uv/src/unix/posix-poll.c +++ b/deps/uv/src/unix/posix-poll.c @@ -298,6 +298,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { size_t i; + assert(fd >= 0); + if (loop->poll_fds_iterating) { /* uv__io_poll is currently iterating. Just invalidate fd. */ for (i = 0; i < loop->poll_fds_used; i++) diff --git a/deps/uv/src/unix/sunos.c b/deps/uv/src/unix/sunos.c index 2552a019eb474d..75501f7a0a79b6 100644 --- a/deps/uv/src/unix/sunos.c +++ b/deps/uv/src/unix/sunos.c @@ -117,6 +117,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { uintptr_t nfds; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct port_event*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; diff --git a/deps/uv/src/unix/tcp.c b/deps/uv/src/unix/tcp.c index 2982851dc6eaa1..900839a99dfccc 100644 --- a/deps/uv/src/unix/tcp.c +++ b/deps/uv/src/unix/tcp.c @@ -235,12 +235,16 @@ int uv__tcp_connect(uv_connect_t* req, if (r == -1 && errno != 0) { if (errno == EINPROGRESS) ; /* not an error */ - else if (errno == ECONNREFUSED) - /* If we get a ECONNREFUSED wait until the next tick to report the - * error. Solaris wants to report immediately--other unixes want to - * wait. + else if (errno == ECONNREFUSED +#if defined(__OpenBSD__) + || errno == EINVAL +#endif + ) + /* If we get ECONNREFUSED (Solaris) or EINVAL (OpenBSD) wait until the + * next tick to report the error. Solaris and OpenBSD wants to report + * immediately -- other unixes want to wait. */ - handle->delayed_error = UV__ERR(errno); + handle->delayed_error = UV__ERR(ECONNREFUSED); else return UV__ERR(errno); } diff --git a/deps/uv/src/unix/thread.c b/deps/uv/src/unix/thread.c index 8bcb857610fa98..c17a51fed23efe 100644 --- a/deps/uv/src/unix/thread.c +++ b/deps/uv/src/unix/thread.c @@ -194,13 +194,34 @@ static size_t thread_stack_size(void) { int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { + uv_thread_options_t params; + params.flags = UV_THREAD_NO_FLAGS; + return uv_thread_create_ex(tid, ¶ms, entry, arg); +} + +int uv_thread_create_ex(uv_thread_t* tid, + const uv_thread_options_t* params, + void (*entry)(void *arg), + void *arg) { int err; - size_t stack_size; pthread_attr_t* attr; pthread_attr_t attr_storage; + size_t pagesize; + size_t stack_size; + + stack_size = + params->flags & UV_THREAD_HAS_STACK_SIZE ? params->stack_size : 0; attr = NULL; - stack_size = thread_stack_size(); + if (stack_size == 0) { + stack_size = thread_stack_size(); + } else { + pagesize = (size_t)getpagesize(); + /* Round up to the nearest page boundary. */ + stack_size = (stack_size + pagesize - 1) &~ (pagesize - 1); + if (stack_size < PTHREAD_STACK_MIN) + stack_size = PTHREAD_STACK_MIN; + } if (stack_size > 0) { attr = &attr_storage; diff --git a/deps/uv/src/win/thread.c b/deps/uv/src/win/thread.c index fd4b7c98688f69..89c53ada755b17 100644 --- a/deps/uv/src/win/thread.c +++ b/deps/uv/src/win/thread.c @@ -112,9 +112,34 @@ static UINT __stdcall uv__thread_start(void* arg) { int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { + uv_thread_options_t params; + params.flags = UV_THREAD_NO_FLAGS; + return uv_thread_create_ex(tid, ¶ms, entry, arg); +} + +int uv_thread_create_ex(uv_thread_t* tid, + const uv_thread_options_t* params, + void (*entry)(void *arg), + void *arg) { struct thread_ctx* ctx; int err; HANDLE thread; + SYSTEM_INFO sysinfo; + size_t stack_size; + size_t pagesize; + + stack_size = + params->flags & UV_THREAD_HAS_STACK_SIZE ? params->stack_size : 0; + + if (stack_size != 0) { + GetNativeSystemInfo(&sysinfo); + pagesize = (size_t)sysinfo.dwPageSize; + /* Round up to the nearest page boundary. */ + stack_size = (stack_size + pagesize - 1) &~ (pagesize - 1); + + if ((unsigned)stack_size != stack_size) + return UV_EINVAL; + } ctx = uv__malloc(sizeof(*ctx)); if (ctx == NULL) @@ -126,7 +151,7 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { /* Create the thread in suspended state so we have a chance to pass * its own creation handle to it */ thread = (HANDLE) _beginthreadex(NULL, - 0, + (unsigned)stack_size, uv__thread_start, ctx, CREATE_SUSPENDED, diff --git a/deps/uv/src/win/tty.c b/deps/uv/src/win/tty.c index f38e9a88636e4b..a98fe26335e4b8 100644 --- a/deps/uv/src/win/tty.c +++ b/deps/uv/src/win/tty.c @@ -736,8 +736,8 @@ void uv_process_tty_read_raw_req(uv_loop_t* loop, uv_tty_t* handle, /* Ignore keyup events, unless the left alt key was held and a valid * unicode character was emitted. */ if (!KEV.bKeyDown && - KEV.wVirtualKeyCode != VK_MENU && - KEV.uChar.UnicodeChar != 0) { + (KEV.wVirtualKeyCode != VK_MENU || + KEV.uChar.UnicodeChar == 0)) { continue; } diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c index 923789129e92e0..395d958c036958 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c @@ -59,13 +59,6 @@ # define UNLEN 256 #endif -/* - Max hostname length. The Windows gethostname() documentation states that 256 - bytes will always be large enough to hold the null-terminated hostname. -*/ -#ifndef MAXHOSTNAMELEN -# define MAXHOSTNAMELEN 256 -#endif /* Maximum environment variable size, including the terminating null */ #define MAX_ENV_VAR_LENGTH 32767 @@ -684,12 +677,9 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos_ptr, int* cpu_count_ptr) { NULL, (BYTE*)&cpu_brand, &cpu_brand_size); - if (err != ERROR_SUCCESS) { - RegCloseKey(processor_key); - goto error; - } - RegCloseKey(processor_key); + if (err != ERROR_SUCCESS) + goto error; cpu_info = &cpu_infos[i]; cpu_info->speed = cpu_speed; @@ -1510,7 +1500,7 @@ int uv_os_unsetenv(const char* name) { int uv_os_gethostname(char* buffer, size_t* size) { - char buf[MAXHOSTNAMELEN + 1]; + char buf[UV_MAXHOSTNAMESIZE]; size_t len; if (buffer == NULL || size == NULL || *size == 0) @@ -1634,6 +1624,10 @@ int uv_os_uname(uv_utsname_t* buffer) { https://github.com/gagern/gnulib/blob/master/lib/uname.c */ OSVERSIONINFOW os_info; SYSTEM_INFO system_info; + HKEY registry_key; + WCHAR product_name_w[256]; + DWORD product_name_w_size; + int version_size; int processor_level; int r; @@ -1658,16 +1652,56 @@ int uv_os_uname(uv_utsname_t* buffer) { } /* Populate the version field. */ - if (WideCharToMultiByte(CP_UTF8, - 0, - os_info.szCSDVersion, - -1, - buffer->version, - sizeof(buffer->version), - NULL, - NULL) == 0) { - r = uv_translate_sys_error(GetLastError()); - goto error; + version_size = 0; + r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", + 0, + KEY_QUERY_VALUE, + ®istry_key); + + if (r == ERROR_SUCCESS) { + product_name_w_size = sizeof(product_name_w); + r = RegGetValueW(registry_key, + NULL, + L"ProductName", + RRF_RT_REG_SZ, + NULL, + (PVOID) product_name_w, + &product_name_w_size); + RegCloseKey(registry_key); + + if (r == ERROR_SUCCESS) { + version_size = WideCharToMultiByte(CP_UTF8, + 0, + product_name_w, + -1, + buffer->version, + sizeof(buffer->version), + NULL, + NULL); + if (version_size == 0) { + r = uv_translate_sys_error(GetLastError()); + goto error; + } + } + } + + /* Append service pack information to the version if present. */ + if (os_info.szCSDVersion[0] != L'\0') { + if (version_size > 0) + buffer->version[version_size - 1] = ' '; + + if (WideCharToMultiByte(CP_UTF8, + 0, + os_info.szCSDVersion, + -1, + buffer->version + version_size, + sizeof(buffer->version) - version_size, + NULL, + NULL) == 0) { + r = uv_translate_sys_error(GetLastError()); + goto error; + } } /* Populate the sysname field. */ diff --git a/deps/uv/test/test-gethostname.c b/deps/uv/test/test-gethostname.c index 5229804b569421..ac636f0aba638b 100644 --- a/deps/uv/test/test-gethostname.c +++ b/deps/uv/test/test-gethostname.c @@ -23,12 +23,8 @@ #include "task.h" #include -#ifndef MAXHOSTNAMELEN -# define MAXHOSTNAMELEN 256 -#endif - TEST_IMPL(gethostname) { - char buf[MAXHOSTNAMELEN + 1]; + char buf[UV_MAXHOSTNAMESIZE]; size_t size; size_t enobufs_size; int r; @@ -52,7 +48,7 @@ TEST_IMPL(gethostname) { ASSERT(enobufs_size > 1); /* Successfully get the hostname */ - size = MAXHOSTNAMELEN + 1; + size = UV_MAXHOSTNAMESIZE; r = uv_os_gethostname(buf, &size); ASSERT(r == 0); ASSERT(size > 1 && size == strlen(buf)); diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h index 53372c90f769f8..d81416fad22b54 100644 --- a/deps/uv/test/test-list.h +++ b/deps/uv/test/test-list.h @@ -53,6 +53,9 @@ TEST_DECLARE (tty_raw) TEST_DECLARE (tty_empty_write) TEST_DECLARE (tty_large_write) TEST_DECLARE (tty_raw_cancel) +TEST_DECLARE (tty_duplicate_vt100_fn_key) +TEST_DECLARE (tty_duplicate_alt_modifier_key) +TEST_DECLARE (tty_composing_character) #endif TEST_DECLARE (tty_file) TEST_DECLARE (tty_pty) @@ -365,6 +368,7 @@ TEST_DECLARE (threadpool_cancel_fs) TEST_DECLARE (threadpool_cancel_single) TEST_DECLARE (thread_local_storage) TEST_DECLARE (thread_stack_size) +TEST_DECLARE (thread_stack_size_explicit) TEST_DECLARE (thread_mutex) TEST_DECLARE (thread_mutex_recursive) TEST_DECLARE (thread_rwlock) @@ -500,6 +504,9 @@ TASK_LIST_START TEST_ENTRY (tty_empty_write) TEST_ENTRY (tty_large_write) TEST_ENTRY (tty_raw_cancel) + TEST_ENTRY (tty_duplicate_vt100_fn_key) + TEST_ENTRY (tty_duplicate_alt_modifier_key) + TEST_ENTRY (tty_composing_character) #endif TEST_ENTRY (tty_file) TEST_ENTRY (tty_pty) @@ -930,6 +937,7 @@ TASK_LIST_START TEST_ENTRY (threadpool_cancel_single) TEST_ENTRY (thread_local_storage) TEST_ENTRY (thread_stack_size) + TEST_ENTRY (thread_stack_size_explicit) TEST_ENTRY (thread_mutex) TEST_ENTRY (thread_mutex_recursive) TEST_ENTRY (thread_rwlock) diff --git a/deps/uv/test/test-thread.c b/deps/uv/test/test-thread.c index 955c9f2f1be149..be72d5e8b39979 100644 --- a/deps/uv/test/test-thread.c +++ b/deps/uv/test/test-thread.c @@ -26,6 +26,10 @@ #include #include /* memset */ +#ifdef __POSIX__ +#include +#endif + struct getaddrinfo_req { uv_thread_t thread_id; unsigned int counter; @@ -207,10 +211,15 @@ TEST_IMPL(thread_local_storage) { static void thread_check_stack(void* arg) { #if defined(__APPLE__) + size_t expected; + expected = arg == NULL ? 0 : ((uv_thread_options_t*)arg)->stack_size; /* 512 kB is the default stack size of threads other than the main thread * on MacOS. */ - ASSERT(pthread_get_stacksize_np(pthread_self()) > 512*1024); + if (expected == 0) + expected = 512 * 1024; + ASSERT(pthread_get_stacksize_np(pthread_self()) >= expected); #elif defined(__linux__) && defined(__GLIBC__) + size_t expected; struct rlimit lim; size_t stack_size; pthread_attr_t attr; @@ -219,7 +228,10 @@ static void thread_check_stack(void* arg) { lim.rlim_cur = 2 << 20; /* glibc default. */ ASSERT(0 == pthread_getattr_np(pthread_self(), &attr)); ASSERT(0 == pthread_attr_getstacksize(&attr, &stack_size)); - ASSERT(stack_size >= lim.rlim_cur); + expected = arg == NULL ? 0 : ((uv_thread_options_t*)arg)->stack_size; + if (expected == 0) + expected = (size_t)lim.rlim_cur; + ASSERT(stack_size >= expected); #endif } @@ -230,3 +242,44 @@ TEST_IMPL(thread_stack_size) { ASSERT(0 == uv_thread_join(&thread)); return 0; } + +TEST_IMPL(thread_stack_size_explicit) { + uv_thread_t thread; + uv_thread_options_t options; + + options.flags = UV_THREAD_HAS_STACK_SIZE; + options.stack_size = 1024 * 1024; + ASSERT(0 == uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT(0 == uv_thread_join(&thread)); + + options.stack_size = 8 * 1024 * 1024; /* larger than most default os sizes */ + ASSERT(0 == uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT(0 == uv_thread_join(&thread)); + + options.stack_size = 0; + ASSERT(0 == uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT(0 == uv_thread_join(&thread)); + +#ifdef PTHREAD_STACK_MIN + options.stack_size = PTHREAD_STACK_MIN - 42; /* unaligned size */ + ASSERT(0 == uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT(0 == uv_thread_join(&thread)); + + options.stack_size = PTHREAD_STACK_MIN / 2 - 42; /* unaligned size */ + ASSERT(0 == uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT(0 == uv_thread_join(&thread)); +#endif + + /* unaligned size, should be larger than PTHREAD_STACK_MIN */ + options.stack_size = 1234567; + ASSERT(0 == uv_thread_create_ex(&thread, &options, + thread_check_stack, &options)); + ASSERT(0 == uv_thread_join(&thread)); + + return 0; +} diff --git a/deps/uv/test/test-tty-duplicate-key.c b/deps/uv/test/test-tty-duplicate-key.c new file mode 100644 index 00000000000000..1ec2f3695d99a4 --- /dev/null +++ b/deps/uv/test/test-tty-duplicate-key.c @@ -0,0 +1,321 @@ +/* Copyright libuv project contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifdef _WIN32 + +#include "uv.h" +#include "task.h" + +#include +#include +#include +#include + +#define ESC "\x1b" +#define EUR_UTF8 "\xe2\x82\xac" +#define EUR_UNICODE 0x20AC + + +const char* expect_str = NULL; +ssize_t expect_nread = 0; + +static void dump_str(const char* str, ssize_t len) { + ssize_t i; + for (i = 0; i < len; i++) { + fprintf(stderr, "%#02x ", *(str + i)); + } +} + +static void print_err_msg(const char* expect, ssize_t expect_len, + const char* found, ssize_t found_len) { + fprintf(stderr, "expect "); + dump_str(expect, expect_len); + fprintf(stderr, ", but found "); + dump_str(found, found_len); + fprintf(stderr, "\n"); +} + +static void tty_alloc(uv_handle_t* handle, size_t size, uv_buf_t* buf) { + buf->base = malloc(size); + ASSERT(buf->base != NULL); + buf->len = size; +} + +static void tty_read(uv_stream_t* tty_in, ssize_t nread, const uv_buf_t* buf) { + if (nread > 0) { + if (nread != expect_nread) { + fprintf(stderr, "expected nread %ld, but found %ld\n", + (long)expect_nread, (long)nread); + print_err_msg(expect_str, expect_nread, buf->base, nread); + ASSERT(FALSE); + } + if (strncmp(buf->base, expect_str, nread) != 0) { + print_err_msg(expect_str, expect_nread, buf->base, nread); + ASSERT(FALSE); + } + uv_close((uv_handle_t*) tty_in, NULL); + } else { + ASSERT(nread == 0); + } +} + +static void make_key_event_records(WORD virt_key, DWORD ctr_key_state, + BOOL is_wsl, INPUT_RECORD* records) { +# define KEV(I) records[(I)].Event.KeyEvent + BYTE kb_state[256] = {0}; + WCHAR buf[2]; + int ret; + + records[0].EventType = records[1].EventType = KEY_EVENT; + KEV(0).bKeyDown = TRUE; + KEV(1).bKeyDown = FALSE; + KEV(0).wVirtualKeyCode = KEV(1).wVirtualKeyCode = virt_key; + KEV(0).wRepeatCount = KEV(1).wRepeatCount = 1; + KEV(0).wVirtualScanCode = KEV(1).wVirtualScanCode = + MapVirtualKeyW(virt_key, MAPVK_VK_TO_VSC); + KEV(0).dwControlKeyState = KEV(1).dwControlKeyState = ctr_key_state; + if (ctr_key_state & LEFT_ALT_PRESSED) { + kb_state[VK_LMENU] = 0x01; + } + if (ctr_key_state & RIGHT_ALT_PRESSED) { + kb_state[VK_RMENU] = 0x01; + } + if (ctr_key_state & LEFT_CTRL_PRESSED) { + kb_state[VK_LCONTROL] = 0x01; + } + if (ctr_key_state & RIGHT_CTRL_PRESSED) { + kb_state[VK_RCONTROL] = 0x01; + } + if (ctr_key_state & SHIFT_PRESSED) { + kb_state[VK_SHIFT] = 0x01; + } + ret = ToUnicode(virt_key, KEV(0).wVirtualScanCode, kb_state, buf, 2, 0); + if (ret == 1) { + if(!is_wsl && + ((ctr_key_state & LEFT_ALT_PRESSED) || + (ctr_key_state & RIGHT_ALT_PRESSED))) { + /* + * If ALT key is pressed, the UnicodeChar value of the keyup event is + * set to 0 on nomal console. Emulate this behavior. + * See https://github.com/Microsoft/console/issues/320 + */ + KEV(0).uChar.UnicodeChar = buf[0]; + KEV(1).uChar.UnicodeChar = 0; + } else{ + /* + * In WSL UnicodeChar is normally set. This behavior cause #2111. + */ + KEV(0).uChar.UnicodeChar = KEV(1).uChar.UnicodeChar = buf[0]; + } + } else { + KEV(0).uChar.UnicodeChar = KEV(1).uChar.UnicodeChar = 0; + } +# undef KEV +} + +TEST_IMPL(tty_duplicate_vt100_fn_key) { + int r; + int ttyin_fd; + uv_tty_t tty_in; + uv_loop_t* loop; + HANDLE handle; + INPUT_RECORD records[2]; + DWORD written; + + loop = uv_default_loop(); + + /* Make sure we have an FD that refers to a tty */ + handle = CreateFileA("conin$", + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); + ASSERT(handle != INVALID_HANDLE_VALUE); + ttyin_fd = _open_osfhandle((intptr_t) handle, 0); + ASSERT(ttyin_fd >= 0); + ASSERT(UV_TTY == uv_guess_handle(ttyin_fd)); + + r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */ + ASSERT(r == 0); + ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); + ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); + + r = uv_read_start((uv_stream_t*)&tty_in, tty_alloc, tty_read); + ASSERT(r == 0); + + expect_str = ESC"[[A"; + expect_nread = strlen(expect_str); + + /* Turn on raw mode. */ + r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW); + ASSERT(r == 0); + + /* + * Send F1 keystrokes. Test of issue cause by #2114 that vt100 fn key + * duplicate. + */ + make_key_event_records(VK_F1, 0, TRUE, records); + WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); + ASSERT(written == ARRAY_SIZE(records)); + + uv_run(loop, UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + +TEST_IMPL(tty_duplicate_alt_modifier_key) { + int r; + int ttyin_fd; + uv_tty_t tty_in; + uv_loop_t* loop; + HANDLE handle; + INPUT_RECORD records[2]; + INPUT_RECORD alt_records[2]; + DWORD written; + + loop = uv_default_loop(); + + /* Make sure we have an FD that refers to a tty */ + handle = CreateFileA("conin$", + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); + ASSERT(handle != INVALID_HANDLE_VALUE); + ttyin_fd = _open_osfhandle((intptr_t) handle, 0); + ASSERT(ttyin_fd >= 0); + ASSERT(UV_TTY == uv_guess_handle(ttyin_fd)); + + r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */ + ASSERT(r == 0); + ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); + ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); + + r = uv_read_start((uv_stream_t*)&tty_in, tty_alloc, tty_read); + ASSERT(r == 0); + + expect_str = ESC"a"ESC"a"; + expect_nread = strlen(expect_str); + + /* Turn on raw mode. */ + r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW); + ASSERT(r == 0); + + /* Emulate transmission of M-a at normal console */ + make_key_event_records(VK_MENU, 0, TRUE, alt_records); + WriteConsoleInputW(handle, &alt_records[0], 1, &written); + ASSERT(written == 1); + make_key_event_records(L'A', LEFT_ALT_PRESSED, FALSE, records); + WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); + ASSERT(written == 2); + WriteConsoleInputW(handle, &alt_records[1], 1, &written); + ASSERT(written == 1); + + /* Emulate transmission of M-a at WSL(#2111) */ + make_key_event_records(VK_MENU, 0, TRUE, alt_records); + WriteConsoleInputW(handle, &alt_records[0], 1, &written); + ASSERT(written == 1); + make_key_event_records(L'A', LEFT_ALT_PRESSED, TRUE, records); + WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); + ASSERT(written == 2); + WriteConsoleInputW(handle, &alt_records[1], 1, &written); + ASSERT(written == 1); + + uv_run(loop, UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + +TEST_IMPL(tty_composing_character) { + int r; + int ttyin_fd; + uv_tty_t tty_in; + uv_loop_t* loop; + HANDLE handle; + INPUT_RECORD records[2]; + INPUT_RECORD alt_records[2]; + DWORD written; + + loop = uv_default_loop(); + + /* Make sure we have an FD that refers to a tty */ + handle = CreateFileA("conin$", + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); + ASSERT(handle != INVALID_HANDLE_VALUE); + ttyin_fd = _open_osfhandle((intptr_t) handle, 0); + ASSERT(ttyin_fd >= 0); + ASSERT(UV_TTY == uv_guess_handle(ttyin_fd)); + + r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */ + ASSERT(r == 0); + ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); + ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); + + r = uv_read_start((uv_stream_t*)&tty_in, tty_alloc, tty_read); + ASSERT(r == 0); + + expect_str = EUR_UTF8; + expect_nread = strlen(expect_str); + + /* Turn on raw mode. */ + r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW); + ASSERT(r == 0); + + /* Emulate EUR inputs by LEFT ALT+NUMPAD ASCII KeyComos */ + make_key_event_records(VK_MENU, 0, FALSE, alt_records); + alt_records[1].Event.KeyEvent.uChar.UnicodeChar = EUR_UNICODE; + WriteConsoleInputW(handle, &alt_records[0], 1, &written); + make_key_event_records(VK_NUMPAD0, LEFT_ALT_PRESSED, FALSE, records); + WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); + ASSERT(written == ARRAY_SIZE(records)); + make_key_event_records(VK_NUMPAD1, LEFT_ALT_PRESSED, FALSE, records); + WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); + ASSERT(written == ARRAY_SIZE(records)); + make_key_event_records(VK_NUMPAD2, LEFT_ALT_PRESSED, FALSE, records); + WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); + ASSERT(written == ARRAY_SIZE(records)); + make_key_event_records(VK_NUMPAD8, LEFT_ALT_PRESSED, FALSE, records); + WriteConsoleInputW(handle, records, ARRAY_SIZE(records), &written); + ASSERT(written == ARRAY_SIZE(records)); + WriteConsoleInputW(handle, &alt_records[1], 1, &written); + + uv_run(loop, UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + +#else + +typedef int file_has_no_tests; /* ISO C forbids an empty translation unit. */ + +#endif /* ifndef _WIN32 */ diff --git a/deps/uv/test/test.gyp b/deps/uv/test/test.gyp index 604925861e525a..8fc6cca140dc7e 100644 --- a/deps/uv/test/test.gyp +++ b/deps/uv/test/test.gyp @@ -133,6 +133,7 @@ 'test-timer-again.c', 'test-timer-from-check.c', 'test-timer.c', + 'test-tty-duplicate-key.c', 'test-tty.c', 'test-udp-alloc-cb-fail.c', 'test-udp-bind.c', From 9c9aefe2a09d601a36366062c856f852f3778b00 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 5 Feb 2019 21:51:28 +0100 Subject: [PATCH 209/223] worker: set stack size for worker threads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is so we can inform V8 about a known limit for the stack. Otherwise, on some systems recursive functions may lead to segmentation faults rather than “safe” failures. PR-URL: https://github.com/nodejs/node/pull/26049 Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- src/node_worker.cc | 13 ++++++++++++- src/node_worker.h | 6 ++++++ test/parallel/test-worker-stack-overflow.js | 11 +++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-worker-stack-overflow.js diff --git a/src/node_worker.cc b/src/node_worker.cc index ebd1924b8f2479..f38b187c18c5b8 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -118,6 +118,8 @@ class WorkerThreadData { { Locker locker(isolate); Isolate::Scope isolate_scope(isolate); + isolate->SetStackLimit(w_->stack_base_); + HandleScope handle_scope(isolate); isolate_data_.reset(CreateIsolateData(isolate, &loop_, @@ -488,8 +490,17 @@ void Worker::StartThread(const FunctionCallbackInfo& args) { static_cast(handle->data)->OnThreadStopped(); }), 0); - CHECK_EQ(uv_thread_create(&w->tid_, [](void* arg) { + uv_thread_options_t thread_options; + thread_options.flags = UV_THREAD_HAS_STACK_SIZE; + thread_options.stack_size = kStackSize; + CHECK_EQ(uv_thread_create_ex(&w->tid_, &thread_options, [](void* arg) { Worker* w = static_cast(arg); + const uintptr_t stack_top = reinterpret_cast(&arg); + + // Leave a few kilobytes just to make sure we're within limits and have + // some space to do work in C++ land. + w->stack_base_ = stack_top - (kStackSize - kStackBufferSize); + w->Run(); Mutex::ScopedLock lock(w->mutex_); diff --git a/src/node_worker.h b/src/node_worker.h index 4d7a7335ca6d63..68848c859990f0 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -80,6 +80,12 @@ class Worker : public AsyncWrap { bool thread_joined_ = true; int exit_code_ = 0; uint64_t thread_id_ = -1; + uintptr_t stack_base_; + + // Full size of the thread's stack. + static constexpr size_t kStackSize = 4 * 1024 * 1024; + // Stack buffer size that is not available to the JS engine. + static constexpr size_t kStackBufferSize = 192 * 1024; std::unique_ptr child_port_data_; diff --git a/test/parallel/test-worker-stack-overflow.js b/test/parallel/test-worker-stack-overflow.js new file mode 100644 index 00000000000000..99a34b5369006f --- /dev/null +++ b/test/parallel/test-worker-stack-overflow.js @@ -0,0 +1,11 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const { Worker } = require('worker_threads'); + +const worker = new Worker('function f() { f(); } f();', { eval: true }); + +worker.on('error', common.mustCall((err) => { + assert.strictEqual(err.constructor, RangeError); + assert.strictEqual(err.message, 'Maximum call stack size exceeded'); +})); From 51982978ebbf79a74a213b6b274947e9eac363fd Mon Sep 17 00:00:00 2001 From: Weijia Wang <381152119@qq.com> Date: Mon, 11 Feb 2019 13:30:15 +0800 Subject: [PATCH 210/223] http: improve performance for incoming headers PR-URL: https://github.com/nodejs/node/pull/26041 Reviewed-By: Ben Noordhuis Reviewed-By: Sakthipriyan Vairamani --- benchmark/_http-benchmarkers.js | 5 +- benchmark/http/incoming_headers.js | 35 +++++ lib/_http_incoming.js | 202 ++++++++++++----------------- 3 files changed, 124 insertions(+), 118 deletions(-) create mode 100644 benchmark/http/incoming_headers.js diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index f4566284547ac4..a4d623003947eb 100644 --- a/benchmark/_http-benchmarkers.js +++ b/benchmark/_http-benchmarkers.js @@ -25,8 +25,11 @@ class AutocannonBenchmarker { '-c', options.connections, '-j', '-n', - `http://127.0.0.1:${options.port}${options.path}`, ]; + for (const field in options.headers) { + args.push('-H', `${field}=${options.headers[field]}`); + } + args.push(`http://127.0.0.1:${options.port}${options.path}`); const child = child_process.spawn(this.executable, args); return child; } diff --git a/benchmark/http/incoming_headers.js b/benchmark/http/incoming_headers.js new file mode 100644 index 00000000000000..a1ab57e23876bf --- /dev/null +++ b/benchmark/http/incoming_headers.js @@ -0,0 +1,35 @@ +'use strict'; +const common = require('../common.js'); +const http = require('http'); + +const bench = common.createBenchmark(main, { + // unicode confuses ab on os x. + c: [50, 500], + headerDuplicates: [0, 5, 20] +}); + +function main({ c, headerDuplicates }) { + const server = http.createServer((req, res) => { + res.end(); + }); + + server.listen(common.PORT, () => { + const headers = { + 'Content-Type': 'text/plain', + 'Accept': 'text/plain', + 'User-Agent': 'nodejs-benchmark', + 'Date': new Date().toString(), + 'Cache-Control': 'no-cache' + }; + for (let i = 0; i < headerDuplicates; i++) { + headers[`foo${i}`] = `some header value ${i}`; + } + bench.http({ + path: '/', + connections: c, + headers + }, () => { + server.close(); + }); + }); +} diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index d220ede8a4e9be..9ad3b8eb0d725a 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -135,133 +135,101 @@ function _addHeaderLines(headers, n) { // TODO: perhaps http_parser could be returning both raw and lowercased versions // of known header names to avoid us having to call toLowerCase() for those // headers. - -// 'array' header list is taken from: -// https://mxr.mozilla.org/mozilla/source/netwerk/protocol/http/src/nsHttpHeaderArray.cpp -function matchKnownFields(field) { - var low = false; - while (true) { - switch (field) { - case 'Content-Type': - case 'content-type': - return 'content-type'; - case 'Content-Length': - case 'content-length': - return 'content-length'; - case 'User-Agent': - case 'user-agent': - return 'user-agent'; - case 'Referer': - case 'referer': - return 'referer'; - case 'Host': - case 'host': - return 'host'; - case 'Authorization': - case 'authorization': - return 'authorization'; - case 'Proxy-Authorization': - case 'proxy-authorization': - return 'proxy-authorization'; - case 'If-Modified-Since': - case 'if-modified-since': - return 'if-modified-since'; - case 'If-Unmodified-Since': - case 'if-unmodified-since': - return 'if-unmodified-since'; - case 'From': - case 'from': - return 'from'; - case 'Location': - case 'location': +function matchKnownFields(field, lowercased) { + switch (field.length) { + case 3: + if (field === 'Age' || field === 'age') return 'age'; + break; + case 4: + if (field === 'Host' || field === 'host') return 'host'; + if (field === 'From' || field === 'from') return 'from'; + if (field === 'ETag' || field === 'etag') return 'etag'; + if (field === 'Date' || field === 'date') return '\u0000date'; + if (field === 'Vary' || field === 'vary') return '\u0000vary'; + break; + case 6: + if (field === 'Server' || field === 'server') return 'server'; + if (field === 'Cookie' || field === 'cookie') return '\u0002cookie'; + if (field === 'Origin' || field === 'origin') return '\u0000origin'; + if (field === 'Expect' || field === 'expect') return '\u0000expect'; + if (field === 'Accept' || field === 'accept') return '\u0000accept'; + break; + case 7: + if (field === 'Referer' || field === 'referer') return 'referer'; + if (field === 'Expires' || field === 'expires') return 'expires'; + if (field === 'Upgrade' || field === 'upgrade') return '\u0000upgrade'; + break; + case 8: + if (field === 'Location' || field === 'location') return 'location'; - case 'Max-Forwards': - case 'max-forwards': - return 'max-forwards'; - case 'Retry-After': - case 'retry-after': - return 'retry-after'; - case 'ETag': - case 'etag': - return 'etag'; - case 'Last-Modified': - case 'last-modified': - return 'last-modified'; - case 'Server': - case 'server': - return 'server'; - case 'Age': - case 'age': - return 'age'; - case 'Expires': - case 'expires': - return 'expires'; - case 'Set-Cookie': - case 'set-cookie': + if (field === 'If-Match' || field === 'if-match') + return '\u0000if-match'; + break; + case 10: + if (field === 'User-Agent' || field === 'user-agent') + return 'user-agent'; + if (field === 'Set-Cookie' || field === 'set-cookie') return '\u0001'; - case 'Cookie': - case 'cookie': - return '\u0002cookie'; - // The fields below are not used in _addHeaderLine(), but they are common - // headers where we can avoid toLowerCase() if the mixed or lower case - // versions match the first time through. - case 'Transfer-Encoding': - case 'transfer-encoding': - return '\u0000transfer-encoding'; - case 'Date': - case 'date': - return '\u0000date'; - case 'Connection': - case 'connection': + if (field === 'Connection' || field === 'connection') return '\u0000connection'; - case 'Cache-Control': - case 'cache-control': + break; + case 11: + if (field === 'Retry-After' || field === 'retry-after') + return 'retry-after'; + break; + case 12: + if (field === 'Content-Type' || field === 'content-type') + return 'content-type'; + if (field === 'Max-Forwards' || field === 'max-forwards') + return 'max-forwards'; + break; + case 13: + if (field === 'Authorization' || field === 'authorization') + return 'authorization'; + if (field === 'Last-Modified' || field === 'last-modified') + return 'last-modified'; + if (field === 'Cache-Control' || field === 'cache-control') return '\u0000cache-control'; - case 'Vary': - case 'vary': - return '\u0000vary'; - case 'Content-Encoding': - case 'content-encoding': - return '\u0000content-encoding'; - case 'Origin': - case 'origin': - return '\u0000origin'; - case 'Upgrade': - case 'upgrade': - return '\u0000upgrade'; - case 'Expect': - case 'expect': - return '\u0000expect'; - case 'If-Match': - case 'if-match': - return '\u0000if-match'; - case 'If-None-Match': - case 'if-none-match': + if (field === 'If-None-Match' || field === 'if-none-match') return '\u0000if-none-match'; - case 'Accept': - case 'accept': - return '\u0000accept'; - case 'Accept-Encoding': - case 'accept-encoding': + break; + case 14: + if (field === 'Content-Length' || field === 'content-length') + return 'content-length'; + break; + case 15: + if (field === 'Accept-Encoding' || field === 'accept-encoding') return '\u0000accept-encoding'; - case 'Accept-Language': - case 'accept-language': + if (field === 'Accept-Language' || field === 'accept-language') return '\u0000accept-language'; - case 'X-Forwarded-For': - case 'x-forwarded-for': + if (field === 'X-Forwarded-For' || field === 'x-forwarded-for') return '\u0000x-forwarded-for'; - case 'X-Forwarded-Host': - case 'x-forwarded-host': + break; + case 16: + if (field === 'Content-Encoding' || field === 'content-encoding') + return '\u0000content-encoding'; + if (field === 'X-Forwarded-Host' || field === 'x-forwarded-host') return '\u0000x-forwarded-host'; - case 'X-Forwarded-Proto': - case 'x-forwarded-proto': + break; + case 17: + if (field === 'If-Modified-Since' || field === 'if-modified-since') + return 'if-modified-since'; + if (field === 'Transfer-Encoding' || field === 'transfer-encoding') + return '\u0000transfer-encoding'; + if (field === 'X-Forwarded-Proto' || field === 'x-forwarded-proto') return '\u0000x-forwarded-proto'; - default: - if (low) - return '\u0000' + field; - field = field.toLowerCase(); - low = true; - } + break; + case 19: + if (field === 'Proxy-Authorization' || field === 'proxy-authorization') + return 'proxy-authorization'; + if (field === 'If-Unmodified-Since' || field === 'if-unmodified-since') + return 'if-unmodified-since'; + break; + } + if (lowercased) { + return '\u0000' + field; + } else { + return matchKnownFields(field.toLowerCase(), true); } } // Add the given (field, value) pair to the message From 8495a788c68d16b57a0baefbb3f4d9a85ccb632a Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 7 Feb 2019 13:27:14 -0800 Subject: [PATCH 211/223] tls: renegotiate should take care of its own state In the initial version of this test there were two zero-length writes to force tls state to cycle. The second is not necessary, at least not now, but the first was. The renegotiate() API should ensure that packet exchange takes place, not its users, so move the zero-length write into tls. See: https://github.com/nodejs/node/pull/14239 See: https://github.com/nodejs/node/commit/b1909d3a70f9 PR-URL: https://github.com/nodejs/node/pull/25997 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- lib/_tls_wrap.js | 3 +++ test/parallel/test-tls-disable-renegotiation.js | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 5e3239ae200832..f1d5ade3edbdf3 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -613,6 +613,9 @@ TLSSocket.prototype.renegotiate = function(options, callback) { this._requestCert = requestCert; this._rejectUnauthorized = rejectUnauthorized; } + // Ensure that we'll cycle through internal openssl's state + this.write(''); + if (!this._handle.renegotiate()) { if (callback) { process.nextTick(callback, new ERR_TLS_RENEGOTIATE()); diff --git a/test/parallel/test-tls-disable-renegotiation.js b/test/parallel/test-tls-disable-renegotiation.js index f43276460910f7..0fc98641a69800 100644 --- a/test/parallel/test-tls-disable-renegotiation.js +++ b/test/parallel/test-tls-disable-renegotiation.js @@ -46,7 +46,6 @@ server.listen(0, common.mustCall(() => { port }; const client = tls.connect(options, common.mustCall(() => { - client.write(''); // Negotiation is still permitted for this first // attempt. This should succeed. let ok = client.renegotiate(options, common.mustCall((err) => { @@ -56,7 +55,6 @@ server.listen(0, common.mustCall(() => { // data event on the server. After that data // is received, disableRenegotiation is called. client.write('data', common.mustCall(() => { - client.write(''); // This second renegotiation attempt should fail // and the callback should never be invoked. The // server will simply drop the connection after From 5f6a710d8dbabfa04e277c9dc95e86e800a3c1e3 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 10 Feb 2019 12:17:53 -0500 Subject: [PATCH 212/223] os,report: use UV_MAXHOSTNAMESIZE UV_MAXHOSTNAMESIZE was introduced in libuv 1.26.0. Use this instead of including multiple header files, adding fallback ifdef logic, and remembering to add one to the buffer size for the terminating nul character with MAXHOSTNAMELEN. PR-URL: https://github.com/nodejs/node/pull/26038 Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: Richard Lau Reviewed-By: Jeremiah Senkpiel Reviewed-By: Sakthipriyan Vairamani Reviewed-By: James M Snell --- src/node_os.cc | 9 +-------- src/node_report.cc | 11 +---------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/node_os.cc b/src/node_os.cc index a5ae53ba75ee3c..17b507d8e3a37d 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -33,17 +33,10 @@ #ifdef __POSIX__ # include // PATH_MAX on Solaris. -# include // MAXHOSTNAMELEN on Solaris. # include // gethostname, sysconf -# include // MAXHOSTNAMELEN on Linux and the BSDs. # include #endif // __POSIX__ -// Add Windows fallback. -#ifndef MAXHOSTNAMELEN -# define MAXHOSTNAMELEN 256 -#endif // MAXHOSTNAMELEN - namespace node { namespace os { @@ -67,7 +60,7 @@ using v8::Value; static void GetHostname(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - char buf[MAXHOSTNAMELEN + 1]; + char buf[UV_MAXHOSTNAMESIZE]; size_t size = sizeof(buf); int r = uv_os_gethostname(buf, &size); diff --git a/src/node_report.cc b/src/node_report.cc index 1a459a2d1c97a3..8f882b9887424e 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -47,15 +47,6 @@ extern char** environ; #endif -#ifdef __POSIX__ -# include // MAXHOSTNAMELEN on Solaris. -# include // MAXHOSTNAMELEN on Linux and the BSDs. -#endif // __POSIX__ - -#ifndef MAXHOSTNAMELEN -# define MAXHOSTNAMELEN 256 -#endif // MAXHOSTNAMELEN - namespace report { using node::arraysize; using node::Environment; @@ -377,7 +368,7 @@ static void PrintVersionInformation(JSONWriter* writer) { writer->json_keyvalue("osMachine", os_info.machine); } - char host[MAXHOSTNAMELEN + 1]; + char host[UV_MAXHOSTNAMESIZE]; size_t host_size = sizeof(host); if (uv_os_gethostname(host, &host_size) == 0) From 9d6291ad46a608232da971bcf4554087da5e1f09 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 10 Feb 2019 17:58:41 +0800 Subject: [PATCH 213/223] process: refactor lib/internal/bootstrap/node.js - Use `deprecate` from `internal/util` instead of from `util` - Split `setupGlobalVariables()` into `setupGlobalProxy()` and `setupBuffer()`, and move out manipulation of the process object. PR-URL: https://github.com/nodejs/node/pull/26033 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Backport-PR-URL: https://github.com/nodejs/node/pull/26085 --- lib/internal/bootstrap/node.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 9ee28d24367457..ca9d6c60cf3868 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -40,6 +40,7 @@ const { internalBinding, NativeModule } = loaderExports; const { Object, Symbol } = primordials; const { getOptionValue } = NativeModule.require('internal/options'); const config = internalBinding('config'); +const { deprecate } = NativeModule.require('internal/util'); setupTraceCategoryState(); @@ -63,7 +64,11 @@ setupProcessObject(); hasUncaughtExceptionCaptureCallback; } -setupGlobalVariables(); +setupGlobalProxy(); +setupBuffer(); + +process.domain = null; +process._exiting = false; // Bootstrappers for all threads, including worker threads and main thread const perThreadSetup = NativeModule.require('internal/process/per_thread'); @@ -228,7 +233,6 @@ if (process._invalidDebug) { 'DeprecationWarning', 'DEP0062', undefined, true); } -const { deprecate } = NativeModule.require('internal/util'); // TODO(jasnell): The following have been globals since around 2012. // That's just silly. The underlying perfctr support has been removed // so these are now deprecated non-ops that can be removed after one @@ -388,6 +392,8 @@ function setupProcessObject() { const origProcProto = Object.getPrototypeOf(process); Object.setPrototypeOf(origProcProto, EventEmitter.prototype); EventEmitter.call(process); + // Make process globally available to users by putting it on the global proxy + global.process = process; } function setupProcessStdio(getStdout, getStdin, getStderr) { @@ -415,24 +421,22 @@ function setupProcessStdio(getStdout, getStdin, getStderr) { }; } -function setupGlobalVariables() { +function setupGlobalProxy() { Object.defineProperty(global, Symbol.toStringTag, { value: 'global', writable: false, enumerable: false, configurable: true }); - global.process = process; - const util = NativeModule.require('util'); function makeGetter(name) { - return util.deprecate(function() { + return deprecate(function() { return this; }, `'${name}' is deprecated, use 'global'`, 'DEP0016'); } function makeSetter(name) { - return util.deprecate(function(value) { + return deprecate(function(value) { Object.defineProperty(this, name, { configurable: true, writable: true, @@ -454,7 +458,9 @@ function setupGlobalVariables() { set: makeSetter('root') } }); +} +function setupBuffer() { const { Buffer } = NativeModule.require('buffer'); const bufferBinding = internalBinding('buffer'); @@ -464,8 +470,6 @@ function setupGlobalVariables() { delete bufferBinding.zeroFill; global.Buffer = Buffer; - process.domain = null; - process._exiting = false; } function setupGlobalTimeouts() { From 21e6d353af734dd7701854b644a7ab8b7327cc8d Mon Sep 17 00:00:00 2001 From: Thang Tran Date: Mon, 11 Feb 2019 22:14:19 +0100 Subject: [PATCH 214/223] doc: renamed remote's name To keep consistency through-out the guide. Fixes: https://github.com/nodejs/node/issues/26045 PR-URL: https://github.com/nodejs/node/pull/26050 Reviewed-By: Yuta Hiroto Reviewed-By: Rich Trott Reviewed-By: Anto Aravinth Reviewed-By: Masashi Hirano --- doc/guides/contributing/pull-requests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guides/contributing/pull-requests.md b/doc/guides/contributing/pull-requests.md index 0e324211ee9232..f90e74acbf7e03 100644 --- a/doc/guides/contributing/pull-requests.md +++ b/doc/guides/contributing/pull-requests.md @@ -301,7 +301,7 @@ changes that have landed in `master` by using `git rebase`: ```text $ git fetch --all -$ git rebase origin/master +$ git rebase upstream/master $ git push --force-with-lease origin my-branch ``` From ccf60bbad2f906838da07edc5685afef5ed8943f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 12 Feb 2019 16:44:42 -0800 Subject: [PATCH 215/223] assert: add internal assert.fail() PR-URL: https://github.com/nodejs/node/pull/26047 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Anto Aravinth Reviewed-By: James M Snell --- lib/internal/assert.js | 6 ++++++ test/parallel/test-internal-assert.js | 2 ++ 2 files changed, 8 insertions(+) diff --git a/lib/internal/assert.js b/lib/internal/assert.js index b5eb88c93b61db..e403fd4b60e06a 100644 --- a/lib/internal/assert.js +++ b/lib/internal/assert.js @@ -6,4 +6,10 @@ function assert(value, message) { } } +function fail(message) { + require('assert').fail(message); +} + +assert.fail = fail; + module.exports = assert; diff --git a/test/parallel/test-internal-assert.js b/test/parallel/test-internal-assert.js index b34657d3a67f84..4fd443864bdac7 100644 --- a/test/parallel/test-internal-assert.js +++ b/test/parallel/test-internal-assert.js @@ -13,3 +13,5 @@ internalAssert(true, 'fhqwhgads'); assert.throws(() => { internalAssert(false); }, assert.AssertionError); assert.throws(() => { internalAssert(false, 'fhqwhgads'); }, { code: 'ERR_ASSERTION', message: 'fhqwhgads' }); +assert.throws(() => { internalAssert.fail('fhqwhgads'); }, + { code: 'ERR_ASSERTION', message: 'fhqwhgads' }); From f87352366a9c3f507c7eb9699a29527348f57fec Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 11 Feb 2019 07:46:53 -0800 Subject: [PATCH 216/223] cluster: migrate round_robin_handle to internal assert Use smaller internal assert module for round_robin_handle.js. PR-URL: https://github.com/nodejs/node/pull/26047 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Anto Aravinth Reviewed-By: James M Snell --- lib/internal/cluster/round_robin_handle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/cluster/round_robin_handle.js b/lib/internal/cluster/round_robin_handle.js index 95f33ad1d09907..86c7bec7386ed7 100644 --- a/lib/internal/cluster/round_robin_handle.js +++ b/lib/internal/cluster/round_robin_handle.js @@ -1,5 +1,5 @@ 'use strict'; -const assert = require('assert'); +const assert = require('internal/assert'); const net = require('net'); const { sendHelper } = require('internal/cluster/utils'); const uv = internalBinding('uv'); From 32e6bb32b2e8f8c7cf44f7944d3aabc18b56c7b5 Mon Sep 17 00:00:00 2001 From: MaleDong Date: Mon, 11 Feb 2019 07:32:26 +0800 Subject: [PATCH 217/223] lib: merge 'undefined' into one 'break' branch We don't need to split this alone, but just merge it into the 'break' switch branch together. PR-URL: https://github.com/nodejs/node/pull/26039 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Minwoo Jung Reviewed-By: Anto Aravinth Reviewed-By: Gus Caplan Reviewed-By: Luigi Pinca Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- lib/internal/main/print_help.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/internal/main/print_help.js b/lib/internal/main/print_help.js index ca60994d942c6c..ef1cb9ce4bb880 100644 --- a/lib/internal/main/print_help.js +++ b/lib/internal/main/print_help.js @@ -65,6 +65,7 @@ function getArgDescription(type) { case 'kNoOp': case 'kV8Option': case 'kBoolean': + case undefined: break; case 'kHostPort': return '[host:]port'; @@ -73,8 +74,6 @@ function getArgDescription(type) { case 'kString': case 'kStringList': return '...'; - case undefined: - break; default: require('assert').fail(`unknown option type ${type}`); } From 64cc234a84cdabedd058ff8deee47cb04087c623 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sun, 10 Feb 2019 12:13:09 +0100 Subject: [PATCH 218/223] test: use emitter.listenerCount() in test-http-connect Use `emitter.listenerCount()` instead of the `length` property of the array returned by `emitter.listeners()`. PR-URL: https://github.com/nodejs/node/pull/26031 Reviewed-By: James M Snell Reviewed-By: Daniel Bevenius Reviewed-By: Anna Henningsen --- test/parallel/test-http-connect.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/parallel/test-http-connect.js b/test/parallel/test-http-connect.js index ec2c8846bbb134..6483c93dd70204 100644 --- a/test/parallel/test-http-connect.js +++ b/test/parallel/test-http-connect.js @@ -31,11 +31,11 @@ server.on('connect', common.mustCall((req, socket, firstBodyChunk) => { assert.strictEqual(req.url, 'google.com:443'); // Make sure this socket has detached. - assert.strictEqual(socket.listeners('close').length, 0); - assert.strictEqual(socket.listeners('drain').length, 0); - assert.strictEqual(socket.listeners('data').length, 0); - assert.strictEqual(socket.listeners('end').length, 1); - assert.strictEqual(socket.listeners('error').length, 0); + assert.strictEqual(socket.listenerCount('close'), 0); + assert.strictEqual(socket.listenerCount('drain'), 0); + assert.strictEqual(socket.listenerCount('data'), 0); + assert.strictEqual(socket.listenerCount('end'), 1); + assert.strictEqual(socket.listenerCount('error'), 0); socket.write('HTTP/1.1 200 Connection established\r\n\r\n'); @@ -72,14 +72,14 @@ server.listen(0, common.mustCall(() => { assert(!socket.ondata); assert(!socket.onend); assert.strictEqual(socket._httpMessage, null); - assert.strictEqual(socket.listeners('connect').length, 0); - assert.strictEqual(socket.listeners('data').length, 0); - assert.strictEqual(socket.listeners('drain').length, 0); - assert.strictEqual(socket.listeners('end').length, 1); - assert.strictEqual(socket.listeners('free').length, 0); - assert.strictEqual(socket.listeners('close').length, 0); - assert.strictEqual(socket.listeners('error').length, 0); - assert.strictEqual(socket.listeners('agentRemove').length, 0); + assert.strictEqual(socket.listenerCount('connect'), 0); + assert.strictEqual(socket.listenerCount('data'), 0); + assert.strictEqual(socket.listenerCount('drain'), 0); + assert.strictEqual(socket.listenerCount('end'), 1); + assert.strictEqual(socket.listenerCount('free'), 0); + assert.strictEqual(socket.listenerCount('close'), 0); + assert.strictEqual(socket.listenerCount('error'), 0); + assert.strictEqual(socket.listenerCount('agentRemove'), 0); let data = firstBodyChunk.toString(); socket.on('data', (buf) => { From cb86357d221409e177383af4c2946930bf8e7f4d Mon Sep 17 00:00:00 2001 From: Pushkal B Date: Sun, 10 Feb 2019 15:58:38 +0530 Subject: [PATCH 219/223] test: replaced anonymous fn with arrow syntax PR-URL: https://github.com/nodejs/node/pull/26029 Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell --- test/addons/async-hooks-id/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/addons/async-hooks-id/test.js b/test/addons/async-hooks-id/test.js index e6c3cf612cacd5..c6ce366c5de756 100644 --- a/test/addons/async-hooks-id/test.js +++ b/test/addons/async-hooks-id/test.js @@ -14,7 +14,7 @@ assert.strictEqual( async_hooks.triggerAsyncId() ); -process.nextTick(common.mustCall(function() { +process.nextTick(common.mustCall(() => { assert.strictEqual( binding.getExecutionAsyncId(), async_hooks.executionAsyncId() From f71d6762ca57af8973ca0e0af6b57b1202458258 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Thu, 7 Feb 2019 16:27:02 +0800 Subject: [PATCH 220/223] src: remove redundant cast in node_http2.h PR-URL: https://github.com/nodejs/node/pull/25978 Reviewed-By: Colin Ihrig Reviewed-By: Daniel Bevenius Reviewed-By: Sakthipriyan Vairamani Reviewed-By: James M Snell --- src/node_http2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_http2.h b/src/node_http2.h index 61858aecf60962..660a713d19e779 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -388,7 +388,7 @@ class Http2Options { } void SetPaddingStrategy(padding_strategy_type val) { - padding_strategy_ = static_cast(val); + padding_strategy_ = val; } padding_strategy_type GetPaddingStrategy() const { From 44fc2f6094e788ce43842e814dd3e90481613bf2 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Wed, 6 Feb 2019 15:37:40 -0800 Subject: [PATCH 221/223] doc: clarify effect of stream.destroy() on write() PR-URL: https://github.com/nodejs/node/pull/25973 Reviewed-By: Matteo Collina Reviewed-By: Daniel Bevenius --- doc/api/stream.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 9e20370528f200..14bc50d3107283 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -369,12 +369,17 @@ See also: [`writable.uncork()`][]. added: v8.0.0 --> -* `error` {Error} +* `error` {Error} Optional, an error to emit with `'error'` event. * Returns: {this} -Destroy the stream, and emit the passed `'error'` and a `'close'` event. +Destroy the stream. Optionally emit an `'error'` event, and always emit +a `'close'` event. After this call, the writable stream has ended and subsequent calls to `write()` or `end()` will result in an `ERR_STREAM_DESTROYED` error. +This is a destructive and immediate way to destroy a stream. Previous calls to +`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. +Use `end()` instead of destroy if data should flush before close, or wait for +the `'drain'` event before destroying the stream. Implementors should not override this method, but instead implement [`writable._destroy()`][writable-_destroy]. From 4a254a6ce4047bf38318adaaddc060afe5343948 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 11 Feb 2019 23:33:50 -0800 Subject: [PATCH 222/223] doc: edit N-API introductory material in Collaborator Guide Use shorter, clearer sentences. Remove passive voice and personal pronouns. PR-URL: https://github.com/nodejs/node/pull/26051 Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- COLLABORATOR_GUIDE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 12b990091491e8..aa1406a990b91f 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -312,9 +312,9 @@ For pull requests introducing new core modules: ### Additions to N-API -N-API provides an ABI stable API that we will have to support in future -versions without the usual option to modify or remove existing APIs on -SemVer boundaries. Therefore, additions need to be managed carefully. +N-API provides an ABI-stable API guaranteed for future Node.js versions. +Existing N-API APIs cannot change or disappear, even in semver-major releases. +Thus, N-API additions call for unusual care and scrutiny. This [guide](https://github.com/nodejs/node/blob/master/doc/guides/adding-new-napi-api.md) From 6e56771f2a9707ddf769358a4338224296a6b5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 14 Feb 2019 14:37:22 +0100 Subject: [PATCH 223/223] 2018-02-14, Version 11.10.0 (Current) Notable changes: deps: * Updated libuv to 1.26.0. * Updated npm to 6.7.0. http, http2: * `response.writeHead` now returns the response object. perf_hooks: * Implemented a histogram based API. process: * Exposed `process.features.inspector`. repl: * Added `repl.setupHistory` for programmatic repl. tls: * Introduced client "session" event. PR-URL: https://github.com/nodejs/node/pull/26098 --- CHANGELOG.md | 3 +- doc/api/http.md | 2 +- doc/api/http2.md | 2 +- doc/api/perf_hooks.md | 24 ++-- doc/api/repl.md | 2 +- doc/api/tls.md | 2 +- doc/changelogs/CHANGELOG_V11.md | 245 ++++++++++++++++++++++++++++++++ src/node_version.h | 6 +- 8 files changed, 266 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a96cee292c61f..a41aa8370acb7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,8 @@ release. -11.9.0
        +11.10.0
        +11.9.0
        11.8.0
        11.7.0
        11.6.0
        diff --git a/doc/api/http.md b/doc/api/http.md index 0f1d98b6d2aa5c..eefdf684cc22ea 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1444,7 +1444,7 @@ the request body should be sent. See the [`'checkContinue'`][] event on * `options` {Object} @@ -434,13 +434,13 @@ console.log(h.percentile(99)); ### Class: Histogram Tracks the event loop delay at a given sampling rate. #### histogram.disable() * Returns: {boolean} @@ -450,7 +450,7 @@ stopped, `false` if it was already stopped. #### histogram.enable() * Returns: {boolean} @@ -460,7 +460,7 @@ started, `false` if it was already started. #### histogram.exceeds * {number} @@ -470,7 +470,7 @@ loop delay threshold. #### histogram.max * {number} @@ -479,7 +479,7 @@ The maximum recorded event loop delay. #### histogram.mean * {number} @@ -488,7 +488,7 @@ The mean of the recorded event loop delays. #### histogram.min * {number} @@ -497,7 +497,7 @@ The minimum recorded event loop delay. #### histogram.percentile(percentile) * `percentile` {number} A percentile value between 1 and 100. @@ -507,7 +507,7 @@ Returns the value at the given percentile. #### histogram.percentiles * {Map} @@ -516,14 +516,14 @@ Returns a `Map` object detailing the accumulated percentile distribution. #### histogram.reset() Resets the collected histogram data. #### histogram.stddev * {number} diff --git a/doc/api/repl.md b/doc/api/repl.md index 4395193de20326..5a817348433790 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -450,7 +450,7 @@ Returns `true` if `keyword` is a valid keyword, otherwise `false`. ### replServer.setupHistory(historyPath, callback) * `historyPath` {string} the path to the history file diff --git a/doc/api/tls.md b/doc/api/tls.md index 0e8eb30cef0c41..35f95d6405696b 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -616,7 +616,7 @@ protocol. ### Event: 'session' * `session` {Buffer} diff --git a/doc/changelogs/CHANGELOG_V11.md b/doc/changelogs/CHANGELOG_V11.md index 8ca2ca3f658230..114e9e124cbcfe 100644 --- a/doc/changelogs/CHANGELOG_V11.md +++ b/doc/changelogs/CHANGELOG_V11.md @@ -9,6 +9,7 @@ +11.10.0
        11.9.0
        11.8.0
        11.7.0
        @@ -36,6 +37,250 @@ * [io.js](CHANGELOG_IOJS.md) * [Archive](CHANGELOG_ARCHIVE.md) + +## 2019-02-14, Version 11.10.0 (Current), @targos + +### Notable Changes + +**deps** + * Updated libuv to 1.26.0. [#26037](https://github.com/nodejs/node/pull/26037) + * Updated npm to 6.7.0. [#25804](https://github.com/nodejs/node/pull/25804) +**http, http2** + * `response.writeHead` now returns the response object. [#25974](https://github.com/nodejs/node/pull/25974) +**perf_hooks** + * Implemented a histogram based API. [#25378](https://github.com/nodejs/node/pull/25378) +**process** + * Exposed `process.features.inspector`. [#25819](https://github.com/nodejs/node/pull/25378) +**repl** + * Added `repl.setupHistory` for programmatic repl. [#25895](https://github.com/nodejs/node/pull/25895) +**tls** + * Introduced client "session" event. [#25831](https://github.com/nodejs/node/pull/25831) + +### Commits + +* [[`ccf60bbad2`](https://github.com/nodejs/node/commit/ccf60bbad2)] - **assert**: add internal assert.fail() (Rich Trott) [#26047](https://github.com/nodejs/node/pull/26047) +* [[`0b4055e616`](https://github.com/nodejs/node/commit/0b4055e616)] - **assert**: create internal/assert micro-module (Rich Trott) [#25956](https://github.com/nodejs/node/pull/25956) +* [[`37d207cc0c`](https://github.com/nodejs/node/commit/37d207cc0c)] - **assert**: refactor internal assert.js (Rich Trott) [#25956](https://github.com/nodejs/node/pull/25956) +* [[`2b1f88185f`](https://github.com/nodejs/node/commit/2b1f88185f)] - **benchmark**: remove unreachable return (ZYSzys) [#25883](https://github.com/nodejs/node/pull/25883) +* [[`c4d16e80b7`](https://github.com/nodejs/node/commit/c4d16e80b7)] - **benchmark**: refactor for consistent style (Rich Trott) [#25944](https://github.com/nodejs/node/pull/25944) +* [[`c4e2bbbcab`](https://github.com/nodejs/node/commit/c4e2bbbcab)] - **benchmark**: use consistent coding style in assert/\* (Rich Trott) [#25865](https://github.com/nodejs/node/pull/25865) +* [[`18b344c0d2`](https://github.com/nodejs/node/commit/18b344c0d2)] - **benchmark**: refactor benchmark/common.js (Rich Trott) [#25805](https://github.com/nodejs/node/pull/25805) +* [[`40398fd07a`](https://github.com/nodejs/node/commit/40398fd07a)] - **benchmark**: refactor \_http-benchmarkers.js (Rich Trott) [#25803](https://github.com/nodejs/node/pull/25803) +* [[`d5d163d8b9`](https://github.com/nodejs/node/commit/d5d163d8b9)] - **build**: export deprecated OpenSSL symbols on Windows (Richard Lau) [#25991](https://github.com/nodejs/node/pull/25991) +* [[`197efb7f84`](https://github.com/nodejs/node/commit/197efb7f84)] - **child_process**: close pipe ends that are re-piped (Gireesh Punathil) [#21209](https://github.com/nodejs/node/pull/21209) +* [[`f87352366a`](https://github.com/nodejs/node/commit/f87352366a)] - **cluster**: migrate round\_robin\_handle to internal assert (Rich Trott) [#26047](https://github.com/nodejs/node/pull/26047) +* [[`8c9800ce27`](https://github.com/nodejs/node/commit/8c9800ce27)] - **crypto**: include 'Buffer' in error output of Hash.update method (Amit Zur) [#25533](https://github.com/nodejs/node/pull/25533) +* [[`baa0865886`](https://github.com/nodejs/node/commit/baa0865886)] - **crypto**: don't crash X509ToObject on error (David Benjamin) [#25717](https://github.com/nodejs/node/pull/25717) +* [[`3e010aff83`](https://github.com/nodejs/node/commit/3e010aff83)] - **crypto**: fix malloc mixing in X509ToObject (David Benjamin) [#25717](https://github.com/nodejs/node/pull/25717) +* [[`da46be2542`](https://github.com/nodejs/node/commit/da46be2542)] - **crypto**: fix public key encoding name in comment (David Benjamin) [#25736](https://github.com/nodejs/node/pull/25736) +* [[`8b5a2c4f61`](https://github.com/nodejs/node/commit/8b5a2c4f61)] - **deps**: upgrade to libuv 1.26.0 (cjihrig) [#26037](https://github.com/nodejs/node/pull/26037) +* [[`1c5fbeab34`](https://github.com/nodejs/node/commit/1c5fbeab34)] - **deps**: upgrade npm to 6.7.0 (Kat Marchán) [#25804](https://github.com/nodejs/node/pull/25804) +* [[`3f8c22b4cb`](https://github.com/nodejs/node/commit/3f8c22b4cb)] - **deps**: update llhttp to 1.1.1 (Fedor Indutny) [#25753](https://github.com/nodejs/node/pull/25753) +* [[`823fd5b493`](https://github.com/nodejs/node/commit/823fd5b493)] - **(SEMVER-MINOR)** **deps**: float fix for building HdrHistogram on Win x86 (jasnell) [#25378](https://github.com/nodejs/node/pull/25378) +* [[`c01bbc5258`](https://github.com/nodejs/node/commit/c01bbc5258)] - **deps**: update acorn to 6.0.7 (Michaël Zasso) [#25844](https://github.com/nodejs/node/pull/25844) +* [[`a6c8e40655`](https://github.com/nodejs/node/commit/a6c8e40655)] - **deps**: patch to fix \*.onion MX query on c-ares (XadillaX) [#25840](https://github.com/nodejs/node/pull/25840) +* [[`8b71464711`](https://github.com/nodejs/node/commit/8b71464711)] - **deps**: remove OpenSSL git and travis configuration (Sam Roberts) [#25689](https://github.com/nodejs/node/pull/25689) +* [[`673e434714`](https://github.com/nodejs/node/commit/673e434714)] - **deps**: v8, cherry-pick 9365d09, aac2f8c, 47d34a3 (Benjamin Coe) [#25429](https://github.com/nodejs/node/pull/25429) +* [[`411f6fe832`](https://github.com/nodejs/node/commit/411f6fe832)] - **deps**: cherry-pick c736883 from upstream V8 (Yang Guo) +* [[`4a254a6ce4`](https://github.com/nodejs/node/commit/4a254a6ce4)] - **doc**: edit N-API introductory material in Collaborator Guide (Rich Trott) [#26051](https://github.com/nodejs/node/pull/26051) +* [[`44fc2f6094`](https://github.com/nodejs/node/commit/44fc2f6094)] - **doc**: clarify effect of stream.destroy() on write() (Sam Roberts) [#25973](https://github.com/nodejs/node/pull/25973) +* [[`21e6d353af`](https://github.com/nodejs/node/commit/21e6d353af)] - **doc**: renamed remote's name (Thang Tran) [#26050](https://github.com/nodejs/node/pull/26050) +* [[`e629afa6ae`](https://github.com/nodejs/node/commit/e629afa6ae)] - **doc**: fix minor typo in dgram.md (Daniel Bevenius) [#26055](https://github.com/nodejs/node/pull/26055) +* [[`663b6251a0`](https://github.com/nodejs/node/commit/663b6251a0)] - **doc**: fix some nits in perf\_hooks (Vse Mozhet Byt) [#26022](https://github.com/nodejs/node/pull/26022) +* [[`9420a737fe`](https://github.com/nodejs/node/commit/9420a737fe)] - **doc**: edit process.report related documentation (cjihrig) [#25983](https://github.com/nodejs/node/pull/25983) +* [[`eb4b5ea233`](https://github.com/nodejs/node/commit/eb4b5ea233)] - **doc**: clarify http timeouts (Andrew Moss) [#25748](https://github.com/nodejs/node/pull/25748) +* [[`a225f99ea8`](https://github.com/nodejs/node/commit/a225f99ea8)] - **doc**: revise Introducing New Modules (Rich Trott) [#25975](https://github.com/nodejs/node/pull/25975) +* [[`f516f68032`](https://github.com/nodejs/node/commit/f516f68032)] - **doc**: add a sentence about REPLACEME in code changes (Lance Ball) [#25961](https://github.com/nodejs/node/pull/25961) +* [[`3b74cc6c26`](https://github.com/nodejs/node/commit/3b74cc6c26)] - **doc**: revise Collaborator Guide on reverting (Rich Trott) [#25942](https://github.com/nodejs/node/pull/25942) +* [[`353de0f752`](https://github.com/nodejs/node/commit/353de0f752)] - **doc**: fix err\_synthetic issue on v11.x (sreepurnajasti) [#25770](https://github.com/nodejs/node/pull/25770) +* [[`cc4ae20d20`](https://github.com/nodejs/node/commit/cc4ae20d20)] - **doc**: improve doc on unintended breaking changes (Rich Trott) [#25887](https://github.com/nodejs/node/pull/25887) +* [[`1f6acbb279`](https://github.com/nodejs/node/commit/1f6acbb279)] - **doc**: document os.userInfo() throwing SystemError (Raido Kuli) [#25724](https://github.com/nodejs/node/pull/25724) +* [[`699d161f9e`](https://github.com/nodejs/node/commit/699d161f9e)] - **doc**: fix machine field in example report (cjihrig) [#25855](https://github.com/nodejs/node/pull/25855) +* [[`618f641271`](https://github.com/nodejs/node/commit/618f641271)] - **doc**: remove redundant LTS/Current information in Collaborator Guide (Rich Trott) [#25842](https://github.com/nodejs/node/pull/25842) +* [[`7a1f166cfa`](https://github.com/nodejs/node/commit/7a1f166cfa)] - **doc**: add documentation for request.path (Kei Ito) [#25788](https://github.com/nodejs/node/pull/25788) +* [[`f5db5090bc`](https://github.com/nodejs/node/commit/f5db5090bc)] - **doc**: remove outdated COLLABORATOR\_GUIDE sentence about breaking changes (Rich Trott) [#25780](https://github.com/nodejs/node/pull/25780) +* [[`accb8aec35`](https://github.com/nodejs/node/commit/accb8aec35)] - **doc**: revise inspect security info in cli.md (Rich Trott) [#25779](https://github.com/nodejs/node/pull/25779) +* [[`fd98d62909`](https://github.com/nodejs/node/commit/fd98d62909)] - **doc**: revise style guide (Rich Trott) [#25778](https://github.com/nodejs/node/pull/25778) +* [[`60c5099f4b`](https://github.com/nodejs/node/commit/60c5099f4b)] - **domain**: avoid circular memory references (Anna Henningsen) [#25993](https://github.com/nodejs/node/pull/25993) +* [[`2b48a381b9`](https://github.com/nodejs/node/commit/2b48a381b9)] - **fs**: remove redundant callback check (ZYSzys) [#25160](https://github.com/nodejs/node/pull/25160) +* [[`29c195e17f`](https://github.com/nodejs/node/commit/29c195e17f)] - **fs**: remove useless internalFS (ZYSzys) [#25161](https://github.com/nodejs/node/pull/25161) +* [[`51982978eb`](https://github.com/nodejs/node/commit/51982978eb)] - **http**: improve performance for incoming headers (Weijia Wang) [#26041](https://github.com/nodejs/node/pull/26041) +* [[`90c9f1d323`](https://github.com/nodejs/node/commit/90c9f1d323)] - **http**: reduce multiple output arrays into one (Weijia Wang) [#26004](https://github.com/nodejs/node/pull/26004) +* [[`a5247cc180`](https://github.com/nodejs/node/commit/a5247cc180)] - **(SEMVER-MINOR)** **http**: makes response.writeHead return the response (Mark S. Everitt) [#25974](https://github.com/nodejs/node/pull/25974) +* [[`b7fb49e70a`](https://github.com/nodejs/node/commit/b7fb49e70a)] - **http**: remove redundant call to socket.setTimeout() (Luigi Pinca) [#25928](https://github.com/nodejs/node/pull/25928) +* [[`25c19eb1d8`](https://github.com/nodejs/node/commit/25c19eb1d8)] - **http**: make timeout event work with agent timeout (Luigi Pinca) [#25488](https://github.com/nodejs/node/pull/25488) +* [[`0899c8bb32`](https://github.com/nodejs/node/commit/0899c8bb32)] - **http2**: improve compat performance (Matteo Collina) [#25567](https://github.com/nodejs/node/pull/25567) +* [[`237b5e65e4`](https://github.com/nodejs/node/commit/237b5e65e4)] - **(SEMVER-MINOR)** **http2**: makes response.writeHead return the response (Mark S. Everitt) [#25974](https://github.com/nodejs/node/pull/25974) +* [[`6967407b19`](https://github.com/nodejs/node/commit/6967407b19)] - **inspector, trace_events**: make sure messages are sent on a main thread (Eugene Ostroukhov) [#24814](https://github.com/nodejs/node/pull/24814) +* [[`d02ad40d42`](https://github.com/nodejs/node/commit/d02ad40d42)] - **inspector,vm**: remove --eval wrapper (Anna Henningsen) [#25832](https://github.com/nodejs/node/pull/25832) +* [[`32e6bb32b2`](https://github.com/nodejs/node/commit/32e6bb32b2)] - **lib**: merge 'undefined' into one 'break' branch (MaleDong) [#26039](https://github.com/nodejs/node/pull/26039) +* [[`b2b37c631a`](https://github.com/nodejs/node/commit/b2b37c631a)] - **lib**: simplify 'umask' (MaleDong) [#26035](https://github.com/nodejs/node/pull/26035) +* [[`b1a8927adc`](https://github.com/nodejs/node/commit/b1a8927adc)] - **lib**: fix the typo error (MaleDong) [#26032](https://github.com/nodejs/node/pull/26032) +* [[`d5f4a1f2ac`](https://github.com/nodejs/node/commit/d5f4a1f2ac)] - **lib**: save a copy of Symbol in primordials (Joyee Cheung) [#26033](https://github.com/nodejs/node/pull/26033) +* [[`bd932a347e`](https://github.com/nodejs/node/commit/bd932a347e)] - **lib**: move per\_context.js under lib/internal/bootstrap (Joyee Cheung) [#26033](https://github.com/nodejs/node/pull/26033) +* [[`f40e0fcdcb`](https://github.com/nodejs/node/commit/f40e0fcdcb)] - **lib**: replace 'assert' with 'internal/assert' for many built-ins (Rich Trott) [#25956](https://github.com/nodejs/node/pull/25956) +* [[`8ade433f51`](https://github.com/nodejs/node/commit/8ade433f51)] - **lib**: move signal event handling into bootstrap/node.js (Joyee Cheung) [#25859](https://github.com/nodejs/node/pull/25859) +* [[`92ca50636c`](https://github.com/nodejs/node/commit/92ca50636c)] - **lib**: save primordials during bootstrap and use it in builtins (Joyee Cheung) [#25816](https://github.com/nodejs/node/pull/25816) +* [[`1b8d2ca85f`](https://github.com/nodejs/node/commit/1b8d2ca85f)] - **lib**: remove dollar symbol for private function (MaleDong) [#25590](https://github.com/nodejs/node/pull/25590) +* [[`b06f2fafe7`](https://github.com/nodejs/node/commit/b06f2fafe7)] - **lib**: use `internal/options` to query `--abort-on-uncaught-exception` (Joyee Cheung) [#25862](https://github.com/nodejs/node/pull/25862) +* [[`0b302e4520`](https://github.com/nodejs/node/commit/0b302e4520)] - **lib**: fix a few minor issues flagged by lgtm (Robin Neatherway) [#25873](https://github.com/nodejs/node/pull/25873) +* [[`99bc0df74c`](https://github.com/nodejs/node/commit/99bc0df74c)] - **lib**: refactor ERR\_SYNTHETIC (cjihrig) [#25749](https://github.com/nodejs/node/pull/25749) +* [[`1c6fadea31`](https://github.com/nodejs/node/commit/1c6fadea31)] - **meta**: clarify EoL platform support (João Reis) [#25838](https://github.com/nodejs/node/pull/25838) +* [[`03ffcf76b7`](https://github.com/nodejs/node/commit/03ffcf76b7)] - **n-api**: finalize during second-pass callback (Gabriel Schulhof) [#25992](https://github.com/nodejs/node/pull/25992) +* [[`5f6a710d8d`](https://github.com/nodejs/node/commit/5f6a710d8d)] - **os,report**: use UV\_MAXHOSTNAMESIZE (cjihrig) [#26038](https://github.com/nodejs/node/pull/26038) +* [[`2cbb7a85db`](https://github.com/nodejs/node/commit/2cbb7a85db)] - **(SEMVER-MINOR)** **perf_hooks**: implement histogram based api (James M Snell) [#25378](https://github.com/nodejs/node/pull/25378) +* [[`e81c6c81de`](https://github.com/nodejs/node/commit/e81c6c81de)] - **perf_hooks**: only enable GC tracking when it's requested (Joyee Cheung) [#25853](https://github.com/nodejs/node/pull/25853) +* [[`9d6291ad46`](https://github.com/nodejs/node/commit/9d6291ad46)] - **process**: refactor lib/internal/bootstrap/node.js (Joyee Cheung) [#26033](https://github.com/nodejs/node/pull/26033) +* [[`8d3eb47d48`](https://github.com/nodejs/node/commit/8d3eb47d48)] - **process**: use primordials in bootstrap/node.js (Joyee Cheung) [#26033](https://github.com/nodejs/node/pull/26033) +* [[`85bc64a5c9`](https://github.com/nodejs/node/commit/85bc64a5c9)] - **process**: document the bootstrap process in node.js (Joyee Cheung) [#26033](https://github.com/nodejs/node/pull/26033) +* [[`ae21fca36b`](https://github.com/nodejs/node/commit/ae21fca36b)] - **process**: normalize process.execPath in CreateProcessObject() (Joyee Cheung) [#26002](https://github.com/nodejs/node/pull/26002) +* [[`614bb9f3c8`](https://github.com/nodejs/node/commit/614bb9f3c8)] - **process**: normalize process.argv before user code execution (Joyee Cheung) [#26000](https://github.com/nodejs/node/pull/26000) +* [[`9a7e883b83`](https://github.com/nodejs/node/commit/9a7e883b83)] - **process**: group main thread execution preparation code (Joyee Cheung) [#26000](https://github.com/nodejs/node/pull/26000) +* [[`d7bf070652`](https://github.com/nodejs/node/commit/d7bf070652)] - **process**: move deprecation warning initialization into pre\_execution.js (Joyee Cheung) [#25825](https://github.com/nodejs/node/pull/25825) +* [[`d7ed125fd1`](https://github.com/nodejs/node/commit/d7ed125fd1)] - **process**: stub unsupported worker methods (cjihrig) [#25587](https://github.com/nodejs/node/pull/25587) +* [[`c8bf4327d8`](https://github.com/nodejs/node/commit/c8bf4327d8)] - **process**: move process mutation into bootstrap/node.js (Joyee Cheung) [#25821](https://github.com/nodejs/node/pull/25821) +* [[`1d76ba1b3d`](https://github.com/nodejs/node/commit/1d76ba1b3d)] - **(SEMVER-MINOR)** **process**: expose process.features.inspector (Joyee Cheung) [#25819](https://github.com/nodejs/node/pull/25819) +* [[`e6a4fb6d01`](https://github.com/nodejs/node/commit/e6a4fb6d01)] - **process**: split execution into main scripts (Joyee Cheung) [#25667](https://github.com/nodejs/node/pull/25667) +* [[`f4cfbf4c9e`](https://github.com/nodejs/node/commit/f4cfbf4c9e)] - **process**: move setup of process warnings into node.js (Anto Aravinth) [#25263](https://github.com/nodejs/node/pull/25263) +* [[`cc253b5f2d`](https://github.com/nodejs/node/commit/cc253b5f2d)] - **process**: simplify report uncaught exception logic (cjihrig) [#25744](https://github.com/nodejs/node/pull/25744) +* [[`4c22d6eaa1`](https://github.com/nodejs/node/commit/4c22d6eaa1)] - **(SEMVER-MINOR)** **repl**: add repl.setupHistory for programmatic repl (Lance Ball) [#25895](https://github.com/nodejs/node/pull/25895) +* [[`2c737a89d5`](https://github.com/nodejs/node/commit/2c737a89d5)] - **repl**: remove obsolete buffer clearing (Ruben Bridgewater) [#25731](https://github.com/nodejs/node/pull/25731) +* [[`5aaeb01655`](https://github.com/nodejs/node/commit/5aaeb01655)] - **repl**: fix eval return value (Ruben Bridgewater) [#25731](https://github.com/nodejs/node/pull/25731) +* [[`e66cb58a9b`](https://github.com/nodejs/node/commit/e66cb58a9b)] - **repl**: simplify and improve completion (Ruben Bridgewater) [#25731](https://github.com/nodejs/node/pull/25731) +* [[`dfd47aa1e8`](https://github.com/nodejs/node/commit/dfd47aa1e8)] - **report**: make more items programmatically accessible (Anna Henningsen) [#26019](https://github.com/nodejs/node/pull/26019) +* [[`88019b051c`](https://github.com/nodejs/node/commit/88019b051c)] - **report**: rename setDiagnosticReportOptions() (cjihrig) [#25990](https://github.com/nodejs/node/pull/25990) +* [[`c8ceece815`](https://github.com/nodejs/node/commit/c8ceece815)] - **report**: refactor report option validation (cjihrig) [#25990](https://github.com/nodejs/node/pull/25990) +* [[`afb2d17c16`](https://github.com/nodejs/node/commit/afb2d17c16)] - **report**: use uv\_getnameinfo() for socket endpoints (cjihrig) [#25962](https://github.com/nodejs/node/pull/25962) +* [[`3f400310bd`](https://github.com/nodejs/node/commit/3f400310bd)] - **report**: widen scope of #ifndef (cjihrig) [#25960](https://github.com/nodejs/node/pull/25960) +* [[`8494a61d79`](https://github.com/nodejs/node/commit/8494a61d79)] - **report**: remove unnecessary case block scopes (cjihrig) [#25960](https://github.com/nodejs/node/pull/25960) +* [[`7443288c68`](https://github.com/nodejs/node/commit/7443288c68)] - **report**: remove empty string stream insertion (cjihrig) [#25960](https://github.com/nodejs/node/pull/25960) +* [[`6c51ec3014`](https://github.com/nodejs/node/commit/6c51ec3014)] - **report**: include information about event loop itself (Anna Henningsen) [#25906](https://github.com/nodejs/node/pull/25906) +* [[`30a4e8900a`](https://github.com/nodejs/node/commit/30a4e8900a)] - **report**: print libuv handle addresses as hex (cjihrig) [#25910](https://github.com/nodejs/node/pull/25910) +* [[`6d39a54354`](https://github.com/nodejs/node/commit/6d39a54354)] - **report**: use libuv calls for OS and machine info (cjihrig) [#25900](https://github.com/nodejs/node/pull/25900) +* [[`1007416596`](https://github.com/nodejs/node/commit/1007416596)] - **report**: separate release metadata (Richard Lau) [#25826](https://github.com/nodejs/node/pull/25826) +* [[`b1e0c43abd`](https://github.com/nodejs/node/commit/b1e0c43abd)] - **report**: disambiguate glibc versions (cjihrig) [#25781](https://github.com/nodejs/node/pull/25781) +* [[`f6c8820b46`](https://github.com/nodejs/node/commit/f6c8820b46)] - **report**: fix typo in error message (cjihrig) [#25782](https://github.com/nodejs/node/pull/25782) +* [[`d4631816ef`](https://github.com/nodejs/node/commit/d4631816ef)] - **report**: use consistent format for dumpEventTime (Anna Henningsen) [#25751](https://github.com/nodejs/node/pull/25751) +* [[`cc22fd7be9`](https://github.com/nodejs/node/commit/cc22fd7be9)] - **report**: split up osVersion and machine values (cjihrig) [#25755](https://github.com/nodejs/node/pull/25755) +* [[`f71d6762ca`](https://github.com/nodejs/node/commit/f71d6762ca)] - **src**: remove redundant cast in node\_http2.h (gengjiawen) [#25978](https://github.com/nodejs/node/pull/25978) +* [[`adaa2ae70b`](https://github.com/nodejs/node/commit/adaa2ae70b)] - **src**: add lock to inspector `MainThreadHandle` dtor (Anna Henningsen) [#26010](https://github.com/nodejs/node/pull/26010) +* [[`731c2731d2`](https://github.com/nodejs/node/commit/731c2731d2)] - **src**: add WeakReference utility (Anna Henningsen) [#25993](https://github.com/nodejs/node/pull/25993) +* [[`7ab34ae421`](https://github.com/nodejs/node/commit/7ab34ae421)] - **src**: remove unused method in class Http2Stream (gengjiawen) [#25979](https://github.com/nodejs/node/pull/25979) +* [[`d7ae1054ef`](https://github.com/nodejs/node/commit/d7ae1054ef)] - **src**: remove redundant cast in node\_file.cc (gengjiawen) [#25977](https://github.com/nodejs/node/pull/25977) +* [[`6c6e678eaa`](https://github.com/nodejs/node/commit/6c6e678eaa)] - **src**: remove unused class in node\_errors.h (gengjiawen) [#25980](https://github.com/nodejs/node/pull/25980) +* [[`24d9e9c8b6`](https://github.com/nodejs/node/commit/24d9e9c8b6)] - **src**: remove redundant void (gengjiawen) [#26003](https://github.com/nodejs/node/pull/26003) +* [[`5de103430f`](https://github.com/nodejs/node/commit/5de103430f)] - **src**: use NULL check macros to check nullptr (ZYSzys) [#25916](https://github.com/nodejs/node/pull/25916) +* [[`c47eb932bc`](https://github.com/nodejs/node/commit/c47eb932bc)] - **src**: move process.reallyExit impl into node\_process\_methods.cc (Joyee Cheung) [#25860](https://github.com/nodejs/node/pull/25860) +* [[`01bb7b7559`](https://github.com/nodejs/node/commit/01bb7b7559)] - **src**: split ownsProcessState off isMainThread (Anna Henningsen) [#25881](https://github.com/nodejs/node/pull/25881) +* [[`fd6ce533aa`](https://github.com/nodejs/node/commit/fd6ce533aa)] - **src**: remove main\_isolate (Anna Henningsen) [#25823](https://github.com/nodejs/node/pull/25823) +* [[`b72ec23201`](https://github.com/nodejs/node/commit/b72ec23201)] - **src**: move public C++ APIs into src/api/\*.cc (Joyee Cheung) [#25541](https://github.com/nodejs/node/pull/25541) +* [[`0a154ff7ad`](https://github.com/nodejs/node/commit/0a154ff7ad)] - **src**: move v8\_platform implementation into node\_v8\_platform-inl.h (Joyee Cheung) [#25541](https://github.com/nodejs/node/pull/25541) +* [[`d342707fa7`](https://github.com/nodejs/node/commit/d342707fa7)] - **src**: remove unused `internalBinding('config')` properties (Joyee Cheung) [#25463](https://github.com/nodejs/node/pull/25463) +* [[`756558617e`](https://github.com/nodejs/node/commit/756558617e)] - **src**: pass cli options to bootstrap/loaders.js lexically (Joyee Cheung) [#25463](https://github.com/nodejs/node/pull/25463) +* [[`85d5f67efe`](https://github.com/nodejs/node/commit/85d5f67efe)] - **src**: fix return type in Hash (gengjiawen) [#25936](https://github.com/nodejs/node/pull/25936) +* [[`779a5773cf`](https://github.com/nodejs/node/commit/779a5773cf)] - **src**: refactor macro to std::min in node\_buffer.cc (gengjiawen) [#25919](https://github.com/nodejs/node/pull/25919) +* [[`76687dedce`](https://github.com/nodejs/node/commit/76687dedce)] - **src**: remove unused variable (cjihrig) [#25481](https://github.com/nodejs/node/pull/25481) +* [[`b280d90279`](https://github.com/nodejs/node/commit/b280d90279)] - **src**: simplify NativeModule caching and remove redundant data (Joyee Cheung) [#25352](https://github.com/nodejs/node/pull/25352) +* [[`469cdacd59`](https://github.com/nodejs/node/commit/469cdacd59)] - **src**: pass along errors from StreamBase req obj creations (Anna Henningsen) [#25822](https://github.com/nodejs/node/pull/25822) +* [[`d6f3b8785f`](https://github.com/nodejs/node/commit/d6f3b8785f)] - **src**: pass along errors from fs object creations (Anna Henningsen) [#25822](https://github.com/nodejs/node/pull/25822) +* [[`0672c24dc3`](https://github.com/nodejs/node/commit/0672c24dc3)] - **src**: pass along errors from http2 object creation (Anna Henningsen) [#25822](https://github.com/nodejs/node/pull/25822) +* [[`e3fd7520d0`](https://github.com/nodejs/node/commit/e3fd7520d0)] - **src**: pass along errors from tls object creation (Anna Henningsen) [#25822](https://github.com/nodejs/node/pull/25822) +* [[`e0af205c98`](https://github.com/nodejs/node/commit/e0af205c98)] - **src**: nullcheck on trace controller (Gireesh Punathil) [#25943](https://github.com/nodejs/node/pull/25943) +* [[`c72c4b041d`](https://github.com/nodejs/node/commit/c72c4b041d)] - **src**: allow --perf-prof-unwinding-info in NODE\_OPTIONS (Tom Gallacher) [#25565](https://github.com/nodejs/node/pull/25565) +* [[`e6a2548807`](https://github.com/nodejs/node/commit/e6a2548807)] - **src**: allow --perf-basic-prof-only-functions in NODE\_OPTIONS (Tom Gallacher) [#25565](https://github.com/nodejs/node/pull/25565) +* [[`7cf484c656`](https://github.com/nodejs/node/commit/7cf484c656)] - **src**: refactor SSLError case statement (Sam Roberts) [#25861](https://github.com/nodejs/node/pull/25861) +* [[`55a313bb31`](https://github.com/nodejs/node/commit/55a313bb31)] - **src**: make watchdog async callback a lambda (Gireesh Punathil) [#25945](https://github.com/nodejs/node/pull/25945) +* [[`de9f37d314`](https://github.com/nodejs/node/commit/de9f37d314)] - **src**: make deleted function public in agent.h (gengjiawen) [#25909](https://github.com/nodejs/node/pull/25909) +* [[`620d429343`](https://github.com/nodejs/node/commit/620d429343)] - **src**: use bool instead of integer literal in connection\_wrap.cc (gengjiawen) [#25923](https://github.com/nodejs/node/pull/25923) +* [[`8cedfb8196`](https://github.com/nodejs/node/commit/8cedfb8196)] - **src**: refactor to nullptr in cpp code (gengjiawen) [#25888](https://github.com/nodejs/node/pull/25888) +* [[`f5d50342b0`](https://github.com/nodejs/node/commit/f5d50342b0)] - **src**: clean unused code in agent.h (gengjiawen) [#25914](https://github.com/nodejs/node/pull/25914) +* [[`2d575044ff`](https://github.com/nodejs/node/commit/2d575044ff)] - **src**: fix compiler warnings in node\_buffer.cc (Daniel Bevenius) [#25665](https://github.com/nodejs/node/pull/25665) +* [[`015ed0b1d7`](https://github.com/nodejs/node/commit/015ed0b1d7)] - **src**: remove redundant method in node\_worker.h (gengjiawen) [#25849](https://github.com/nodejs/node/pull/25849) +* [[`44655e93dd`](https://github.com/nodejs/node/commit/44655e93dd)] - **src**: delete unreachable code in node\_perf.h (gengjiawen) [#25850](https://github.com/nodejs/node/pull/25850) +* [[`5a66e380ff`](https://github.com/nodejs/node/commit/5a66e380ff)] - **src**: fix data type in node\_crypto.cc (gengjiawen) [#25889](https://github.com/nodejs/node/pull/25889) +* [[`d4c4f77d31`](https://github.com/nodejs/node/commit/d4c4f77d31)] - **src**: const\_cast is necessary for 1.1.1, not 0.9.7 (Sam Roberts) [#25861](https://github.com/nodejs/node/pull/25861) +* [[`b5a8376ffe`](https://github.com/nodejs/node/commit/b5a8376ffe)] - **src**: organize TLSWrap declarations by parent (Sam Roberts) [#25861](https://github.com/nodejs/node/pull/25861) +* [[`0772ce35fb`](https://github.com/nodejs/node/commit/0772ce35fb)] - **src**: remove unused TLWrap::EnableTrace() (Sam Roberts) [#25861](https://github.com/nodejs/node/pull/25861) +* [[`703549665e`](https://github.com/nodejs/node/commit/703549665e)] - **src**: add PrintLibuvHandleInformation debug helper (Anna Henningsen) [#25905](https://github.com/nodejs/node/pull/25905) +* [[`2e80b912ef`](https://github.com/nodejs/node/commit/2e80b912ef)] - **src**: use `visibility("default")` exports on POSIX (Jeremy Apthorp) [#25893](https://github.com/nodejs/node/pull/25893) +* [[`e28d891788`](https://github.com/nodejs/node/commit/e28d891788)] - **src**: fix race condition in `\~NodeTraceBuffer` (Anna Henningsen) [#25896](https://github.com/nodejs/node/pull/25896) +* [[`bd771d90fd`](https://github.com/nodejs/node/commit/bd771d90fd)] - **src**: remove unimplemented method in node\_http2.h (gengjiawen) [#25732](https://github.com/nodejs/node/pull/25732) +* [[`00f8e86702`](https://github.com/nodejs/node/commit/00f8e86702)] - **src**: use nullptr in node\_buffer.cc (gengjiawen) [#25820](https://github.com/nodejs/node/pull/25820) +* [[`84358b5010`](https://github.com/nodejs/node/commit/84358b5010)] - **src**: handle errors while printing error objects (Anna Henningsen) [#25834](https://github.com/nodejs/node/pull/25834) +* [[`f027290542`](https://github.com/nodejs/node/commit/f027290542)] - **src**: use struct as arguments to node::Assert (Anna Henningsen) [#25869](https://github.com/nodejs/node/pull/25869) +* [[`8a8c17880e`](https://github.com/nodejs/node/commit/8a8c17880e)] - **src**: remove unused AsyncResource constructor in node.h (gengjiawen) [#25793](https://github.com/nodejs/node/pull/25793) +* [[`7556994d83`](https://github.com/nodejs/node/commit/7556994d83)] - **src**: remove unused method in js\_stream.h (gengjiawen) [#25790](https://github.com/nodejs/node/pull/25790) +* [[`882902c672`](https://github.com/nodejs/node/commit/882902c672)] - **src**: pass along errors from PromiseWrap instantiation (Anna Henningsen) [#25837](https://github.com/nodejs/node/pull/25837) +* [[`998cea567f`](https://github.com/nodejs/node/commit/998cea567f)] - **src**: workaround MSVC compiler bug (Refael Ackermann) [#25596](https://github.com/nodejs/node/pull/25596) +* [[`b779c072d0`](https://github.com/nodejs/node/commit/b779c072d0)] - **src**: make `StreamPipe::Unpipe()` more resilient (Anna Henningsen) [#25716](https://github.com/nodejs/node/pull/25716) +* [[`0b014d5299`](https://github.com/nodejs/node/commit/0b014d5299)] - **src**: make deleted functions public in node.h (gengjiawen) [#25764](https://github.com/nodejs/node/pull/25764) +* [[`be499c3c7b`](https://github.com/nodejs/node/commit/be499c3c7b)] - **src**: simplify SlicedArguments (Anna Henningsen) [#25745](https://github.com/nodejs/node/pull/25745) +* [[`35454e0008`](https://github.com/nodejs/node/commit/35454e0008)] - **src**: fix indentation in a few node\_http2 enums (Daniel Bevenius) [#25761](https://github.com/nodejs/node/pull/25761) +* [[`3f080d12f4`](https://github.com/nodejs/node/commit/3f080d12f4)] - **src**: add debug check for inspector uv\_async\_t (Anna Henningsen) [#25777](https://github.com/nodejs/node/pull/25777) +* [[`0949039d26`](https://github.com/nodejs/node/commit/0949039d26)] - **src**: add handle scope to `OnFatalError()` (Anna Henningsen) [#25775](https://github.com/nodejs/node/pull/25775) +* [[`d9c2690705`](https://github.com/nodejs/node/commit/d9c2690705)] - **src**: turn ROUND\_UP into an inline function (Anna Henningsen) [#25743](https://github.com/nodejs/node/pull/25743) +* [[`3cd134cec4`](https://github.com/nodejs/node/commit/3cd134cec4)] - **src,lib**: remove dead `process.binding()` code (Anna Henningsen) [#25829](https://github.com/nodejs/node/pull/25829) +* [[`cb86357d22`](https://github.com/nodejs/node/commit/cb86357d22)] - **test**: replaced anonymous fn with arrow syntax (Pushkal B) [#26029](https://github.com/nodejs/node/pull/26029) +* [[`64cc234a84`](https://github.com/nodejs/node/commit/64cc234a84)] - **test**: use emitter.listenerCount() in test-http-connect (Luigi Pinca) [#26031](https://github.com/nodejs/node/pull/26031) +* [[`6323a9fc57`](https://github.com/nodejs/node/commit/6323a9fc57)] - **test**: refactor two http client timeout tests (Luigi Pinca) [#25473](https://github.com/nodejs/node/pull/25473) +* [[`61330b2f84`](https://github.com/nodejs/node/commit/61330b2f84)] - **test**: add assert test for position indicator (Rich Trott) [#26024](https://github.com/nodejs/node/pull/26024) +* [[`896962fd08`](https://github.com/nodejs/node/commit/896962fd08)] - **test**: add `Worker` + `--prof` regression test (Anna Henningsen) [#26011](https://github.com/nodejs/node/pull/26011) +* [[`3eb6f6130a`](https://github.com/nodejs/node/commit/3eb6f6130a)] - **test**: capture stderr from child processes (Gireesh Punathil) [#26007](https://github.com/nodejs/node/pull/26007) +* [[`d123f944a2`](https://github.com/nodejs/node/commit/d123f944a2)] - **test**: remove extraneous report validation argument (cjihrig) [#25986](https://github.com/nodejs/node/pull/25986) +* [[`de587bae8a`](https://github.com/nodejs/node/commit/de587bae8a)] - **test**: refactor to block-scope (LakshmiSwethaG) [#25532](https://github.com/nodejs/node/pull/25532) +* [[`4dca3ab23d`](https://github.com/nodejs/node/commit/4dca3ab23d)] - **test**: exit sequence sanity tests (Gireesh Punathil) [#25085](https://github.com/nodejs/node/pull/25085) +* [[`ef9139e5a0`](https://github.com/nodejs/node/commit/ef9139e5a0)] - **test**: end tls gracefully, rather than destroy (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`7e9f5ea295`](https://github.com/nodejs/node/commit/7e9f5ea295)] - **test**: pin regression test for #8074 to TLS 1.2 (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`1b9a608dca`](https://github.com/nodejs/node/commit/1b9a608dca)] - **test**: refactor test-http-agent-timeout-option (Luigi Pinca) [#25886](https://github.com/nodejs/node/pull/25886) +* [[`c457d007cd`](https://github.com/nodejs/node/commit/c457d007cd)] - **test**: clarify confusion over "client" in comment (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`1be867685c`](https://github.com/nodejs/node/commit/1be867685c)] - **test**: use mustCall(), not global state checks (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`50d2c8e945`](https://github.com/nodejs/node/commit/50d2c8e945)] - **test**: use common.mustCall(), and log the events (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`1b542e8ba0`](https://github.com/nodejs/node/commit/1b542e8ba0)] - **test**: use mustCall in ephemeralkeyinfo test (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`898cf782f8`](https://github.com/nodejs/node/commit/898cf782f8)] - **test**: send a bad record only after connection done (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`ace267b21c`](https://github.com/nodejs/node/commit/ace267b21c)] - **test**: do not race connection and rejection (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`639dc07ca0`](https://github.com/nodejs/node/commit/639dc07ca0)] - **test**: do not assume tls handshake order (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`cc6b30f4b7`](https://github.com/nodejs/node/commit/cc6b30f4b7)] - **test**: do not assume server gets secure connection (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`c17a37d95a`](https://github.com/nodejs/node/commit/c17a37d95a)] - **test**: wait for TCP connect, not TLS handshake (Sam Roberts) [#25508](https://github.com/nodejs/node/pull/25508) +* [[`1f8991fae6`](https://github.com/nodejs/node/commit/1f8991fae6)] - **test**: add util.isDeepStrictEqual edge case tests (Rich Trott) [#25932](https://github.com/nodejs/node/pull/25932) +* [[`baa10aeb75`](https://github.com/nodejs/node/commit/baa10aeb75)] - **test**: add BigInt test for isDeepStrictEqual (Rich Trott) [#25932](https://github.com/nodejs/node/pull/25932) +* [[`c866b52942`](https://github.com/nodejs/node/commit/c866b52942)] - **test**: remove obsolete code (Ruben Bridgewater) [#25731](https://github.com/nodejs/node/pull/25731) +* [[`ee3165d6e7`](https://github.com/nodejs/node/commit/ee3165d6e7)] - **test**: relax expectations in test-icu-transcode (Yang Guo) [#25866](https://github.com/nodejs/node/pull/25866) +* [[`025a7c3e31`](https://github.com/nodejs/node/commit/025a7c3e31)] - **test**: do not fail SLOW tests if they are not slow (Yang Guo) [#25868](https://github.com/nodejs/node/pull/25868) +* [[`059d30e369`](https://github.com/nodejs/node/commit/059d30e369)] - **test**: add hasCrypto to worker-cleanexit-with-moduleload (Daniel Bevenius) [#25811](https://github.com/nodejs/node/pull/25811) +* [[`7cb943937f`](https://github.com/nodejs/node/commit/7cb943937f)] - **test**: refactor test-http-agent-timeout-option (Luigi Pinca) [#25854](https://github.com/nodejs/node/pull/25854) +* [[`cdf3e84804`](https://github.com/nodejs/node/commit/cdf3e84804)] - **test**: exclude additional test for coverage (Michael Dawson) [#25833](https://github.com/nodejs/node/pull/25833) +* [[`704a440d52`](https://github.com/nodejs/node/commit/704a440d52)] - **test**: allow coverage threshold to be enforced (Benjamin Coe) [#25675](https://github.com/nodejs/node/pull/25675) +* [[`5bffcf6246`](https://github.com/nodejs/node/commit/5bffcf6246)] - **test**: run html/webappapis/timers WPT (Joyee Cheung) [#25618](https://github.com/nodejs/node/pull/25618) +* [[`579220815a`](https://github.com/nodejs/node/commit/579220815a)] - **test**: pull html/webappapis/timers WPT (Joyee Cheung) [#25618](https://github.com/nodejs/node/pull/25618) +* [[`d683da7ffa`](https://github.com/nodejs/node/commit/d683da7ffa)] - **test, tools**: suppress addon function cast warnings (Daniel Bevenius) [#25663](https://github.com/nodejs/node/pull/25663) +* [[`2009f18064`](https://github.com/nodejs/node/commit/2009f18064)] - **test,tracing**: use close event to wait for stdio (Anna Henningsen) [#25894](https://github.com/nodejs/node/pull/25894) +* [[`8495a788c6`](https://github.com/nodejs/node/commit/8495a788c6)] - **tls**: renegotiate should take care of its own state (Sam Roberts) [#25997](https://github.com/nodejs/node/pull/25997) +* [[`fb83f842a8`](https://github.com/nodejs/node/commit/fb83f842a8)] - **tls**: in-line comments and other cleanups (Sam Roberts) [#25861](https://github.com/nodejs/node/pull/25861) +* [[`4d0b56f3f7`](https://github.com/nodejs/node/commit/4d0b56f3f7)] - **tls**: don't shadow the tls global with a local (Sam Roberts) [#25861](https://github.com/nodejs/node/pull/25861) +* [[`7656d58eed`](https://github.com/nodejs/node/commit/7656d58eed)] - **(SEMVER-MINOR)** **tls**: introduce client 'session' event (Sam Roberts) [#25831](https://github.com/nodejs/node/pull/25831) +* [[`6ca8d26020`](https://github.com/nodejs/node/commit/6ca8d26020)] - **tools**: apply more stringent lint rules for benchmark code (Rich Trott) [#25944](https://github.com/nodejs/node/pull/25944) +* [[`c55d662bd1`](https://github.com/nodejs/node/commit/c55d662bd1)] - **tools**: replace deprecated ESLint configuration (Rich Trott) [#25877](https://github.com/nodejs/node/pull/25877) +* [[`e13c1850d2`](https://github.com/nodejs/node/commit/e13c1850d2)] - **tools**: update ESLint to 5.13.0 (Rich Trott) [#25877](https://github.com/nodejs/node/pull/25877) +* [[`8d14870b15`](https://github.com/nodejs/node/commit/8d14870b15)] - **tools**: update dmn in update-estlint.sh (Rich Trott) [#25877](https://github.com/nodejs/node/pull/25877) +* [[`988c7141d4`](https://github.com/nodejs/node/commit/988c7141d4)] - **tools**: improve prerequisites for test-all-suites (Rich Trott) [#25892](https://github.com/nodejs/node/pull/25892) +* [[`f395728b32`](https://github.com/nodejs/node/commit/f395728b32)] - **tools**: exclude benchmark code from coverage report (Rich Trott) [#25841](https://github.com/nodejs/node/pull/25841) +* [[`9d2ea1802b`](https://github.com/nodejs/node/commit/9d2ea1802b)] - **tools**: add test-all-suites to Makefile (Rich Trott) [#25799](https://github.com/nodejs/node/pull/25799) +* [[`9f1bcd44df`](https://github.com/nodejs/node/commit/9f1bcd44df)] - **tools**: make test.py Python 3 compatible (Sakthipriyan Vairamani (thefourtheye)) [#25767](https://github.com/nodejs/node/pull/25767) +* [[`454278a701`](https://github.com/nodejs/node/commit/454278a701)] - **tools**: refloat Node.js patches to cpplint.py (Refael Ackermann) [#25771](https://github.com/nodejs/node/pull/25771) +* [[`b9289f41af`](https://github.com/nodejs/node/commit/b9289f41af)] - **tools**: bump cpplint.py to 3d8f6f876d (Refael Ackermann) [#25771](https://github.com/nodejs/node/pull/25771) +* [[`9c9aefe2a0`](https://github.com/nodejs/node/commit/9c9aefe2a0)] - **worker**: set stack size for worker threads (Anna Henningsen) [#26049](https://github.com/nodejs/node/pull/26049) +* [[`23868ba45e`](https://github.com/nodejs/node/commit/23868ba45e)] - **worker**: keep stdio after exit (Anna Henningsen) [#26017](https://github.com/nodejs/node/pull/26017) +* [[`6c1e92817f`](https://github.com/nodejs/node/commit/6c1e92817f)] - **worker**: set up child Isolate inside Worker thread (Anna Henningsen) [#26011](https://github.com/nodejs/node/pull/26011) +* [[`1764aae193`](https://github.com/nodejs/node/commit/1764aae193)] - **worker**: pre-allocate thread id (Anna Henningsen) [#26011](https://github.com/nodejs/node/pull/26011) +* [[`f63817fd38`](https://github.com/nodejs/node/commit/f63817fd38)] - **worker**: refactor thread id management (Anna Henningsen) [#25796](https://github.com/nodejs/node/pull/25796) +* [[`8db6b8a95a`](https://github.com/nodejs/node/commit/8db6b8a95a)] - **worker**: move worker thread setup code into the main script (Joyee Cheung) [#25667](https://github.com/nodejs/node/pull/25667) +* [[`5d2e064973`](https://github.com/nodejs/node/commit/5d2e064973)] - **worker**: no throw on property access/postMessage after termination (Christopher Jeffrey) [#25871](https://github.com/nodejs/node/pull/25871) +* [[`508a2e7f0f`](https://github.com/nodejs/node/commit/508a2e7f0f)] - **worker**: use correct ctor for error serialization (Anna Henningsen) [#25951](https://github.com/nodejs/node/pull/25951) +* [[`52d4b7a928`](https://github.com/nodejs/node/commit/52d4b7a928)] - **worker**: remove undocumented .onclose property (Rich Trott) [#25904](https://github.com/nodejs/node/pull/25904) +* [[`e70aa30ebd`](https://github.com/nodejs/node/commit/e70aa30ebd)] - **worker**: add mutex lock to MessagePort ctor (Anna Henningsen) [#25911](https://github.com/nodejs/node/pull/25911) +* [[`55c270253b`](https://github.com/nodejs/node/commit/55c270253b)] - **worker**: throw for duplicates in transfer list (Anna Henningsen) [#25815](https://github.com/nodejs/node/pull/25815) +* [[`c959d60242`](https://github.com/nodejs/node/commit/c959d60242)] - **worker,etw**: only enable ETW on the main thread (Anna Henningsen) [#25907](https://github.com/nodejs/node/pull/25907) + ## 2019-01-30, Version 11.9.0 (Current), @targos diff --git a/src/node_version.h b/src/node_version.h index be9334fac6f86c..ce1df26941a1ee 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -23,13 +23,13 @@ #define SRC_NODE_VERSION_H_ #define NODE_MAJOR_VERSION 11 -#define NODE_MINOR_VERSION 9 -#define NODE_PATCH_VERSION 1 +#define NODE_MINOR_VERSION 10 +#define NODE_PATCH_VERSION 0 #define NODE_VERSION_IS_LTS 0 #define NODE_VERSION_LTS_CODENAME "" -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)