diff options
Diffstat (limited to 'deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got')
58 files changed, 4315 insertions, 0 deletions
diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/index.js new file mode 100644 index 0000000000..31a64dd08b --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/index.js @@ -0,0 +1,364 @@ +'use strict'; +const EventEmitter = require('events'); +const http = require('http'); +const https = require('https'); +const PassThrough = require('stream').PassThrough; +const urlLib = require('url'); +const querystring = require('querystring'); +const duplexer3 = require('duplexer3'); +const isStream = require('is-stream'); +const getStream = require('get-stream'); +const timedOut = require('timed-out'); +const urlParseLax = require('url-parse-lax'); +const lowercaseKeys = require('lowercase-keys'); +const isRedirect = require('is-redirect'); +const unzipResponse = require('unzip-response'); +const createErrorClass = require('create-error-class'); +const isRetryAllowed = require('is-retry-allowed'); +const Buffer = require('safe-buffer').Buffer; +const pkg = require('./package'); + +function requestAsEventEmitter(opts) { + opts = opts || {}; + + const ee = new EventEmitter(); + const requestUrl = opts.href || urlLib.resolve(urlLib.format(opts), opts.path); + let redirectCount = 0; + let retryCount = 0; + let redirectUrl; + + const get = opts => { + const fn = opts.protocol === 'https:' ? https : http; + + const req = fn.request(opts, res => { + const statusCode = res.statusCode; + + if (isRedirect(statusCode) && opts.followRedirect && 'location' in res.headers && (opts.method === 'GET' || opts.method === 'HEAD')) { + res.resume(); + + if (++redirectCount > 10) { + ee.emit('error', new got.MaxRedirectsError(statusCode, opts), null, res); + return; + } + + const bufferString = Buffer.from(res.headers.location, 'binary').toString(); + + redirectUrl = urlLib.resolve(urlLib.format(opts), bufferString); + const redirectOpts = Object.assign({}, opts, urlLib.parse(redirectUrl)); + + ee.emit('redirect', res, redirectOpts); + + get(redirectOpts); + + return; + } + + setImmediate(() => { + const response = typeof unzipResponse === 'function' && req.method !== 'HEAD' ? unzipResponse(res) : res; + response.url = redirectUrl || requestUrl; + response.requestUrl = requestUrl; + + ee.emit('response', response); + }); + }); + + req.once('error', err => { + const backoff = opts.retries(++retryCount, err); + + if (backoff) { + setTimeout(get, backoff, opts); + return; + } + + ee.emit('error', new got.RequestError(err, opts)); + }); + + if (opts.gotTimeout) { + timedOut(req, opts.gotTimeout); + } + + setImmediate(() => { + ee.emit('request', req); + }); + }; + + get(opts); + return ee; +} + +function asPromise(opts) { + return new Promise((resolve, reject) => { + const ee = requestAsEventEmitter(opts); + + ee.on('request', req => { + if (isStream(opts.body)) { + opts.body.pipe(req); + opts.body = undefined; + return; + } + + req.end(opts.body); + }); + + ee.on('response', res => { + const stream = opts.encoding === null ? getStream.buffer(res) : getStream(res, opts); + + stream + .catch(err => reject(new got.ReadError(err, opts))) + .then(data => { + const statusCode = res.statusCode; + const limitStatusCode = opts.followRedirect ? 299 : 399; + + res.body = data; + + if (opts.json && res.body) { + try { + res.body = JSON.parse(res.body); + } catch (e) { + throw new got.ParseError(e, statusCode, opts, data); + } + } + + if (statusCode < 200 || statusCode > limitStatusCode) { + throw new got.HTTPError(statusCode, opts); + } + + resolve(res); + }) + .catch(err => { + Object.defineProperty(err, 'response', {value: res}); + reject(err); + }); + }); + + ee.on('error', reject); + }); +} + +function asStream(opts) { + const input = new PassThrough(); + const output = new PassThrough(); + const proxy = duplexer3(input, output); + + if (opts.json) { + throw new Error('got can not be used as stream when options.json is used'); + } + + if (opts.body) { + proxy.write = () => { + throw new Error('got\'s stream is not writable when options.body is used'); + }; + } + + const ee = requestAsEventEmitter(opts); + + ee.on('request', req => { + proxy.emit('request', req); + + if (isStream(opts.body)) { + opts.body.pipe(req); + return; + } + + if (opts.body) { + req.end(opts.body); + return; + } + + if (opts.method === 'POST' || opts.method === 'PUT' || opts.method === 'PATCH') { + input.pipe(req); + return; + } + + req.end(); + }); + + ee.on('response', res => { + const statusCode = res.statusCode; + + res.pipe(output); + + if (statusCode < 200 || statusCode > 299) { + proxy.emit('error', new got.HTTPError(statusCode, opts), null, res); + return; + } + + proxy.emit('response', res); + }); + + ee.on('redirect', proxy.emit.bind(proxy, 'redirect')); + ee.on('error', proxy.emit.bind(proxy, 'error')); + + return proxy; +} + +function normalizeArguments(url, opts) { + if (typeof url !== 'string' && typeof url !== 'object') { + throw new Error(`Parameter \`url\` must be a string or object, not ${typeof url}`); + } + + if (typeof url === 'string') { + url = url.replace(/^unix:/, 'http://$&'); + url = urlParseLax(url); + + if (url.auth) { + throw new Error('Basic authentication must be done with auth option'); + } + } + + opts = Object.assign( + { + protocol: 'http:', + path: '', + retries: 5 + }, + url, + opts + ); + + opts.headers = Object.assign({ + 'user-agent': `${pkg.name}/${pkg.version} (https://github.com/sindresorhus/got)`, + 'accept-encoding': 'gzip,deflate' + }, lowercaseKeys(opts.headers)); + + const query = opts.query; + + if (query) { + if (typeof query !== 'string') { + opts.query = querystring.stringify(query); + } + + opts.path = `${opts.path.split('?')[0]}?${opts.query}`; + delete opts.query; + } + + if (opts.json && opts.headers.accept === undefined) { + opts.headers.accept = 'application/json'; + } + + let body = opts.body; + + if (body) { + if (typeof body !== 'string' && !(body !== null && typeof body === 'object')) { + throw new Error('options.body must be a ReadableStream, string, Buffer or plain Object'); + } + + opts.method = opts.method || 'POST'; + + if (isStream(body) && typeof body.getBoundary === 'function') { + // Special case for https://github.com/form-data/form-data + opts.headers['content-type'] = opts.headers['content-type'] || `multipart/form-data; boundary=${body.getBoundary()}`; + } else if (body !== null && typeof body === 'object' && !Buffer.isBuffer(body) && !isStream(body)) { + opts.headers['content-type'] = opts.headers['content-type'] || 'application/x-www-form-urlencoded'; + body = opts.body = querystring.stringify(body); + } + + if (opts.headers['content-length'] === undefined && opts.headers['transfer-encoding'] === undefined && !isStream(body)) { + const length = typeof body === 'string' ? Buffer.byteLength(body) : body.length; + opts.headers['content-length'] = length; + } + } + + opts.method = (opts.method || 'GET').toUpperCase(); + + if (opts.hostname === 'unix') { + const matches = /(.+):(.+)/.exec(opts.path); + + if (matches) { + opts.socketPath = matches[1]; + opts.path = matches[2]; + opts.host = null; + } + } + + if (typeof opts.retries !== 'function') { + const retries = opts.retries; + + opts.retries = (iter, err) => { + if (iter > retries || !isRetryAllowed(err)) { + return 0; + } + + const noise = Math.random() * 100; + + return ((1 << iter) * 1000) + noise; + }; + } + + if (opts.followRedirect === undefined) { + opts.followRedirect = true; + } + + if (opts.timeout) { + opts.gotTimeout = opts.timeout; + delete opts.timeout; + } + + return opts; +} + +function got(url, opts) { + try { + return asPromise(normalizeArguments(url, opts)); + } catch (err) { + return Promise.reject(err); + } +} + +const helpers = [ + 'get', + 'post', + 'put', + 'patch', + 'head', + 'delete' +]; + +helpers.forEach(el => { + got[el] = (url, opts) => got(url, Object.assign({}, opts, {method: el})); +}); + +got.stream = (url, opts) => asStream(normalizeArguments(url, opts)); + +for (const el of helpers) { + got.stream[el] = (url, opts) => got.stream(url, Object.assign({}, opts, {method: el})); +} + +function stdError(error, opts) { + if (error.code !== undefined) { + this.code = error.code; + } + + Object.assign(this, { + message: error.message, + host: opts.host, + hostname: opts.hostname, + method: opts.method, + path: opts.path + }); +} + +got.RequestError = createErrorClass('RequestError', stdError); +got.ReadError = createErrorClass('ReadError', stdError); +got.ParseError = createErrorClass('ParseError', function (e, statusCode, opts, data) { + stdError.call(this, e, opts); + this.statusCode = statusCode; + this.statusMessage = http.STATUS_CODES[this.statusCode]; + this.message = `${e.message} in "${urlLib.format(opts)}": \n${data.slice(0, 77)}...`; +}); + +got.HTTPError = createErrorClass('HTTPError', function (statusCode, opts) { + stdError.call(this, {}, opts); + this.statusCode = statusCode; + this.statusMessage = http.STATUS_CODES[this.statusCode]; + this.message = `Response code ${this.statusCode} (${this.statusMessage})`; +}); + +got.MaxRedirectsError = createErrorClass('MaxRedirectsError', function (statusCode, opts) { + stdError.call(this, {}, opts); + this.statusCode = statusCode; + this.statusMessage = http.STATUS_CODES[this.statusCode]; + this.message = 'Redirected 10 times. Aborting.'; +}); + +module.exports = got; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/index.js new file mode 100644 index 0000000000..e415aa7ede --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/index.js @@ -0,0 +1,44 @@ +'use strict'; +var captureStackTrace = require('capture-stack-trace'); + +function inherits(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); +} + +module.exports = function createErrorClass(className, setup) { + if (typeof className !== 'string') { + throw new TypeError('Expected className to be a string'); + } + + if (/[^0-9a-zA-Z_$]/.test(className)) { + throw new Error('className contains invalid characters'); + } + + setup = setup || function (message) { + this.message = message; + }; + + var ErrorClass = function () { + Object.defineProperty(this, 'name', { + configurable: true, + value: className, + writable: true + }); + + captureStackTrace(this, this.constructor); + + setup.apply(this, arguments); + }; + + inherits(ErrorClass, Error); + + return ErrorClass; +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/license new file mode 100644 index 0000000000..1aeb74fd25 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop) + +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/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/index.js new file mode 100644 index 0000000000..1b696c8b60 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/index.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = Error.captureStackTrace || function (error) { + var container = new Error(); + + Object.defineProperty(error, 'stack', { + configurable: true, + get: function getStack() { + var stack = container.stack; + + Object.defineProperty(this, 'stack', { + value: stack + }); + + return stack; + } + }); +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/package.json new file mode 100644 index 0000000000..f2d2ad9cfc --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/package.json @@ -0,0 +1,91 @@ +{ + "_args": [ + [ + { + "raw": "capture-stack-trace@^1.0.0", + "scope": null, + "escapedName": "capture-stack-trace", + "name": "capture-stack-trace", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class" + ] + ], + "_from": "capture-stack-trace@>=1.0.0 <2.0.0", + "_id": "capture-stack-trace@1.0.0", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/create-error-class/capture-stack-trace", + "_npmUser": { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "capture-stack-trace@^1.0.0", + "scope": null, + "escapedName": "capture-stack-trace", + "name": "capture-stack-trace", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got/create-error-class" + ], + "_resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", + "_shasum": "4a6fa07399c26bba47f0b2496b4d0fb408c5550d", + "_shrinkwrap": null, + "_spec": "capture-stack-trace@^1.0.0", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "bugs": { + "url": "https://github.com/floatdrop/capture-stack-trace/issues" + }, + "dependencies": {}, + "description": "Error.captureStackTrace ponyfill", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "4a6fa07399c26bba47f0b2496b4d0fb408c5550d", + "tarball": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "eb46ce326fa9074b6ce17a94d4b76500321a331f", + "homepage": "https://github.com/floatdrop/capture-stack-trace", + "keywords": [ + "Error", + "captureStackTrace" + ], + "license": "MIT", + "maintainers": [ + { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + } + ], + "name": "capture-stack-trace", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/capture-stack-trace.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/readme.md new file mode 100644 index 0000000000..061c463c42 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/readme.md @@ -0,0 +1,36 @@ +# capture-stack-trace [![Build Status](https://travis-ci.org/floatdrop/capture-stack-trace.svg?branch=master)](https://travis-ci.org/floatdrop/capture-stack-trace) + +> Ponyfill for Error.captureStackTrace + + +## Install + +``` +$ npm install --save capture-stack-trace +``` + + +## Usage + +```js +var captureStackTrace = require('capture-stack-trace'); + +captureStackTrace({}); +// => {stack: ...} +``` + + +## API + +### captureStackTrace(error) + +#### error + +*Required* +Type: `Object` + +Target Object, that will recieve stack property. + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/package.json new file mode 100644 index 0000000000..79a0b9c6c8 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/package.json @@ -0,0 +1,95 @@ +{ + "_args": [ + [ + { + "raw": "create-error-class@^3.0.0", + "scope": null, + "escapedName": "create-error-class", + "name": "create-error-class", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "create-error-class@>=3.0.0 <4.0.0", + "_id": "create-error-class@3.0.2", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/create-error-class", + "_nodeVersion": "4.4.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/create-error-class-3.0.2.tgz_1459840488945_0.7410781022626907" + }, + "_npmUser": { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + "_npmVersion": "2.14.20", + "_phantomChildren": {}, + "_requested": { + "raw": "create-error-class@^3.0.0", + "scope": null, + "escapedName": "create-error-class", + "name": "create-error-class", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", + "_shasum": "06be7abef947a3f14a30fd610671d401bca8b7b6", + "_shrinkwrap": null, + "_spec": "create-error-class@^3.0.0", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "bugs": { + "url": "https://github.com/floatdrop/create-error-class/issues" + }, + "dependencies": { + "capture-stack-trace": "^1.0.0" + }, + "description": "Create Error classes", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "06be7abef947a3f14a30fd610671d401bca8b7b6", + "tarball": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "af3f3979494c4eca0b0259d12035e7fb84fa302f", + "homepage": "https://github.com/floatdrop/create-error-class", + "keywords": [], + "license": "MIT", + "maintainers": [ + { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + } + ], + "name": "create-error-class", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/create-error-class.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "3.0.2" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/readme.md new file mode 100644 index 0000000000..1076de88eb --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/readme.md @@ -0,0 +1,54 @@ +# create-error-class [![Build Status](https://travis-ci.org/floatdrop/create-error-class.svg?branch=master)](https://travis-ci.org/floatdrop/create-error-class) + +> Create error class + + +## Install + +``` +$ npm install --save create-error-class +``` + + +## Usage + +```js +var createErrorClass = require('create-error-class'); + +var HTTPError = createErrorClass('HTTPError', function (props) { + this.message = 'Status code is ' + props.statusCode; +}); + +throw new HTTPError({statusCode: 404}); +``` + + +## API + +### createErrorClass(className, [setup]) + +Return constructor of Errors with `className`. + +#### className + +*Required* +Type: `string` + +Class name of Error Object. Should contain characters from `[0-9a-zA-Z_$]` range. + +#### setup +Type: `function` + +Setup function, that will be called after each Error object is created from constructor with context of Error object. + +By default `setup` function sets `this.message` as first argument: + +```js +var MyError = createErrorClass('MyError'); + +new MyError('Something gone wrong!').message; // => 'Something gone wrong!' +``` + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/LICENSE.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/LICENSE.md new file mode 100644 index 0000000000..75a50f3014 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/LICENSE.md @@ -0,0 +1,26 @@ +Copyright (c) 2013, Deoxxa Development +====================================== +All rights reserved. +-------------------- + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of Deoxxa Development nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY DEOXXA DEVELOPMENT ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL DEOXXA DEVELOPMENT BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/README.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/README.md new file mode 100644 index 0000000000..9f95ddf530 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/README.md @@ -0,0 +1,115 @@ +# duplexer3 [![Build Status](https://travis-ci.org/floatdrop/duplexer3.svg?branch=master)](https://travis-ci.org/floatdrop/duplexer3) [![Coverage Status](https://coveralls.io/repos/floatdrop/duplexer3/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/duplexer3?branch=master) + +Like [duplexer2](https://github.com/deoxxa/duplexer2) but using Streams3 without readable-stream dependency + +```javascript +var stream = require("stream"); + +var duplexer3 = require("duplexer3"); + +var writable = new stream.Writable({objectMode: true}), + readable = new stream.Readable({objectMode: true}); + +writable._write = function _write(input, encoding, done) { + if (readable.push(input)) { + return done(); + } else { + readable.once("drain", done); + } +}; + +readable._read = function _read(n) { + // no-op +}; + +// simulate the readable thing closing after a bit +writable.once("finish", function() { + setTimeout(function() { + readable.push(null); + }, 500); +}); + +var duplex = duplexer3(writable, readable); + +duplex.on("data", function(e) { + console.log("got data", JSON.stringify(e)); +}); + +duplex.on("finish", function() { + console.log("got finish event"); +}); + +duplex.on("end", function() { + console.log("got end event"); +}); + +duplex.write("oh, hi there", function() { + console.log("finished writing"); +}); + +duplex.end(function() { + console.log("finished ending"); +}); +``` + +``` +got data "oh, hi there" +finished writing +got finish event +finished ending +got end event +``` + +## Overview + +This is a reimplementation of [duplexer](https://www.npmjs.com/package/duplexer) using the +Streams3 API which is standard in Node as of v4. Everything largely +works the same. + + + +## Installation + +[Available via `npm`](https://docs.npmjs.com/cli/install): + +``` +$ npm i duplexer3 +``` + +## API + +### duplexer3 + +Creates a new `DuplexWrapper` object, which is the actual class that implements +most of the fun stuff. All that fun stuff is hidden. DON'T LOOK. + +```javascript +duplexer3([options], writable, readable) +``` + +```javascript +const duplex = duplexer3(new stream.Writable(), new stream.Readable()); +``` + +Arguments + +* __options__ - an object specifying the regular `stream.Duplex` options, as + well as the properties described below. +* __writable__ - a writable stream +* __readable__ - a readable stream + +Options + +* __bubbleErrors__ - a boolean value that specifies whether to bubble errors + from the underlying readable/writable streams. Default is `true`. + + +## License + +3-clause BSD. [A copy](./LICENSE) is included with the source. + +## Contact + +* GitHub ([deoxxa](http://github.com/deoxxa)) +* Twitter ([@deoxxa](http://twitter.com/deoxxa)) +* Email ([deoxxa@fknsrs.biz](mailto:deoxxa@fknsrs.biz)) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/index.js new file mode 100644 index 0000000000..1339ffc51c --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/index.js @@ -0,0 +1,76 @@ +"use strict"; + +var stream = require("stream"); + +function DuplexWrapper(options, writable, readable) { + if (typeof readable === "undefined") { + readable = writable; + writable = options; + options = null; + } + + stream.Duplex.call(this, options); + + if (typeof readable.read !== "function") { + readable = (new stream.Readable(options)).wrap(readable); + } + + this._writable = writable; + this._readable = readable; + this._waiting = false; + + var self = this; + + writable.once("finish", function() { + self.end(); + }); + + this.once("finish", function() { + writable.end(); + }); + + readable.on("readable", function() { + if (self._waiting) { + self._waiting = false; + self._read(); + } + }); + + readable.once("end", function() { + self.push(null); + }); + + if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) { + writable.on("error", function(err) { + self.emit("error", err); + }); + + readable.on("error", function(err) { + self.emit("error", err); + }); + } +} + +DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}}); + +DuplexWrapper.prototype._write = function _write(input, encoding, done) { + this._writable.write(input, encoding, done); +}; + +DuplexWrapper.prototype._read = function _read() { + var buf; + var reads = 0; + while ((buf = this._readable.read()) !== null) { + this.push(buf); + reads++; + } + if (reads === 0) { + this._waiting = true; + } +}; + +module.exports = function duplex2(options, writable, readable) { + return new DuplexWrapper(options, writable, readable); +}; + +module.exports.DuplexWrapper = DuplexWrapper; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/package.json new file mode 100644 index 0000000000..b25f531709 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/package.json @@ -0,0 +1,96 @@ +{ + "_args": [ + [ + { + "raw": "duplexer3@^0.1.4", + "scope": null, + "escapedName": "duplexer3", + "name": "duplexer3", + "rawSpec": "^0.1.4", + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "duplexer3@>=0.1.4 <0.2.0", + "_id": "duplexer3@0.1.4", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/duplexer3", + "_nodeVersion": "4.2.3", + "_npmUser": { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "raw": "duplexer3@^0.1.4", + "scope": null, + "escapedName": "duplexer3", + "name": "duplexer3", + "rawSpec": "^0.1.4", + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "_shasum": "ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2", + "_shrinkwrap": null, + "_spec": "duplexer3@^0.1.4", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Conrad Pankoff", + "email": "deoxxa@fknsrs.biz", + "url": "http://www.fknsrs.biz/" + }, + "bugs": { + "url": "https://github.com/floatdrop/duplexer3/issues" + }, + "dependencies": {}, + "description": "Like duplexer but using streams3", + "devDependencies": { + "mocha": "^2.2.5" + }, + "directories": {}, + "dist": { + "shasum": "ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2", + "tarball": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz" + }, + "engine": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "gitHead": "810f45fd7216a4ec4585e673ad28f05852ed05a6", + "homepage": "https://github.com/floatdrop/duplexer3", + "keywords": [ + "duplex", + "duplexer", + "stream", + "stream3", + "join", + "combine" + ], + "license": "BSD-3-Clause", + "maintainers": [ + { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + } + ], + "name": "duplexer3", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/duplexer3.git" + }, + "scripts": { + "test": "mocha -R tap" + }, + "version": "0.1.4" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/buffer-stream.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/buffer-stream.js new file mode 100644 index 0000000000..ae45d3d9e7 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/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/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/index.js new file mode 100644 index 0000000000..2dc5ee96af --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/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/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/package.json new file mode 100644 index 0000000000..5f7ad687a6 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + { + "raw": "get-stream@^3.0.0", + "scope": null, + "escapedName": "get-stream", + "name": "get-stream", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "get-stream@>=3.0.0 <4.0.0", + "_id": "get-stream@3.0.0", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/get-stream", + "_nodeVersion": "4.6.2", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/get-stream-3.0.0.tgz_1479869385406_0.47692562686279416" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, + "_requested": { + "raw": "get-stream@^3.0.0", + "scope": null, + "escapedName": "get-stream", + "name": "get-stream", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "_shasum": "8e943d1358dc37555054ecbe2edb05aa174ede14", + "_shrinkwrap": null, + "_spec": "get-stream@^3.0.0", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/get-stream/issues" + }, + "dependencies": {}, + "description": "Get a stream as a string, buffer, or array", + "devDependencies": { + "ava": "*", + "into-stream": "^3.0.0", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "8e943d1358dc37555054ecbe2edb05aa174ede14", + "tarball": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "buffer-stream.js" + ], + "gitHead": "3023bc31dec6680dda4f935a2b320b3a4f18c815", + "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", + "maintainers": [ + { + "name": "jamestalmage", + "email": "james@talmage.io" + }, + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "get-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "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/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/readme.md new file mode 100644 index 0000000000..73b188fb42 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/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`<br> +Default: `utf8` + +[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. + +##### maxBuffer + +Type: `number`<br> +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/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/index.js new file mode 100644 index 0000000000..75ec0090ef --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/index.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = function (x) { + if (typeof x !== 'number') { + throw new TypeError('Expected a number'); + } + + return x === 300 || + x === 301 || + x === 302 || + x === 303 || + x === 305 || + x === 307 || + x === 308; +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/package.json new file mode 100644 index 0000000000..85b9fbc27b --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + { + "raw": "is-redirect@^1.0.0", + "scope": null, + "escapedName": "is-redirect", + "name": "is-redirect", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "is-redirect@>=1.0.0 <2.0.0", + "_id": "is-redirect@1.0.0", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/is-redirect", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "is-redirect@^1.0.0", + "scope": null, + "escapedName": "is-redirect", + "name": "is-redirect", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "_shasum": "1d03dded53bd8db0f30c26e4f95d36fc7c87dc24", + "_shrinkwrap": null, + "_spec": "is-redirect@^1.0.0", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-redirect/issues" + }, + "dependencies": {}, + "description": "Check if a number is a redirect HTTP status code", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "1d03dded53bd8db0f30c26e4f95d36fc7c87dc24", + "tarball": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "53bc816ba54447a55676930138151feb0f917c18", + "homepage": "https://github.com/sindresorhus/is-redirect", + "keywords": [ + "redirect", + "http", + "https", + "status", + "code", + "codes", + "is", + "check", + "detect" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-redirect", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-redirect.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/readme.md new file mode 100644 index 0000000000..e9f0a393d2 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/readme.md @@ -0,0 +1,28 @@ +# is-redirect [![Build Status](https://travis-ci.org/sindresorhus/is-redirect.svg?branch=master)](https://travis-ci.org/sindresorhus/is-redirect) + +> Check if a number is a [redirect HTTP status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection) + + +## Install + +``` +$ npm install --save is-redirect +``` + + +## Usage + +```js +var isRedirect = require('is-redirect'); + +isRedirect(302); +//=> true + +isRedirect(200); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/index.js new file mode 100644 index 0000000000..663ee338fc --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/index.js @@ -0,0 +1,60 @@ +'use strict'; + +var WHITELIST = [ + 'ETIMEDOUT', + 'ECONNRESET', + 'EADDRINUSE', + 'ESOCKETTIMEDOUT', + 'ECONNREFUSED', + 'EPIPE' +]; + +var BLACKLIST = [ + 'ENOTFOUND', + 'ENETUNREACH', + + // SSL errors from https://github.com/nodejs/node/blob/ed3d8b13ee9a705d89f9e0397d9e96519e7e47ac/src/node_crypto.cc#L1950 + 'UNABLE_TO_GET_ISSUER_CERT', + 'UNABLE_TO_GET_CRL', + 'UNABLE_TO_DECRYPT_CERT_SIGNATURE', + 'UNABLE_TO_DECRYPT_CRL_SIGNATURE', + 'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY', + 'CERT_SIGNATURE_FAILURE', + 'CRL_SIGNATURE_FAILURE', + 'CERT_NOT_YET_VALID', + 'CERT_HAS_EXPIRED', + 'CRL_NOT_YET_VALID', + 'CRL_HAS_EXPIRED', + 'ERROR_IN_CERT_NOT_BEFORE_FIELD', + 'ERROR_IN_CERT_NOT_AFTER_FIELD', + 'ERROR_IN_CRL_LAST_UPDATE_FIELD', + 'ERROR_IN_CRL_NEXT_UPDATE_FIELD', + 'OUT_OF_MEM', + 'DEPTH_ZERO_SELF_SIGNED_CERT', + 'SELF_SIGNED_CERT_IN_CHAIN', + 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY', + 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', + 'CERT_CHAIN_TOO_LONG', + 'CERT_REVOKED', + 'INVALID_CA', + 'PATH_LENGTH_EXCEEDED', + 'INVALID_PURPOSE', + 'CERT_UNTRUSTED', + 'CERT_REJECTED' +]; + +module.exports = function (err) { + if (!err || !err.code) { + return true; + } + + if (WHITELIST.indexOf(err.code) !== -1) { + return true; + } + + if (BLACKLIST.indexOf(err.code) !== -1) { + return false; + } + + return true; +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/license new file mode 100644 index 0000000000..1aeb74fd25 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop) + +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/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/package.json new file mode 100644 index 0000000000..8e177dd43d --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "is-retry-allowed@^1.0.0", + "scope": null, + "escapedName": "is-retry-allowed", + "name": "is-retry-allowed", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "is-retry-allowed@>=1.0.0 <2.0.0", + "_id": "is-retry-allowed@1.1.0", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/is-retry-allowed", + "_nodeVersion": "4.4.7", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/is-retry-allowed-1.1.0.tgz_1467498831328_0.0396464669611305" + }, + "_npmUser": { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + "_npmVersion": "2.15.8", + "_phantomChildren": {}, + "_requested": { + "raw": "is-retry-allowed@^1.0.0", + "scope": null, + "escapedName": "is-retry-allowed", + "name": "is-retry-allowed", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "_shasum": "11a060568b67339444033d0125a61a20d564fb34", + "_shrinkwrap": null, + "_spec": "is-retry-allowed@^1.0.0", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "bugs": { + "url": "https://github.com/floatdrop/is-retry-allowed/issues" + }, + "dependencies": {}, + "description": "My prime module", + "devDependencies": { + "ava": "^0.8.0", + "xo": "^0.12.1" + }, + "directories": {}, + "dist": { + "shasum": "11a060568b67339444033d0125a61a20d564fb34", + "tarball": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "8ca0d01b23b0a92bcf232d97801c3f08c41231a3", + "homepage": "https://github.com/floatdrop/is-retry-allowed#readme", + "keywords": [], + "license": "MIT", + "maintainers": [ + { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-retry-allowed", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/is-retry-allowed.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/readme.md new file mode 100644 index 0000000000..4212d099b5 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/readme.md @@ -0,0 +1,42 @@ +# is-retry-allowed [![Build Status](https://travis-ci.org/floatdrop/is-retry-allowed.svg?branch=master)](https://travis-ci.org/floatdrop/is-retry-allowed) + +Is retry allowed for Error? + + +## Install + +``` +$ npm install --save is-retry-allowed +``` + + +## Usage + +```js +const isRetryAllowed = require('is-retry-allowed'); + +isRetryAllowed({code: 'ETIMEDOUT'}); +//=> true + +isRetryAllowed({code: 'ENOTFOUND'}); +//=> false + +isRetryAllowed({}); +//=> true +``` + + +## API + +### isRetryAllowed(error) + +#### error + +Type: `object` + +Object with `code` property, which will be used to determine retry. + + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/index.js new file mode 100644 index 0000000000..6f7ec91a40 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/index.js @@ -0,0 +1,21 @@ +'use strict'; + +var isStream = module.exports = function (stream) { + return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; +}; + +isStream.writable = function (stream) { + return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; +}; + +isStream.readable = function (stream) { + return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; +}; + +isStream.duplex = function (stream) { + return isStream.writable(stream) && isStream.readable(stream); +}; + +isStream.transform = function (stream) { + return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/package.json new file mode 100644 index 0000000000..a97d5ad6fc --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "is-stream@^1.1.0", + "scope": null, + "escapedName": "is-stream", + "name": "is-stream", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa" + ], + [ + { + "raw": "is-stream@^1.0.0", + "scope": null, + "escapedName": "is-stream", + "name": "is-stream", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "is-stream@^1.0.0", + "_id": "is-stream@1.1.0", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/is-stream", + "_nodeVersion": "4.4.2", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/is-stream-1.1.0.tgz_1460446915184_0.806101513793692" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.0", + "_phantomChildren": {}, + "_requested": { + "raw": "is-stream@^1.0.0", + "scope": null, + "escapedName": "is-stream", + "name": "is-stream", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "_shasum": "12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44", + "_shrinkwrap": null, + "_spec": "is-stream@^1.0.0", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-stream/issues" + }, + "dependencies": {}, + "description": "Check if something is a Node.js stream", + "devDependencies": { + "ava": "*", + "tempfile": "^1.1.0", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44", + "tarball": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "e21d73f1028c189d16150cea52641059b0936310", + "homepage": "https://github.com/sindresorhus/is-stream#readme", + "keywords": [ + "stream", + "type", + "streams", + "writable", + "readable", + "duplex", + "transform", + "check", + "detect", + "is" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-stream.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/readme.md new file mode 100644 index 0000000000..d8afce81d2 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/readme.md @@ -0,0 +1,42 @@ +# is-stream [![Build Status](https://travis-ci.org/sindresorhus/is-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/is-stream) + +> Check if something is a [Node.js stream](https://nodejs.org/api/stream.html) + + +## Install + +``` +$ npm install --save is-stream +``` + + +## Usage + +```js +const fs = require('fs'); +const isStream = require('is-stream'); + +isStream(fs.createReadStream('unicorn.png')); +//=> true + +isStream({}); +//=> false +``` + + +## API + +### isStream(stream) + +#### isStream.writable(stream) + +#### isStream.readable(stream) + +#### isStream.duplex(stream) + +#### isStream.transform(stream) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/index.js new file mode 100644 index 0000000000..b8d8898365 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/index.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = function (obj) { + var ret = {}; + var keys = Object.keys(Object(obj)); + + for (var i = 0; i < keys.length; i++) { + ret[keys[i].toLowerCase()] = obj[keys[i]]; + } + + return ret; +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/package.json new file mode 100644 index 0000000000..8569ff683f --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "lowercase-keys@^1.0.0", + "scope": null, + "escapedName": "lowercase-keys", + "name": "lowercase-keys", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "lowercase-keys@>=1.0.0 <2.0.0", + "_id": "lowercase-keys@1.0.0", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/lowercase-keys", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "lowercase-keys@^1.0.0", + "scope": null, + "escapedName": "lowercase-keys", + "name": "lowercase-keys", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "_shasum": "4e3366b39e7f5457e35f1324bdf6f88d0bfc7306", + "_shrinkwrap": null, + "_spec": "lowercase-keys@^1.0.0", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/lowercase-keys/issues" + }, + "dependencies": {}, + "description": "Lowercase the keys of an object", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "4e3366b39e7f5457e35f1324bdf6f88d0bfc7306", + "tarball": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "4b1423164b551faa7a51a5b8f903c51e00c0ea94", + "homepage": "https://github.com/sindresorhus/lowercase-keys", + "keywords": [ + "object", + "assign", + "extend", + "properties", + "lowercase", + "lower-case", + "case", + "keys", + "key" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "lowercase-keys", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/lowercase-keys.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/readme.md new file mode 100644 index 0000000000..dc65770a38 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/readme.md @@ -0,0 +1,33 @@ +# lowercase-keys [![Build Status](https://travis-ci.org/sindresorhus/lowercase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/lowercase-keys) + +> Lowercase the keys of an object + + +## Install + +``` +$ npm install --save lowercase-keys +``` + + +## Usage + +```js +var lowercaseKeys = require('lowercase-keys'); + +lowercaseKeys({FOO: true, bAr: false}); +//=> {foo: true, bar: false} +``` + + +## API + +### lowercaseKeys(object) + +Lowercases the keys and returns a new object. + + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/.travis.yml b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/.travis.yml new file mode 100644 index 0000000000..7b20f28cb0 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - 'node' + - '5' + - '4' + - '0.12' + - '0.10' diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/LICENSE b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/LICENSE new file mode 100644 index 0000000000..0c068ceecb --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +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/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/README.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/README.md new file mode 100644 index 0000000000..96eb387aa0 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/README.md @@ -0,0 +1,581 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url] + +#### Safer Node.js Buffer API + +**Use the new Node.js v6 Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in Node.js v0.10, v0.12, v4.x, and v5.x.** + +**Uses the built-in implementations when available.** + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) +<!-- YAML +added: v3.0.0 +--> + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) +<!-- YAML +added: v5.10.0 +--> + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: <Buffer 88 13 a0 0f> + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: <Buffer 88 13 70 17> +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) +<!-- YAML +added: v3.0.0 +--> + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) +<!-- YAML +added: v5.10.0 +--> + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) +<!-- YAML +added: v5.10.0 +--> + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // <Buffer 00 00 00 00 00> +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // <Buffer 61 61 61 61 61> +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64> +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) +<!-- YAML +added: v5.10.0 +--> + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // <Buffer 78 e0 82 02 01> + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // <Buffer 00 00 00 00 00> +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) +<!-- YAML +added: v5.10.0 +--> + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/browser.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/browser.js new file mode 100644 index 0000000000..0bd12027d3 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/browser.js @@ -0,0 +1 @@ +module.exports = require('buffer') diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/index.js new file mode 100644 index 0000000000..74a7358ee8 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/index.js @@ -0,0 +1,58 @@ +var buffer = require('buffer') + +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + Object.keys(buffer).forEach(function (prop) { + exports[prop] = buffer[prop] + }) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +Object.keys(Buffer).forEach(function (prop) { + SafeBuffer[prop] = Buffer[prop] +}) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/package.json new file mode 100644 index 0000000000..f0a552d02f --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "safe-buffer@^5.0.1", + "scope": null, + "escapedName": "safe-buffer", + "name": "safe-buffer", + "rawSpec": "^5.0.1", + "spec": ">=5.0.1 <6.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "safe-buffer@>=5.0.1 <6.0.0", + "_id": "safe-buffer@5.0.1", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/safe-buffer", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/safe-buffer-5.0.1.tgz_1464588482081_0.8112505874596536" + }, + "_npmUser": { + "name": "feross", + "email": "feross@feross.org" + }, + "_npmVersion": "2.15.5", + "_phantomChildren": {}, + "_requested": { + "raw": "safe-buffer@^5.0.1", + "scope": null, + "escapedName": "safe-buffer", + "name": "safe-buffer", + "rawSpec": "^5.0.1", + "spec": ">=5.0.1 <6.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "_shasum": "d263ca54696cd8a306b5ca6551e92de57918fbe7", + "_shrinkwrap": null, + "_spec": "safe-buffer@^5.0.1", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "browser": "./browser.js", + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "dependencies": {}, + "description": "Safer Node.js Buffer API", + "devDependencies": { + "standard": "^7.0.0", + "tape": "^4.0.0", + "zuul": "^3.0.0" + }, + "directories": {}, + "dist": { + "shasum": "d263ca54696cd8a306b5ca6551e92de57918fbe7", + "tarball": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz" + }, + "gitHead": "1e371a367da962afae2bebc527b50271c739d28c", + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "feross", + "email": "feross@feross.org" + }, + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "safe-buffer", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test.js" + }, + "version": "5.0.1" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/test.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/test.js new file mode 100644 index 0000000000..7da8ad761e --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/test.js @@ -0,0 +1,99 @@ +var test = require('tape') +var SafeBuffer = require('./').Buffer + +test('new SafeBuffer(value) works just like Buffer', function (t) { + t.deepEqual(new SafeBuffer('hey'), new Buffer('hey')) + t.deepEqual(new SafeBuffer('hey', 'utf8'), new Buffer('hey', 'utf8')) + t.deepEqual(new SafeBuffer('686579', 'hex'), new Buffer('686579', 'hex')) + t.deepEqual(new SafeBuffer([1, 2, 3]), new Buffer([1, 2, 3])) + t.deepEqual(new SafeBuffer(new Uint8Array([1, 2, 3])), new Buffer(new Uint8Array([1, 2, 3]))) + + t.equal(typeof SafeBuffer.isBuffer, 'function') + t.equal(SafeBuffer.isBuffer(new SafeBuffer('hey')), true) + t.equal(Buffer.isBuffer(new SafeBuffer('hey')), true) + t.notOk(SafeBuffer.isBuffer({})) + + t.end() +}) + +test('SafeBuffer.from(value) converts to a Buffer', function (t) { + t.deepEqual(SafeBuffer.from('hey'), new Buffer('hey')) + t.deepEqual(SafeBuffer.from('hey', 'utf8'), new Buffer('hey', 'utf8')) + t.deepEqual(SafeBuffer.from('686579', 'hex'), new Buffer('686579', 'hex')) + t.deepEqual(SafeBuffer.from([1, 2, 3]), new Buffer([1, 2, 3])) + t.deepEqual(SafeBuffer.from(new Uint8Array([1, 2, 3])), new Buffer(new Uint8Array([1, 2, 3]))) + + t.end() +}) + +test('SafeBuffer.alloc(number) returns zeroed-out memory', function (t) { + for (var i = 0; i < 10; i++) { + var expected1 = new Buffer(1000) + expected1.fill(0) + t.deepEqual(SafeBuffer.alloc(1000), expected1) + + var expected2 = new Buffer(1000 * 1000) + expected2.fill(0) + t.deepEqual(SafeBuffer.alloc(1000 * 1000), expected2) + } + t.end() +}) + +test('SafeBuffer.allocUnsafe(number)', function (t) { + var buf = SafeBuffer.allocUnsafe(100) // unitialized memory + t.equal(buf.length, 100) + t.equal(SafeBuffer.isBuffer(buf), true) + t.equal(Buffer.isBuffer(buf), true) + t.end() +}) + +test('SafeBuffer.from() throws with number types', function (t) { + t.plan(5) + t.throws(function () { + SafeBuffer.from(0) + }) + t.throws(function () { + SafeBuffer.from(-1) + }) + t.throws(function () { + SafeBuffer.from(NaN) + }) + t.throws(function () { + SafeBuffer.from(Infinity) + }) + t.throws(function () { + SafeBuffer.from(99) + }) +}) + +test('SafeBuffer.allocUnsafe() throws with non-number types', function (t) { + t.plan(4) + t.throws(function () { + SafeBuffer.allocUnsafe('hey') + }) + t.throws(function () { + SafeBuffer.allocUnsafe('hey', 'utf8') + }) + t.throws(function () { + SafeBuffer.allocUnsafe([1, 2, 3]) + }) + t.throws(function () { + SafeBuffer.allocUnsafe({}) + }) +}) + +test('SafeBuffer.alloc() throws with non-number types', function (t) { + t.plan(4) + t.throws(function () { + SafeBuffer.alloc('hey') + }) + t.throws(function () { + SafeBuffer.alloc('hey', 'utf8') + }) + t.throws(function () { + SafeBuffer.alloc([1, 2, 3]) + }) + t.throws(function () { + SafeBuffer.alloc({}) + }) +}) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/index.js new file mode 100644 index 0000000000..94007a4aea --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/index.js @@ -0,0 +1,55 @@ +'use strict'; + +module.exports = function (req, time) { + if (req.timeoutTimer) { + return req; + } + + var delays = isNaN(time) ? time : {socket: time, connect: time}; + var host = req._headers ? (' to ' + req._headers.host) : ''; + + if (delays.connect !== undefined) { + req.timeoutTimer = setTimeout(function timeoutHandler() { + req.abort(); + var e = new Error('Connection timed out on request' + host); + e.code = 'ETIMEDOUT'; + req.emit('error', e); + }, delays.connect); + } + + // Clear the connection timeout timer once a socket is assigned to the + // request and is connected. + req.on('socket', function assign(socket) { + // Socket may come from Agent pool and may be already connected. + if (!(socket.connecting || socket._connecting)) { + connect(); + return; + } + + socket.once('connect', connect); + }); + + function clear() { + if (req.timeoutTimer) { + clearTimeout(req.timeoutTimer); + req.timeoutTimer = null; + } + } + + function connect() { + clear(); + + if (delays.socket !== undefined) { + // Abort the request if there is no activity on the socket for more + // than `delays.socket` milliseconds. + req.setTimeout(delays.socket, function socketTimeoutHandler() { + req.abort(); + var e = new Error('Socket timed out on request' + host); + e.code = 'ESOCKETTIMEDOUT'; + req.emit('error', e); + }); + } + } + + return req.on('error', clear); +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/license new file mode 100644 index 0000000000..faadd52875 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/package.json new file mode 100644 index 0000000000..dce040af9b --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + { + "raw": "timed-out@^4.0.0", + "scope": null, + "escapedName": "timed-out", + "name": "timed-out", + "rawSpec": "^4.0.0", + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "timed-out@>=4.0.0 <5.0.0", + "_id": "timed-out@4.0.1", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/timed-out", + "_nodeVersion": "6.9.3", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/timed-out-4.0.1.tgz_1484575090971_0.24377561057917774" + }, + "_npmUser": { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + "_npmVersion": "3.10.10", + "_phantomChildren": {}, + "_requested": { + "raw": "timed-out@^4.0.0", + "scope": null, + "escapedName": "timed-out", + "name": "timed-out", + "rawSpec": "^4.0.0", + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "_shasum": "f32eacac5a175bea25d7fab565ab3ed8741ef56f", + "_shrinkwrap": null, + "_spec": "timed-out@^4.0.0", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com" + }, + "bugs": { + "url": "https://github.com/floatdrop/timed-out/issues" + }, + "dependencies": {}, + "description": "Emit `ETIMEDOUT` or `ESOCKETTIMEDOUT` when ClientRequest is hanged", + "devDependencies": { + "mocha": "*", + "xo": "^0.16.0" + }, + "directories": {}, + "dist": { + "shasum": "f32eacac5a175bea25d7fab565ab3ed8741ef56f", + "tarball": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "2f00fdafb6af0a9b91fb23a04a9271766c5559a4", + "homepage": "https://github.com/floatdrop/timed-out#readme", + "keywords": [ + "http", + "https", + "get", + "got", + "url", + "uri", + "request", + "util", + "utility", + "simple" + ], + "license": "MIT", + "maintainers": [ + { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + } + ], + "name": "timed-out", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/timed-out.git" + }, + "scripts": { + "test": "xo && mocha" + }, + "version": "4.0.1" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/readme.md new file mode 100644 index 0000000000..d0eb92341e --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/readme.md @@ -0,0 +1,42 @@ +# timed-out [![Build Status](https://travis-ci.org/floatdrop/timed-out.svg?branch=master)](https://travis-ci.org/floatdrop/timed-out) + +> Timeout HTTP/HTTPS requests + +Emit Error object with `code` property equal `ETIMEDOUT` or `ESOCKETTIMEDOUT` when ClientRequest is hanged. + +## Usage + +```js +var get = require('http').get; +var timeout = require('timed-out'); + +var req = get('http://www.google.ru'); +timeout(req, 2000); // Set 2 seconds limit +``` + +### API + +#### timedout(request, time) + +##### request + +*Required* +Type: [`ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) + +The request to watch on. + +##### time + +*Required* +Type: `number` or `object` + +Time in milliseconds to wait for `connect` event on socket and also time to wait on inactive socket. + +Or you can pass Object with following fields: + +- `connect` - time to wait for connection +- `socket` - time to wait for activity on socket + +## License + +MIT © [Vsevolod Strukchinsky](floatdrop@gmail.com) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/index.js new file mode 100644 index 0000000000..e97b9937ae --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/index.js @@ -0,0 +1,36 @@ +'use strict'; +const PassThrough = require('stream').PassThrough; +const zlib = require('zlib'); + +module.exports = res => { + // TODO: use Array#includes when targeting Node.js 6 + if (['gzip', 'deflate'].indexOf(res.headers['content-encoding']) === -1) { + return res; + } + + const unzip = zlib.createUnzip(); + const stream = new PassThrough(); + + stream.httpVersion = res.httpVersion; + stream.headers = res.headers; + stream.rawHeaders = res.rawHeaders; + stream.trailers = res.trailers; + stream.rawTrailers = res.rawTrailers; + stream.setTimeout = res.setTimeout.bind(res); + stream.statusCode = res.statusCode; + stream.statusMessage = res.statusMessage; + stream.socket = res.socket; + + unzip.on('error', err => { + if (err.code === 'Z_BUF_ERROR') { + stream.end(); + return; + } + + stream.emit('error', err); + }); + + res.pipe(unzip).pipe(stream); + + return stream; +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/license new file mode 100644 index 0000000000..32a16ce321 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/license @@ -0,0 +1,21 @@ +`The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/package.json new file mode 100644 index 0000000000..fef4ccb79b --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + { + "raw": "unzip-response@^2.0.1", + "scope": null, + "escapedName": "unzip-response", + "name": "unzip-response", + "rawSpec": "^2.0.1", + "spec": ">=2.0.1 <3.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "unzip-response@>=2.0.1 <3.0.0", + "_id": "unzip-response@2.0.1", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/unzip-response", + "_nodeVersion": "4.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/unzip-response-2.0.1.tgz_1473187386171_0.46349130012094975" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": {}, + "_requested": { + "raw": "unzip-response@^2.0.1", + "scope": null, + "escapedName": "unzip-response", + "name": "unzip-response", + "rawSpec": "^2.0.1", + "spec": ">=2.0.1 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", + "_shasum": "d2f0f737d16b0615e72a6935ed04214572d56f97", + "_shrinkwrap": null, + "_spec": "unzip-response@^2.0.1", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "bugs": { + "url": "https://github.com/sindresorhus/unzip-response/issues" + }, + "dependencies": {}, + "description": "Unzip a HTTP response if needed", + "devDependencies": { + "ava": "*", + "get-stream": "^2.3.0", + "pify": "^2.3.0", + "rfpify": "^1.0.0", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "d2f0f737d16b0615e72a6935ed04214572d56f97", + "tarball": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "gitHead": "71858052fe94b89678d14ba54e8e96cacbda92c3", + "homepage": "https://github.com/sindresorhus/unzip-response#readme", + "keywords": [ + "http", + "unzip", + "zlib", + "gzip", + "deflate", + "incoming", + "message", + "response", + "stream" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + } + ], + "name": "unzip-response", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/unzip-response.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.1", + "xo": { + "esnext": true + } +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/readme.md new file mode 100644 index 0000000000..87a62c4b3d --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/readme.md @@ -0,0 +1,29 @@ +# unzip-response [![Build Status](https://travis-ci.org/sindresorhus/unzip-response.svg?branch=master)](https://travis-ci.org/sindresorhus/unzip-response) + +> Unzip a HTTP response if needed + +Unzips the response from [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) if it's gzipped/deflated, otherwise just passes it through. + + +## Install + +``` +$ npm install --save unzip-response +``` + + +## Usage + +```js +const http = require('http'); +const unzipResponse = require('unzip-response'); + +http.get('http://sindresorhus.com', res => { + res = unzipResponse(res); +}); +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/index.js new file mode 100644 index 0000000000..f9c0c65afd --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/index.js @@ -0,0 +1,14 @@ +'use strict'; +var url = require('url'); +var prependHttp = require('prepend-http'); + +module.exports = function (x) { + var withProtocol = prependHttp(x); + var parsed = url.parse(withProtocol); + + if (withProtocol !== x) { + parsed.protocol = null; + } + + return parsed; +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/index.js new file mode 100644 index 0000000000..60f532ac59 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/index.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = function (url) { + if (typeof url !== 'string') { + throw new TypeError('Expected a string, got ' + typeof url); + } + + url = url.trim(); + + if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { + return url; + } + + return url.replace(/^(?!(?:\w+:)?\/\/)/, 'http://'); +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/package.json new file mode 100644 index 0000000000..b97917ceae --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "prepend-http@^1.0.1", + "scope": null, + "escapedName": "prepend-http", + "name": "prepend-http", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax" + ] + ], + "_from": "prepend-http@>=1.0.1 <2.0.0", + "_id": "prepend-http@1.0.4", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/url-parse-lax/prepend-http", + "_nodeVersion": "4.4.2", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/prepend-http-1.0.4.tgz_1462857682803_0.5703588796313852" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.0", + "_phantomChildren": {}, + "_requested": { + "raw": "prepend-http@^1.0.1", + "scope": null, + "escapedName": "prepend-http", + "name": "prepend-http", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got/url-parse-lax" + ], + "_resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "_shasum": "d4f4562b0ce3696e41ac52d0e002e57a635dc6dc", + "_shrinkwrap": null, + "_spec": "prepend-http@^1.0.1", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/prepend-http/issues" + }, + "dependencies": {}, + "description": "Prepend `http://` to humanized URLs like todomvc.com and localhost", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "d4f4562b0ce3696e41ac52d0e002e57a635dc6dc", + "tarball": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "4f2fbbcdd5daa579c062f9e54a99c8714ddc80d8", + "homepage": "https://github.com/sindresorhus/prepend-http#readme", + "keywords": [ + "prepend", + "protocol", + "scheme", + "url", + "uri", + "http", + "https", + "humanized" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "prepend-http", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/prepend-http.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.4" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/readme.md new file mode 100644 index 0000000000..df7557e368 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/readme.md @@ -0,0 +1,31 @@ +# prepend-http [![Build Status](https://travis-ci.org/sindresorhus/prepend-http.svg?branch=master)](https://travis-ci.org/sindresorhus/prepend-http) + +> Prepend `http://` to humanized URLs like `todomvc.com` and `localhost` + + +## Install + +``` +$ npm install --save prepend-http +``` + + +## Usage + +```js +const prependHttp = require('prepend-http'); + +prependHttp('todomvc.com'); +//=> 'http://todomvc.com' + +prependHttp('localhost'); +//=> 'http://localhost' + +prependHttp('http://todomvc.com'); +//=> 'http://todomvc.com' +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/package.json new file mode 100644 index 0000000000..76db6dc3b9 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + { + "raw": "url-parse-lax@^1.0.0", + "scope": null, + "escapedName": "url-parse-lax", + "name": "url-parse-lax", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "url-parse-lax@>=1.0.0 <2.0.0", + "_id": "url-parse-lax@1.0.0", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/url-parse-lax", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "url-parse-lax@^1.0.0", + "scope": null, + "escapedName": "url-parse-lax", + "name": "url-parse-lax", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "_shasum": "7af8f303645e9bd79a272e7a14ac68bc0609da73", + "_shrinkwrap": null, + "_spec": "url-parse-lax@^1.0.0", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/url-parse-lax/issues" + }, + "dependencies": { + "prepend-http": "^1.0.1" + }, + "description": "url.parse() with support for protocol-less URLs & IPs", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "7af8f303645e9bd79a272e7a14ac68bc0609da73", + "tarball": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "1c2c7473ee75bb84a92c8aca532a6e615e531380", + "homepage": "https://github.com/sindresorhus/url-parse-lax#readme", + "keywords": [ + "url", + "uri", + "parse", + "parser", + "loose", + "lax", + "protocol", + "less", + "protocol-less", + "ip", + "ipv4", + "ipv6" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "url-parse-lax", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/url-parse-lax.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/readme.md new file mode 100644 index 0000000000..f2639446e5 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/readme.md @@ -0,0 +1,100 @@ +# url-parse-lax [![Build Status](https://travis-ci.org/sindresorhus/url-parse-lax.svg?branch=master)](https://travis-ci.org/sindresorhus/url-parse-lax) + +> [`url.parse()`](https://nodejs.org/docs/latest/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost) with support for protocol-less URLs & IPs + + +## Install + +``` +$ npm install --save url-parse-lax +``` + + +## Usage + +```js +var urlParseLax = require('url-parse-lax'); + +urlParseLax('sindresorhus.com'); +/* +{ + protocol: null, + slashes: true, + auth: null, + host: 'sindresorhus.com', + port: null, + hostname: 'sindresorhus.com', + hash: null, + search: null, + query: null, + pathname: '/', + path: '/', + href: 'http://sindresorhus.com/' +} +*/ + +urlParseLax('[2001:db8::]:8000'); +/* +{ + protocol: null, + slashes: true, + auth: null, + host: '[2001:db8::]:8000', + port: '8000', + hostname: '2001:db8::', + hash: null, + search: null, + query: null, + pathname: '/', + path: '/', + href: 'http://[2001:db8::]:8000/' +} +*/ +``` + +And with the built-in `url.parse()`: + +```js +var url = require('url'); + +url.parse('sindresorhus.com'); +/* +{ + protocol: null, + slashes: null, + auth: null, + host: null, + port: null, + hostname: null, + hash: null, + search: null, + query: null, + pathname: 'sindresorhus', + path: 'sindresorhus', + href: 'sindresorhus' +} +*/ + +url.parse('[2001:db8::]:8000'); +/* +{ + protocol: null, + slashes: null, + auth: null, + host: null, + port: null, + hostname: null, + hash: null, + search: null, + query: null, + pathname: '[2001:db8::]:8000', + path: '[2001:db8::]:8000', + href: '[2001:db8::]:8000' +} +*/ +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/package.json new file mode 100644 index 0000000000..b32273844f --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/package.json @@ -0,0 +1,141 @@ +{ + "_args": [ + [ + { + "raw": "got@^6.7.1", + "scope": null, + "escapedName": "got", + "name": "got", + "rawSpec": "^6.7.1", + "spec": ">=6.7.1 <7.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json" + ] + ], + "_from": "got@>=6.7.1 <7.0.0", + "_id": "got@6.7.1", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got", + "_nodeVersion": "6.9.2", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/got-6.7.1.tgz_1483022570319_0.12133173388428986" + }, + "_npmUser": { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "got@^6.7.1", + "scope": null, + "escapedName": "got", + "name": "got", + "rawSpec": "^6.7.1", + "spec": ">=6.7.1 <7.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json" + ], + "_resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "_shasum": "240cd05785a9a18e561dc1b44b41c763ef1e8db0", + "_shrinkwrap": null, + "_spec": "got@^6.7.1", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json", + "ava": { + "concurrency": 4 + }, + "browser": { + "unzip-response": false + }, + "bugs": { + "url": "https://github.com/sindresorhus/got/issues" + }, + "dependencies": { + "create-error-class": "^3.0.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-redirect": "^1.0.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "lowercase-keys": "^1.0.0", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "unzip-response": "^2.0.1", + "url-parse-lax": "^1.0.0" + }, + "description": "Simplified HTTP requests", + "devDependencies": { + "ava": "^0.17.0", + "coveralls": "^2.11.4", + "form-data": "^2.1.1", + "get-port": "^2.0.0", + "into-stream": "^3.0.0", + "nyc": "^10.0.0", + "pem": "^1.4.4", + "pify": "^2.3.0", + "tempfile": "^1.1.1", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "240cd05785a9a18e561dc1b44b41c763ef1e8db0", + "tarball": "https://registry.npmjs.org/got/-/got-6.7.1.tgz" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "gitHead": "52da6067ddac5250d6c2e76af9a150b9cf4ba025", + "homepage": "https://github.com/sindresorhus/got#readme", + "keywords": [ + "http", + "https", + "get", + "got", + "url", + "uri", + "request", + "util", + "utility", + "simple", + "curl", + "wget", + "fetch" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + { + "name": "kevva", + "email": "kevinmartensson@gmail.com" + } + ], + "name": "got", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/got.git" + }, + "scripts": { + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "test": "xo && nyc ava" + }, + "version": "6.7.1", + "xo": { + "esnext": true + } +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/readme.md new file mode 100644 index 0000000000..bfab067679 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/readme.md @@ -0,0 +1,335 @@ +<h1 align="center"> + <br> + <img width="360" src="https://rawgit.com/sindresorhus/got/master/media/logo.svg" alt="got"> + <br> + <br> + <br> +</h1> + +> Simplified HTTP requests + +[![Build Status](https://travis-ci.org/sindresorhus/got.svg?branch=master)](https://travis-ci.org/sindresorhus/got) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/got/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/got?branch=master) [![Downloads](https://img.shields.io/npm/dm/got.svg)](https://npmjs.com/got) + +A nicer interface to the built-in [`http`](http://nodejs.org/api/http.html) module. + +It supports following redirects, promises, streams, retries, automagically handling gzip/deflate and some convenience options. + +Created because [`request`](https://github.com/request/request) is bloated *(several megabytes!)*. + + +## Install + +**WARNING: Node.js 4 or higher is required for got@6 and above.** For older Node.js versions use [got@5](https://github.com/sindresorhus/got/tree/v5.x). + +``` +$ npm install --save got +``` + + +## Usage + +```js +const fs = require('fs'); +const got = require('got'); + +got('todomvc.com') + .then(response => { + console.log(response.body); + //=> '<!doctype html> ...' + }) + .catch(error => { + console.log(error.response.body); + //=> 'Internal server error ...' + }); + +// Streams +got.stream('todomvc.com').pipe(fs.createWriteStream('index.html')); + +// For POST, PUT and PATCH methods got.stream returns a WritableStream +fs.createReadStream('index.html').pipe(got.stream.post('todomvc.com')); +``` + + +### API + +It's a `GET` request by default, but can be changed in `options`. + +#### got(url, [options]) + +Returns a Promise for a `response` object with a `body` property, a `url` property with the request URL or the final URL after redirects, and a `requestUrl` property with the original request URL. + +##### url + +Type: `string`, `object` + +The URL to request or a [`http.request` options](https://nodejs.org/api/http.html#http_http_request_options_callback) object. + +Properties from `options` will override properties in the parsed `url`. + +##### options + +Type: `object` + +Any of the [`http.request`](http://nodejs.org/api/http.html#http_http_request_options_callback) options. + +###### body + +Type: `string`, `buffer`, `readableStream`, `object` + +*This is mutually exclusive with stream mode.* + +Body that will be sent with a `POST` request. + +If present in `options` and `options.method` is not set, `options.method` will be set to `POST`. + +If `content-length` or `transfer-encoding` is not set in `options.headers` and `body` is a string or buffer, `content-length` will be set to the body length. + +If `body` is a plain object, it will be stringified with [`querystring.stringify`](https://nodejs.org/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options) and sent as `application/x-www-form-urlencoded`. + +###### encoding + +Type: `string`, `null`<br> +Default: `'utf8'` + +Encoding to be used on `setEncoding` of the response data. If `null`, the body is returned as a Buffer. + +###### json + +Type: `boolean`<br> +Default: `false` + +*This is mutually exclusive with stream mode.* + +Parse response body with `JSON.parse` and set `accept` header to `application/json`. + +###### query + +Type: `string`, `object`<br> + +Query string object that will be added to the request URL. This will override the query string in `url`. + +###### timeout + +Type: `number`, `object` + +Milliseconds to wait for a server to send response headers before aborting request with `ETIMEDOUT` error. + +Option accepts `object` with separate `connect` and `socket` fields for connection and socket inactivity timeouts. + +###### retries + +Type: `number`, `function`<br> +Default: `5` + +Number of request retries when network errors happens. Delays between retries counts with function `1000 * Math.pow(2, retry) + Math.random() * 100`, where `retry` is attempt number (starts from 0). + +Option accepts `function` with `retry` and `error` arguments. Function must return delay in milliseconds (`0` return value cancels retry). + +**Note:** if `retries` is `number`, `ENOTFOUND` and `ENETUNREACH` error will not be retried (see full list in [`is-retry-allowed`](https://github.com/floatdrop/is-retry-allowed/blob/master/index.js#L12) module). + +###### followRedirect + +Type: `boolean`<br> +Default: `true` + +Defines if redirect responses should be followed automatically. + + +#### Streams + +#### got.stream(url, [options]) + +`stream` method will return Duplex stream with additional events: + +##### .on('request', request) + +`request` event to get the request object of the request. + +**Tip**: You can use `request` event to abort request: + +```js +got.stream('github.com') + .on('request', req => setTimeout(() => req.abort(), 50)); +``` + +##### .on('response', response) + +`response` event to get the response object of the final request. + +##### .on('redirect', response, nextOptions) + +`redirect` event to get the response object of a redirect. The second argument is options for the next request to the redirect location. + +##### .on('error', error, body, response) + +`error` event emitted in case of protocol error (like `ENOTFOUND` etc.) or status error (4xx or 5xx). The second argument is the body of the server response in case of status error. The third argument is response object. + +#### got.get(url, [options]) +#### got.post(url, [options]) +#### got.put(url, [options]) +#### got.patch(url, [options]) +#### got.head(url, [options]) +#### got.delete(url, [options]) + +Sets `options.method` to the method name and makes a request. + + +## Errors + +Each error contains (if available) `statusCode`, `statusMessage`, `host`, `hostname`, `method` and `path` properties to make debugging easier. + +In Promise mode, the `response` is attached to the error. + +#### got.RequestError + +When a request fails. Contains a `code` property with error class code, like `ECONNREFUSED`. + +#### got.ReadError + +When reading from response stream fails. + +#### got.ParseError + +When `json` option is enabled and `JSON.parse` fails. + +#### got.HTTPError + +When server response code is not 2xx. Contains `statusCode` and `statusMessage`. + +#### got.MaxRedirectsError + +When server redirects you more than 10 times. + + +## Proxies + +You can use the [`tunnel`](https://github.com/koichik/node-tunnel) module with the `agent` option to work with proxies: + +```js +const got = require('got'); +const tunnel = require('tunnel'); + +got('todomvc.com', { + agent: tunnel.httpOverHttp({ + proxy: { + host: 'localhost' + } + }) +}); +``` + + +## Cookies + +You can use the [`cookie`](https://github.com/jshttp/cookie) module to include cookies in a request: + +```js +const got = require('got'); +const cookie = require('cookie'); + +got('google.com', { + headers: { + cookie: cookie.serialize('foo', 'bar') + } +}); +``` + + +## Form data + +You can use the [`form-data`](https://github.com/form-data/form-data) module to create POST request with form data: + +```js +const fs = require('fs'); +const got = require('got'); +const FormData = require('form-data'); +const form = new FormData(); + +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +got.post('google.com', { + body: form +}); +``` + + +## OAuth + +You can use the [`oauth-1.0a`](https://github.com/ddo/oauth-1.0a) module to create a signed OAuth request: + +```js +const got = require('got'); +const crypto = require('crypto'); +const OAuth = require('oauth-1.0a'); + +const oauth = OAuth({ + consumer: { + key: process.env.CONSUMER_KEY, + secret: process.env.CONSUMER_SECRET + }, + signature_method: 'HMAC-SHA1', + hash_function: (baseString, key) => crypto.createHmac('sha1', key).update(baseString).digest('base64') +}); + +const token = { + key: process.env.ACCESS_TOKEN, + secret: process.env.ACCESS_TOKEN_SECRET +}; + +const url = 'https://api.twitter.com/1.1/statuses/home_timeline.json'; + +got(url, { + headers: oauth.toHeader(oauth.authorize({url, method: 'GET'}, token)), + json: true +}); +``` + + +## Unix Domain Sockets + +Requests can also be sent via [unix domain sockets](http://serverfault.com/questions/124517/whats-the-difference-between-unix-socket-and-tcp-ip-socket). Use the following URL scheme: `PROTOCOL://unix:SOCKET:PATH`. + +- `PROTOCOL` - `http` or `https` *(optional)* +- `SOCKET` - absolute path to a unix domain socket, e.g. `/var/run/docker.sock` +- `PATH` - request path, e.g. `/v2/keys` + +```js +got('http://unix:/var/run/docker.sock:/containers/json'); + +// or without protocol (http by default) +got('unix:/var/run/docker.sock:/containers/json'); +``` + + +## Tip + +It's a good idea to set the `'user-agent'` header so the provider can more easily see how their resource is used. By default, it's the URL to this repo. + +```js +const got = require('got'); +const pkg = require('./package.json'); + +got('todomvc.com', { + headers: { + 'user-agent': `my-module/${pkg.version} (https://github.com/username/my-module)` + } +}); +``` + + +## Related + +- [gh-got](https://github.com/sindresorhus/gh-got) - Convenience wrapper for interacting with the GitHub API +- [travis-got](https://github.com/samverschueren/travis-got) - Convenience wrapper for interacting with the Travis API + + +## Created by + +[![Sindre Sorhus](https://avatars.githubusercontent.com/u/170270?v=3&s=100)](https://sindresorhus.com) | [![Vsevolod Strukchinsky](https://avatars.githubusercontent.com/u/365089?v=3&s=100)](https://github.com/floatdrop) +---|--- +[Sindre Sorhus](https://sindresorhus.com) | [Vsevolod Strukchinsky](https://github.com/floatdrop) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) |