Socket
Socket
Sign inDemoInstall

cipm

Package Overview
Dependencies
3
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 2.0.0

node_modules/buffer-from/index.js

5

cli.js

@@ -31,3 +31,6 @@ #!/usr/bin/env node

}s`),
err => console.error(`cipm failed:\n${err.message}\n${err.stack}`)
err => {
console.error(`cipm failed:\n${err.message}\n${err.stack}`)
process.exitCode = 1
}
)

@@ -34,0 +37,0 @@ }

3.4.1 / 2018-03-08
==================
**fixes**
* [[`4d3a3b1`](http://github.com/node-modules/agentkeepalive/commit/4d3a3b1f7b16595febbbd39eeed72b2663549014)] - fix: Handle ipv6 addresses in host-header correctly with TLS (#53) (Mattias Holmlund <<u376@m1.holmlund.se>>)
**others**
* [[`55a7a5c`](http://github.com/node-modules/agentkeepalive/commit/55a7a5cd33e97f9a8370083dcb041c5552f10ac9)] - test: stop timer after test end (fengmk2 <<fengmk2@gmail.com>>)
3.4.0 / 2018-02-27

@@ -3,0 +12,0 @@ ==================

41

node_modules/agentkeepalive/lib/_http_agent.js

@@ -199,9 +199,4 @@ // Copyright Joyent, Inc. and other Node contributors.

if (!options.servername) {
options.servername = options.host;
const hostHeader = req.getHeader('host');
if (hostHeader) {
options.servername = hostHeader.replace(/:.*$/, '');
}
}
if (!options.servername)
options.servername = calculateServerName(options, req);

@@ -262,9 +257,4 @@ var name = this.getName(options);

if (!options.servername) {
options.servername = options.host;
const hostHeader = req.getHeader('host');
if (hostHeader) {
options.servername = hostHeader.replace(/:.*$/, '');
}
}
if (!options.servername)
options.servername = calculateServerName(options, req);

@@ -347,2 +337,25 @@ var name = self.getName(options);

function calculateServerName(options, req) {
let servername = options.host;
const hostHeader = req.getHeader('host');
if (hostHeader) {
// abc => abc
// abc:123 => abc
// [::1] => ::1
// [::1]:123 => ::1
if (hostHeader.startsWith('[')) {
const index = hostHeader.indexOf(']');
if (index === -1) {
// Leading '[', but no ']'. Need to do something...
servername = hostHeader;
} else {
servername = hostHeader.substr(1, index - 1);
}
} else {
servername = hostHeader.split(':', 1)[0];
}
}
return servername;
}
Agent.prototype.removeSocket = function removeSocket(s, options) {

@@ -349,0 +362,0 @@ var name = this.getName(options);

{
"_from": "agentkeepalive@^3.3.0",
"_id": "agentkeepalive@3.4.0",
"_from": "agentkeepalive@^3.4.1",
"_id": "agentkeepalive@3.4.1",
"_inBundle": false,
"_integrity": "sha512-RypT3apziwtLsJTtab5kzqADuzWaYVqFPQo7X8QSYuteaw9GGNPsB5fTy8BVcCVish3cD9yLroR7oUVlZybhpQ==",
"_integrity": "sha512-MPIwsZU9PP9kOrZpyu2042kYA8Fdt/AedQYkYXucHgF9QoD9dXVp0ypuGnHXSR0hTstBxdt85Xkh4JolYfK5wg==",
"_location": "/agentkeepalive",

@@ -11,8 +11,8 @@ "_phantomChildren": {},

"registry": true,
"raw": "agentkeepalive@^3.3.0",
"raw": "agentkeepalive@^3.4.1",
"name": "agentkeepalive",
"escapedName": "agentkeepalive",
"rawSpec": "^3.3.0",
"rawSpec": "^3.4.1",
"saveSpec": null,
"fetchSpec": "^3.3.0"
"fetchSpec": "^3.4.1"
},

@@ -22,6 +22,6 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.4.0.tgz",
"_shasum": "92487926ec1a93100a89a8a46a6b2d82513543ce",
"_spec": "agentkeepalive@^3.3.0",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/make-fetch-happen",
"_resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.4.1.tgz",
"_shasum": "aa95aebc3a749bca5ed53e3880a09f5235b48f0c",
"_spec": "agentkeepalive@^3.4.1",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/make-fetch-happen",
"author": {

@@ -83,3 +83,3 @@ "name": "fengmk2",

},
"version": "3.4.0"
"version": "3.4.1"
}

@@ -236,4 +236,4 @@ var aws4 = exports,

} else if (!normalizePath || piece !== '.') {
if (decodePath) piece = querystring.unescape(piece)
path.push(encodeRfc3986(querystring.escape(piece)))
if (decodePath) piece = decodeURIComponent(piece)
path.push(encodeRfc3986(encodeURIComponent(piece)))
}

@@ -307,3 +307,3 @@ return path

path = path.split('/').map(function(piece) {
return querystring.escape(querystring.unescape(piece))
return encodeURIComponent(decodeURIComponent(piece))
}).join('/')

@@ -310,0 +310,0 @@ }

{
"_from": "aws4@^1.6.0",
"_id": "aws4@1.6.0",
"_id": "aws4@1.7.0",
"_inBundle": false,
"_integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=",
"_integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==",
"_location": "/aws4",

@@ -21,6 +21,6 @@ "_phantomChildren": {},

],
"_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz",
"_shasum": "83ef5ca860b2b32e4a0deedee8c771b9db57471e",
"_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz",
"_shasum": "d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289",
"_spec": "aws4@^1.6.0",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/request",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/request",
"author": {

@@ -104,3 +104,3 @@ "name": "Michael Hart",

},
"version": "1.6.0"
"version": "1.7.0"
}

@@ -5,2 +5,22 @@ # Change Log

<a name="1.1.2"></a>
## [1.1.2](https://github.com/npm/bin-links/compare/v1.1.1...v1.1.2) (2018-03-22)
### Bug Fixes
* **linkMans:** return the promise! ([5eccc7f](https://github.com/npm/bin-links/commit/5eccc7f))
<a name="1.1.1"></a>
## [1.1.1](https://github.com/npm/bin-links/compare/v1.1.0...v1.1.1) (2018-03-07)
### Bug Fixes
* **shebangs:** only convert CR when doing CRLF -> LF ([#2](https://github.com/npm/bin-links/issues/2)) ([43bf857](https://github.com/npm/bin-links/commit/43bf857))
<a name="1.1.0"></a>

@@ -7,0 +27,0 @@ # [1.1.0](https://github.com/npm/bin-links/compare/v1.0.0...v1.1.0) (2017-11-20)

@@ -5,12 +5,11 @@ 'use strict'

const fs = require('graceful-fs')
const linkIfExists = require('gentle-fs').linkIfExists
const cmdShimIfExists = require('cmd-shim').ifExists
const asyncMap = require('slide').asyncMap
const BB = require('bluebird')
const linkIfExists = BB.promisify(require('gentle-fs').linkIfExists)
const cmdShimIfExists = BB.promisify(require('cmd-shim').ifExists)
const open = BB.promisify(fs.open)
const close = BB.promisify(fs.close)
const stat = BB.promisify(fs.stat)
const read = BB.promisify(fs.read, {multiArgs: true})
const chmod = BB.promisify(fs.chmod)
const Transform = require('stream').Transform
const fsWriteStreamAtomic = require('fs-write-stream-atomic')
const readFile = BB.promisify(fs.readFile)
const writeFileAtomic = BB.promisify(require('write-file-atomic'))

@@ -33,59 +32,30 @@ module.exports = BB.promisify(binLinks)

asyncMap(
[linkBins, linkMans],
function (fn, cb) {
if (!fn) return cb()
opts.log.verbose(fn.name, opts.pkgId)
fn(pkg, folder, parent, gtop, opts, cb)
},
cb
)
return BB.join(
linkBins(pkg, folder, parent, gtop, opts),
linkMans(pkg, folder, parent, gtop, opts)
).asCallback(cb)
}
function isHashbangFile (file) {
return open(file, 'r').then((fileHandle) => {
return new BB((resolve, reject) => {
fs.read(fileHandle, Buffer.from(new Array(2)), 0, 2, 0, function (err, bytesRead, buffer) {
close(fileHandle).then(() => {
resolve(!err && buffer.toString() === '#!')
}).catch(reject)
})
})
})
return open(file, 'r').then(fileHandle => {
return read(fileHandle, Buffer.alloc(2), 0, 2, 0).spread((_, buf) => {
if (!hasHashbang(buf)) return []
return read(fileHandle, Buffer.alloc(2048), 0, 2048, 0)
}).spread((_, buf) => buf && hasCR(buf), () => false)
.finally(() => close(fileHandle))
}).catch(() => false)
}
function hasHashbang (buf) {
const str = buf.toString()
return str.slice(0, 2) === '#!'
}
function hasCR (buf) {
return /^#![^\n]+\r\n/.test(buf)
}
function dos2Unix (file) {
return stat(file).then((stats) => {
let previousChunkEndedInCR = false
return new BB((resolve, reject) => {
fs.createReadStream(file)
.on('error', reject)
.pipe(new Transform({
transform: function (chunk, encoding, done) {
let data = chunk.toString()
if (previousChunkEndedInCR) {
data = '\r' + data
}
if (data[data.length - 1] === '\r') {
data = data.slice(0, -1)
previousChunkEndedInCR = true
} else {
previousChunkEndedInCR = false
}
done(null, data.replace(/\r\n/g, '\n'))
},
flush: function (done) {
if (previousChunkEndedInCR) {
this.push('\r')
}
done()
}
}))
.on('error', reject)
.pipe(fsWriteStreamAtomic(file))
.on('error', reject)
.on('finish', function () {
resolve(chmod(file, stats.mode))
})
})
return readFile(file, 'utf8').then(content => {
return writeFileAtomic(file, content.replace(/^(#![^\n]+)\r\n/, '$1\n'))
})

@@ -98,5 +68,5 @@ }

function linkBins (pkg, folder, parent, gtop, opts, cb) {
function linkBins (pkg, folder, parent, gtop, opts) {
if (!pkg.bin || (!gtop && path.basename(parent) !== 'node_modules')) {
return cb()
return
}

@@ -109,49 +79,45 @@ var linkOpts = getLinkOpts(opts, gtop && folder)

asyncMap(Object.keys(pkg.bin), function (bin, cb) {
return BB.map(Object.keys(pkg.bin), bin => {
var dest = path.resolve(binRoot, bin)
var src = path.resolve(folder, pkg.bin[bin])
linkBin(src, dest, linkOpts, function (er) {
if (er) return cb(er)
return linkBin(src, dest, linkOpts).then(() => {
// bins should always be executable.
// XXX skip chmod on windows?
fs.chmod(src, execMode, function (er) {
if (er && er.code === 'ENOENT' && opts.ignoreScripts) {
return cb()
}
if (er) return cb(er)
isHashbangFile(src).then((isHashbang) => {
if (isHashbang) {
opts.log.silly('linkBins', 'Converting line endings of hashbang file:', src)
return dos2Unix(src)
}
}).then(() => {
if (!gtop) return cb()
var dest = path.resolve(binRoot, bin)
var out = opts.parseable
? dest + '::' + src + ':BINFILE'
: dest + ' -> ' + src
return chmod(src, execMode)
}).then(() => {
return isHashbangFile(src)
}).then(isHashbang => {
if (!isHashbang) return
opts.log.silly('linkBins', 'Converting line endings of hashbang file:', src)
return dos2Unix(src)
}).then(() => {
if (!gtop) return
var dest = path.resolve(binRoot, bin)
var out = opts.parseable
? dest + '::' + src + ':BINFILE'
: dest + ' -> ' + src
if (!opts.json && !opts.parseable) {
opts.log.clearProgress()
console.log(out)
opts.log.showProgress()
}
cb()
}).catch(cb)
})
if (!opts.json && !opts.parseable) {
opts.log.clearProgress()
console.log(out)
opts.log.showProgress()
}
}).catch(err => {
if (err.code === 'ENOENT' && opts.ignoreScripts) return
throw err
})
}, cb)
})
}
function linkBin (from, to, opts, cb) {
function linkBin (from, to, opts) {
if (process.platform !== 'win32') {
return linkIfExists(from, to, opts, cb)
return linkIfExists(from, to, opts)
} else {
return cmdShimIfExists(from, to, cb)
return cmdShimIfExists(from, to)
}
}
function linkMans (pkg, folder, parent, gtop, opts, cb) {
if (!pkg.man || !gtop || process.platform === 'win32') return cb()
function linkMans (pkg, folder, parent, gtop, opts) {
if (!pkg.man || !gtop || process.platform === 'win32') return

@@ -167,16 +133,16 @@ var manRoot = path.resolve(opts.prefix, 'share', 'man')

}, {})
pkg.man = pkg.man.filter(function (man) {
var manpages = pkg.man.filter(function (man) {
return set[path.basename(man)] === man
})
asyncMap(pkg.man, function (man, cb) {
if (typeof man !== 'string') return cb()
return BB.map(manpages, man => {
if (typeof man !== 'string') return
opts.log.silly('linkMans', 'preparing to link', man)
var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/)
if (!parseMan) {
return cb(new Error(
throw new Error(
man + ' is not a valid name for a man file. ' +
'Man files must end with a number, ' +
'and optionally a .gz suffix if they are compressed.'
))
)
}

@@ -190,4 +156,4 @@

linkIfExists(manSrc, manDest, getLinkOpts(opts, gtop && folder), cb)
}, cb)
return linkIfExists(manSrc, manDest, getLinkOpts(opts, gtop && folder))
})
}
{
"_from": "bin-links@^1.1.0",
"_id": "bin-links@1.1.0",
"_from": "bin-links@^1.1.2",
"_id": "bin-links@1.1.2",
"_inBundle": false,
"_integrity": "sha512-3desjIEoSt86s+BRZlkLpBPPcHhr4vyUPL/+X1cQuE96NIlkELqnb4Yq+I5gZe47gHsZztA6cm38uMrT9+FWpA==",
"_integrity": "sha512-8eEHVgYP03nILphilltWjeIjMbKyJo3wvp9K816pHbhP301ismzw15mxAAEVQ/USUwcP++1uNrbERbp8lOA6Fg==",
"_location": "/bin-links",

@@ -11,8 +11,8 @@ "_phantomChildren": {},

"registry": true,
"raw": "bin-links@^1.1.0",
"raw": "bin-links@^1.1.2",
"name": "bin-links",
"escapedName": "bin-links",
"rawSpec": "^1.1.0",
"rawSpec": "^1.1.2",
"saveSpec": null,
"fetchSpec": "^1.1.0"
"fetchSpec": "^1.1.2"
},

@@ -22,6 +22,6 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/bin-links/-/bin-links-1.1.0.tgz",
"_shasum": "e0a92cb57f01c4dc1088bca2bae6be110b9f64f9",
"_spec": "bin-links@^1.1.0",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/libcipm",
"_resolved": "https://registry.npmjs.org/bin-links/-/bin-links-1.1.2.tgz",
"_shasum": "fb74bd54bae6b7befc6c6221f25322ac830d9757",
"_spec": "bin-links@^1.1.2",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/libcipm",
"author": {

@@ -37,6 +37,5 @@ "name": "Mike Sherov"

"cmd-shim": "^2.0.2",
"fs-write-stream-atomic": "^1.0.10",
"gentle-fs": "^2.0.0",
"graceful-fs": "^4.1.11",
"slide": "^1.1.6"
"write-file-atomic": "^2.3.0"
},

@@ -46,3 +45,5 @@ "deprecated": false,

"devDependencies": {
"mkdirp": "^0.5.1",
"nyc": "^11.1.0",
"rimraf": "^2.6.2",
"standard": "^10.0.3",

@@ -79,3 +80,3 @@ "standard-version": "^4.2.0",

},
"version": "1.1.0"
"version": "1.1.2"
}

@@ -5,2 +5,37 @@ # Change Log

<a name="11.0.2"></a>
## [11.0.2](https://github.com/zkat/cacache/compare/v11.0.1...v11.0.2) (2018-05-07)
### Bug Fixes
* **verify:** size param no longer lost in a verify ([#131](https://github.com/zkat/cacache/issues/131)) ([c614a19](https://github.com/zkat/cacache/commit/c614a19)), closes [#130](https://github.com/zkat/cacache/issues/130)
<a name="11.0.1"></a>
## [11.0.1](https://github.com/zkat/cacache/compare/v11.0.0...v11.0.1) (2018-04-10)
<a name="11.0.0"></a>
# [11.0.0](https://github.com/zkat/cacache/compare/v10.0.4...v11.0.0) (2018-04-09)
### Features
* **opts:** use figgy-pudding for opts ([#128](https://github.com/zkat/cacache/issues/128)) ([33d4eed](https://github.com/zkat/cacache/commit/33d4eed))
### meta
* drop support for node@4 ([529f347](https://github.com/zkat/cacache/commit/529f347))
### BREAKING CHANGES
* node@4 is no longer supported
<a name="10.0.4"></a>

@@ -7,0 +42,0 @@ ## [10.0.4](https://github.com/zkat/cacache/compare/v10.0.3...v10.0.4) (2018-02-16)

@@ -5,2 +5,3 @@ 'use strict'

const figgyPudding = require('figgy-pudding')
const fs = require('fs')

@@ -14,2 +15,8 @@ const index = require('./lib/entry-index')

const GetOpts = figgyPudding({
integrity: {},
memoize: {},
size: {}
})
module.exports = function get (cache, key, opts) {

@@ -22,7 +29,7 @@ return getData(false, cache, key, opts)

function getData (byDigest, cache, key, opts) {
opts = opts || {}
opts = GetOpts(opts)
const memoized = (
byDigest
? memo.get.byDigest(cache, key, opts)
: memo.get(cache, key, opts)
? memo.get.byDigest(cache, key, opts)
: memo.get(cache, key, opts)
)

@@ -64,3 +71,3 @@ if (memoized && opts.memoize !== false) {

function getStream (cache, key, opts) {
opts = opts || {}
opts = GetOpts(opts)
let stream = through()

@@ -98,3 +105,2 @@ const memoized = memo.get(cache, key, opts)

}
opts.size = opts.size == null ? entry.size : opts.size
stream.emit('metadata', entry.metadata)

@@ -109,3 +115,5 @@ stream.emit('integrity', entry.integrity)

pipe(
read.readStream(cache, entry.integrity, opts),
read.readStream(cache, entry.integrity, opts.concat({
size: opts.size == null ? entry.size : opts.size
})),
memoStream,

@@ -120,3 +128,3 @@ stream

function getStreamDigest (cache, integrity, opts) {
opts = opts || {}
opts = GetOpts(opts)
const memoized = memo.get.byDigest(cache, integrity, opts)

@@ -153,3 +161,3 @@ if (memoized && opts.memoize !== false) {

function info (cache, key, opts) {
opts = opts || {}
opts = GetOpts(opts)
const memoized = memo.get(cache, key, opts)

@@ -172,3 +180,3 @@ if (memoized && opts.memoize !== false) {

function copy (byDigest, cache, key, dest, opts) {
opts = opts || {}
opts = GetOpts(opts)
if (read.copy) {

@@ -192,9 +200,9 @@ return (

return fs.writeFileAsync(dest, byDigest ? res : res.data)
.then(() => byDigest ? key : {
metadata: res.metadata,
size: res.size,
integrity: res.integrity
})
.then(() => byDigest ? key : {
metadata: res.metadata,
size: res.size,
integrity: res.integrity
})
})
}
}

@@ -6,2 +6,3 @@ 'use strict'

const contentPath = require('./path')
const figgyPudding = require('figgy-pudding')
const fs = require('graceful-fs')

@@ -15,5 +16,9 @@ const PassThrough = require('stream').PassThrough

const ReadOpts = figgyPudding({
size: {}
})
module.exports = read
function read (cache, integrity, opts) {
opts = opts || {}
opts = ReadOpts(opts)
return pickContentSri(cache, integrity).then(content => {

@@ -37,3 +42,3 @@ const sri = content.sri

function readStream (cache, integrity, opts) {
opts = opts || {}
opts = ReadOpts(opts)
const stream = new PassThrough()

@@ -62,3 +67,3 @@ pickContentSri(

function copy (cache, integrity, dest, opts) {
opts = opts || {}
opts = ReadOpts(opts)
return pickContentSri(cache, integrity).then(content => {

@@ -75,13 +80,13 @@ const sri = content.sri

return pickContentSri(cache, integrity)
.catch({code: 'ENOENT'}, () => false)
.catch({code: 'EPERM'}, err => {
if (process.platform !== 'win32') {
throw err
} else {
return false
}
}).then(content => {
if (!content.sri) return false
return ({ sri: content.sri, size: content.stat.size })
})
.catch({code: 'ENOENT'}, () => false)
.catch({code: 'EPERM'}, err => {
if (process.platform !== 'win32') {
throw err
} else {
return false
}
}).then(content => {
if (!content.sri) return false
return ({ sri: content.sri, size: content.stat.size })
})
}

@@ -103,12 +108,12 @@

}))
.catch(err => {
if ([].some.call(err, e => e.code === 'ENOENT')) {
throw Object.assign(
new Error('No matching content found for ' + sri.toString()),
{code: 'ENOENT'}
)
} else {
throw err[0]
}
})
.catch(err => {
if ([].some.call(err, e => e.code === 'ENOENT')) {
throw Object.assign(
new Error('No matching content found for ' + sri.toString()),
{code: 'ENOENT'}
)
} else {
throw err[0]
}
})
}

@@ -115,0 +120,0 @@ }

@@ -31,3 +31,5 @@ 'use strict'

}
const sri = ssri.fromData(data, opts)
const sri = ssri.fromData(data, {
algorithms: opts.algorithms
})
if (opts.integrity && !ssri.checkData(data, opts.integrity, opts)) {

@@ -34,0 +36,0 @@ return BB.reject(checksumError(opts.integrity, sri))

@@ -7,2 +7,3 @@ 'use strict'

const crypto = require('crypto')
const figgyPudding = require('figgy-pudding')
const fixOwner = require('./util/fix-owner')

@@ -33,5 +34,12 @@ const fs = require('graceful-fs')

const IndexOpts = figgyPudding({
metadata: {},
size: {},
uid: {},
gid: {}
})
module.exports.insert = insert
function insert (cache, key, integrity, opts) {
opts = opts || {}
opts = IndexOpts(opts)
const bucket = bucketPath(cache, key)

@@ -202,5 +210,5 @@ const entry = {

return crypto
.createHash(digest)
.update(str)
.digest('hex')
.createHash(digest)
.update(str)
.digest('hex')
}

@@ -223,4 +231,4 @@

return readdirAsync(dir)
.catch({code: 'ENOENT'}, () => [])
.catch({code: 'ENOTDIR'}, () => [])
.catch({code: 'ENOENT'}, () => [])
.catch({code: 'ENOTDIR'}, () => [])
}

@@ -227,0 +235,0 @@

@@ -5,2 +5,3 @@ 'use strict'

const figgyPudding = require('figgy-pudding')
const fixOwner = require('./fix-owner')

@@ -11,5 +12,11 @@ const path = require('path')

const TmpOpts = figgyPudding({
tmpPrefix: {},
uid: {},
gid: {}
})
module.exports.mkdir = mktmpdir
function mktmpdir (cache, opts) {
opts = opts || {}
opts = TmpOpts(opts)
const tmpTarget = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix)

@@ -27,3 +34,3 @@ return fixOwner.mkdirfix(tmpTarget, opts.uid, opts.gid).then(() => {

}
opts = opts || {}
opts = TmpOpts(opts)
return BB.using(mktmpdir(cache, opts).disposer(rimraf), cb)

@@ -34,3 +41,4 @@ }

function fixtmpdir (cache, opts) {
opts = TmpOpts(opts)
return fixOwner(path.join(cache, 'tmp'), opts.uid, opts.gid)
}

@@ -6,2 +6,3 @@ 'use strict'

const contentPath = require('./content/path')
const figgyPudding = require('figgy-pudding')
const finished = BB.promisify(require('mississippi').finished)

@@ -18,6 +19,18 @@ const fixOwner = require('./util/fix-owner')

const VerifyOpts = figgyPudding({
concurrency: {
default: 20
},
filter: {},
log: {
default: { silly () {} }
},
uid: {},
gid: {}
})
module.exports = verify
function verify (cache, opts) {
opts = opts || {}
opts.log && opts.log.silly('verify', 'verifying cache at', cache)
opts = VerifyOpts(opts)
opts.log.silly('verify', 'verifying cache at', cache)
return BB.reduce([

@@ -45,3 +58,3 @@ markStartTime,

stats.runTime.total = stats.endTime - stats.startTime
opts.log && opts.log.silly('verify', 'verification finished for', cache, 'in', `${stats.runTime.total}ms`)
opts.log.silly('verify', 'verification finished for', cache, 'in', `${stats.runTime.total}ms`)
})

@@ -59,3 +72,3 @@ }

function fixPerms (cache, opts) {
opts.log && opts.log.silly('verify', 'fixing cache permissions')
opts.log.silly('verify', 'fixing cache permissions')
return fixOwner.mkdirfix(cache, opts.uid, opts.gid).then(() => {

@@ -77,7 +90,7 @@ // TODO - fix file permissions too

function garbageCollect (cache, opts) {
opts.log && opts.log.silly('verify', 'garbage collecting content')
opts.log.silly('verify', 'garbage collecting content')
const indexStream = index.lsStream(cache)
const liveContent = new Set()
indexStream.on('data', entry => {
if (opts && opts.filter && !opts.filter(entry)) { return }
if (opts.filter && !opts.filter(entry)) { return }
liveContent.add(entry.integrity.toString())

@@ -125,3 +138,3 @@ })

}
}, {concurrency: opts.concurrency || 20}))
}, {concurrency: opts.concurrency}))
})

@@ -150,3 +163,3 @@ })

function rebuildIndex (cache, opts) {
opts.log && opts.log.silly('verify', 'rebuilding index')
opts.log.silly('verify', 'rebuilding index')
return index.ls(cache).then(entries => {

@@ -163,3 +176,3 @@ const stats = {

const entry = entries[k]
const excluded = opts && opts.filter && !opts.filter(entry)
const excluded = opts.filter && !opts.filter(entry)
excluded && stats.rejectedEntries++

@@ -181,3 +194,3 @@ if (buckets[hashed] && !excluded) {

return rebuildBucket(cache, buckets[key], stats, opts)
}, {concurrency: opts.concurrency || 20}).then(() => stats)
}, {concurrency: opts.concurrency}).then(() => stats)
})

@@ -196,3 +209,4 @@ }

gid: opts.gid,
metadata: entry.metadata
metadata: entry.metadata,
size: entry.size
}).then(() => { stats.totalEntries++ })

@@ -208,3 +222,3 @@ }).catch({code: 'ENOENT'}, () => {

function cleanTmp (cache, opts) {
opts.log && opts.log.silly('verify', 'cleaning tmp directory')
opts.log.silly('verify', 'cleaning tmp directory')
return rimraf(path.join(cache, 'tmp'))

@@ -215,3 +229,3 @@ }

const verifile = path.join(cache, '_lastverified')
opts.log && opts.log.silly('verify', 'writing verifile to ' + verifile)
opts.log.silly('verify', 'writing verifile to ' + verifile)
return fs.writeFileAsync(verifile, '' + (+(new Date())))

@@ -218,0 +232,0 @@ }

{
"_from": "cacache@^10.0.4",
"_id": "cacache@10.0.4",
"_from": "cacache@^11.0.2",
"_id": "cacache@11.0.2",
"_inBundle": false,
"_integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==",
"_integrity": "sha512-hMiz7LN4w8sdfmKsvNs80ao/vf2JCGWWdpu95JyY90AJZRbZJmgE71dCefRiNf8OCqiZQDcUBfYiLlUNu4/j5A==",
"_location": "/cacache",

@@ -11,8 +11,8 @@ "_phantomChildren": {},

"registry": true,
"raw": "cacache@^10.0.4",
"raw": "cacache@^11.0.2",
"name": "cacache",
"escapedName": "cacache",
"rawSpec": "^10.0.4",
"rawSpec": "^11.0.2",
"saveSpec": null,
"fetchSpec": "^10.0.4"
"fetchSpec": "^11.0.2"
},

@@ -23,6 +23,6 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz",
"_shasum": "6452367999eff9d4188aefd9a14e9d7c6a263460",
"_spec": "cacache@^10.0.4",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/pacote",
"_resolved": "https://registry.npmjs.org/cacache/-/cacache-11.0.2.tgz",
"_shasum": "ff30541a05302200108a759e660e30786f788764",
"_spec": "cacache@^11.0.2",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/pacote",
"author": {

@@ -61,6 +61,7 @@ "name": "Kat Marchán",

"chownr": "^1.0.1",
"figgy-pudding": "^3.1.0",
"glob": "^7.1.2",
"graceful-fs": "^4.1.11",
"lru-cache": "^4.1.1",
"mississippi": "^2.0.0",
"lru-cache": "^4.1.2",
"mississippi": "^3.0.0",
"mkdirp": "^0.5.1",

@@ -70,3 +71,3 @@ "move-concurrently": "^1.0.1",

"rimraf": "^2.6.2",
"ssri": "^5.2.4",
"ssri": "^6.0.0",
"unique-filename": "^1.1.0",

@@ -79,11 +80,10 @@ "y18n": "^4.0.0"

"benchmark": "^2.1.4",
"chalk": "^2.3.1",
"cross-env": "^5.1.3",
"nyc": "^11.4.1",
"chalk": "^2.3.2",
"cross-env": "^5.1.4",
"require-inject": "^1.4.2",
"safe-buffer": "^5.1.1",
"standard": "^10.0.3",
"standard": "^11.0.1",
"standard-version": "^4.3.0",
"tacks": "^1.2.2",
"tap": "^11.1.0",
"tap": "^11.1.3",
"weallbehave": "^1.2.0",

@@ -126,3 +126,3 @@ "weallcontribute": "^1.0.8"

"release": "standard-version -s",
"test": "cross-env CACACHE_UPDATE_LOCALE_FILES=true nyc --all -- tap -J test/*.js",
"test": "cross-env CACACHE_UPDATE_LOCALE_FILES=true tap --coverage --nyc-arg=--all -J test/*.js",
"test-docker": "docker run -it --rm --name pacotest -v \"$PWD\":/tmp -w /tmp node:latest npm test",

@@ -132,3 +132,3 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'",

},
"version": "10.0.4"
"version": "11.0.2"
}
'use strict'
const figgyPudding = require('figgy-pudding')
const index = require('./lib/entry-index')

@@ -8,9 +9,22 @@ const memo = require('./lib/memoization')

const PutOpts = figgyPudding({
algorithms: {
default: ['sha512']
},
integrity: {},
memoize: {},
metadata: {},
size: {},
tmpPrefix: {},
uid: {},
gid: {}
})
module.exports = putData
function putData (cache, key, data, opts) {
opts = opts || {}
opts = PutOpts(opts)
return write(cache, data, opts).then(res => {
// TODO - stop modifying opts
opts.size = res.size
return index.insert(cache, key, res.integrity, opts).then(entry => {
return index.insert(
cache, key, res.integrity, opts.concat({size: res.size})
).then(entry => {
if (opts.memoize) {

@@ -26,3 +40,3 @@ memo.put(cache, entry, data, opts)

function putStream (cache, key, opts) {
opts = opts || {}
opts = PutOpts(opts)
let integrity

@@ -50,5 +64,3 @@ let size

contentStream.end(() => {
// TODO - stop modifying `opts`
opts.size = size
index.insert(cache, key, integrity, opts).then(entry => {
index.insert(cache, key, integrity, opts.concat({size})).then(entry => {
if (opts.memoize) {

@@ -55,0 +67,0 @@ memo.put(cache, entry, Buffer.concat(memoData, memoTotal), opts)

@@ -5,2 +5,38 @@ # Change Log

<a name="4.1.0"></a>
# [4.1.0](https://github.com/yargs/cliui/compare/v4.0.0...v4.1.0) (2018-04-23)
### Features
* add resetOutput method ([#57](https://github.com/yargs/cliui/issues/57)) ([7246902](https://github.com/yargs/cliui/commit/7246902))
<a name="4.0.0"></a>
# [4.0.0](https://github.com/yargs/cliui/compare/v3.2.0...v4.0.0) (2017-12-18)
### Bug Fixes
* downgrades strip-ansi to version 3.0.1 ([#54](https://github.com/yargs/cliui/issues/54)) ([5764c46](https://github.com/yargs/cliui/commit/5764c46))
* set env variable FORCE_COLOR. ([#56](https://github.com/yargs/cliui/issues/56)) ([7350e36](https://github.com/yargs/cliui/commit/7350e36))
### Chores
* drop support for node < 4 ([#53](https://github.com/yargs/cliui/issues/53)) ([b105376](https://github.com/yargs/cliui/commit/b105376))
### Features
* add fallback for window width ([#45](https://github.com/yargs/cliui/issues/45)) ([d064922](https://github.com/yargs/cliui/commit/d064922))
### BREAKING CHANGES
* officially drop support for Node < 4
<a name="3.2.0"></a>

@@ -7,0 +43,0 @@ # [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11)

@@ -24,2 +24,6 @@ var stringWidth = require('string-width')

UI.prototype.resetOutput = function () {
this.rows = []
}
UI.prototype.div = function () {

@@ -213,3 +217,3 @@ if (arguments.length === 0) this.div('')

col.width = widths[c]
if (_this.wrap) wrapped = wrap(col.text, _this._negatePadding(col), {hard: true}).split('\n')
if (_this.wrap) wrapped = wrap(col.text, _this._negatePadding(col), { hard: true }).split('\n')
else wrapped = col.text.split('\n')

@@ -287,2 +291,6 @@

function getWindowWidth () {
if (typeof process === 'object' && process.stdout && process.stdout.columns) return process.stdout.columns
}
function alignRight (str, width) {

@@ -316,5 +324,5 @@ str = str.trim()

return new UI({
width: (opts || {}).width || 80,
width: (opts || {}).width || getWindowWidth() || 80,
wrap: typeof opts.wrap === 'boolean' ? opts.wrap : true
})
}
{
"_args": [
[
"cliui@3.2.0",
"/Users/zkat/Documents/code/libcipm/bin"
]
],
"_from": "cliui@3.2.0",
"_id": "cliui@3.2.0",
"_from": "cliui@^4.0.0",
"_id": "cliui@4.1.0",
"_inBundle": false,
"_integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
"_integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==",
"_location": "/cliui",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "cliui@3.2.0",
"raw": "cliui@^4.0.0",
"name": "cliui",
"escapedName": "cliui",
"rawSpec": "3.2.0",
"rawSpec": "^4.0.0",
"saveSpec": null,
"fetchSpec": "3.2.0"
"fetchSpec": "^4.0.0"
},

@@ -27,5 +21,6 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
"_spec": "3.2.0",
"_where": "/Users/zkat/Documents/code/libcipm/bin",
"_resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
"_shasum": "348422dbe82d800b3022eef4f6ac10bf2e4d1b49",
"_spec": "cliui@^4.0.0",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/yargs",
"author": {

@@ -38,2 +33,3 @@ "name": "Ben Coe",

},
"bundleDependencies": false,
"config": {

@@ -52,6 +48,7 @@ "blanket": {

"dependencies": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1",
"string-width": "^2.1.1",
"strip-ansi": "^4.0.0",
"wrap-ansi": "^2.0.0"
},
"deprecated": false,
"description": "easily create complex multi-column command-line-interfaces",

@@ -62,7 +59,10 @@ "devDependencies": {

"coveralls": "^2.11.8",
"mocha": "^2.4.5",
"nyc": "^6.4.0",
"standard": "^6.0.8",
"standard-version": "^2.1.2"
"mocha": "^3.0.0",
"nyc": "^10.0.0",
"standard": "^8.0.0",
"standard-version": "^3.0.0"
},
"engine": {
"node": ">=4"
},
"files": [

@@ -91,4 +91,4 @@ "index.js"

"pretest": "standard",
"test": "nyc mocha",
"version": "standard-version"
"release": "standard-version",
"test": "nyc mocha"
},

@@ -103,3 +103,3 @@ "standard": {

},
"version": "3.2.0"
"version": "4.1.0"
}

@@ -13,5 +13,3 @@ # cliui

```js
var ui = require('cliui')({
width: 80
})
var ui = require('cliui')()

@@ -92,2 +90,3 @@ ui.div('Usage: $0 [command] [options]')

Specify the maximum width of the UI being generated.
If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`.

@@ -104,2 +103,3 @@ ### cliui({wrap: boolean})

* **text:** some text to place in the column.
* **width:** the width of a column.

@@ -114,1 +114,6 @@ * **align:** alignment, `right` or `center`.

a new line being created.
### cliui.resetOutput()
Resets the UI elements of the current cliui instance, maintaining the values
set for `width` and `wrap`.
var Writable = require('readable-stream').Writable
var inherits = require('inherits')
var bufferFrom = require('buffer-from')

@@ -90,5 +91,5 @@ if (typeof Uint8Array === 'undefined') {

} else if (isBufferish(p)) {
strings.push(new Buffer(p))
strings.push(bufferFrom(p))
} else {
strings.push(new Buffer(String(p)))
strings.push(bufferFrom(String(p)))
}

@@ -112,5 +113,5 @@ }

} else if (isBufferish(p)) {
bufs.push(new Buffer(p))
bufs.push(bufferFrom(p))
} else {
bufs.push(new Buffer(String(p)))
bufs.push(bufferFrom(String(p)))
}

@@ -133,3 +134,3 @@ }

if (typeof parts[i] === 'string') {
parts[i] = new Buffer(parts[i])
parts[i] = bufferFrom(parts[i])
}

@@ -136,0 +137,0 @@ len += parts[i].length

{
"_from": "concat-stream@^1.5.0",
"_id": "concat-stream@1.6.1",
"_id": "concat-stream@1.6.2",
"_inBundle": false,
"_integrity": "sha512-gslSSJx03QKa59cIKqeJO9HQ/WZMotvYJCuaUULrLpjj8oG40kV2Z+gz82pVxlTkOADi4PJxQPPfhl1ELYrrXw==",
"_integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"_location": "/concat-stream",

@@ -19,9 +19,8 @@ "_phantomChildren": {},

"_requiredBy": [
"/make-fetch-happen/mississippi",
"/mississippi"
],
"_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.1.tgz",
"_shasum": "261b8f518301f1d834e36342b9fea095d2620a26",
"_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
"_shasum": "904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34",
"_spec": "concat-stream@^1.5.0",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/mississippi",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/mississippi",
"author": {

@@ -36,2 +35,3 @@ "name": "Max Ogden",

"dependencies": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",

@@ -85,3 +85,3 @@ "readable-stream": "^2.2.2",

},
"version": "1.6.1"
"version": "1.6.2"
}

@@ -65,3 +65,3 @@ # concat-stream

write.write('!')
write.end(Buffer('!!1'))
write.end(Buffer.from('!!1'))
```

@@ -68,0 +68,0 @@

3.1.0 / 2017-09-26
==================
* Add `DEBUG_HIDE_DATE` env var (#486)
* Remove ReDoS regexp in %o formatter (#504)
* Remove "component" from package.json
* Remove `component.json`
* Ignore package-lock.json
* Examples: fix colors printout
* Fix: browser detection
* Fix: spelling mistake (#496, @EdwardBetts)
3.0.1 / 2017-08-24
==================
* Fix: Disable colors in Edge and Internet Explorer (#489)
3.0.0 / 2017-08-08
==================
* Breaking: Remove DEBUG_FD (#406)
* Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418)
* Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408)
* Addition: document `enabled` flag (#465)
* Addition: add 256 colors mode (#481)
* Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440)
* Update: component: update "ms" to v2.0.0
* Update: separate the Node and Browser tests in Travis-CI
* Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots
* Update: separate Node.js and web browser examples for organization
* Update: update "browserify" to v14.4.0
* Fix: fix Readme typo (#473)
2.6.9 / 2017-09-22

@@ -30,3 +63,3 @@ ==================

* Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
* Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
* Chore: ignore bower.json in npm installations. (#437, @joaovieira)

@@ -33,0 +66,0 @@ * Misc: update "ms" to v0.7.3 (@tootallnate)

{
"_from": "debug@2",
"_id": "debug@2.6.9",
"_from": "debug@3.1.0",
"_id": "debug@3.1.0",
"_inBundle": false,
"_integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"_integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"_location": "/debug",
"_phantomChildren": {},
"_requested": {
"type": "range",
"type": "version",
"registry": true,
"raw": "debug@2",
"raw": "debug@3.1.0",
"name": "debug",
"escapedName": "debug",
"rawSpec": "2",
"rawSpec": "3.1.0",
"saveSpec": null,
"fetchSpec": "2"
"fetchSpec": "3.1.0"
},
"_requiredBy": [
"/http-proxy-agent"
"/http-proxy-agent",
"/https-proxy-agent"
],
"_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"_shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
"_spec": "debug@2",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/http-proxy-agent",
"_resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"_shasum": "5bb5a0672628b64149566ba16819e61518c67261",
"_spec": "debug@3.1.0",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/http-proxy-agent",
"author": {

@@ -34,8 +35,2 @@ "name": "TJ Holowaychuk",

"bundleDependencies": false,
"component": {
"scripts": {
"debug/index.js": "browser.js",
"debug/debug.js": "debug.js"
}
},
"contributors": [

@@ -58,3 +53,3 @@ {

"devDependencies": {
"browserify": "9.0.3",
"browserify": "14.4.0",
"chai": "^3.5.0",

@@ -89,3 +84,3 @@ "concurrently": "^3.1.0",

},
"version": "2.6.9"
"version": "3.1.0"
}
# debug
[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers)
[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
A tiny JavaScript debugging utility modelled after Node.js core's debugging
technique. Works in Node.js and web browsers.
A tiny node.js debugging utility modelled after node core's debugging technique.
**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)**
## Installation

@@ -21,3 +20,3 @@

Example _app.js_:
Example [_app.js_](./examples/node/app.js):

@@ -31,3 +30,3 @@ ```js

debug('booting %s', name);
debug('booting %o', name);

@@ -46,58 +45,104 @@ http.createServer(function(req, res){

Example _worker.js_:
Example [_worker.js_](./examples/node/worker.js):
```js
var debug = require('debug')('worker');
var a = require('debug')('worker:a')
, b = require('debug')('worker:b');
setInterval(function(){
debug('doing some work');
}, 1000);
function work() {
a('doing lots of uninteresting work');
setTimeout(work, Math.random() * 1000);
}
work();
function workb() {
b('doing some work');
setTimeout(workb, Math.random() * 2000);
}
workb();
```
The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
The `DEBUG` environment variable is then used to enable these based on space or
comma-delimited names.
![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
Here are some examples:
![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
#### Windows note
On Windows the environment variable is set using the `set` command.
On Windows the environment variable is set using the `set` command.
```cmd
set DEBUG=*,-not_this
```
```cmd
set DEBUG=*,-not_this
```
Note that PowerShell uses different syntax to set environment variables.
Note that PowerShell uses different syntax to set environment variables.
```cmd
$env:DEBUG = "*,-not_this"
```
```cmd
$env:DEBUG = "*,-not_this"
```
Then, run the program to be debugged as usual.
## Namespace Colors
Every debug instance has a color generated for it based on its namespace name.
This helps when visually parsing the debug output to identify which debug instance
a debug line belongs to.
#### Node.js
In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
otherwise debug will only use a small handful of basic colors.
<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">
#### Web Browser
Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
option. These are WebKit web inspectors, Firefox ([since version
31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
and the Firebug plugin for Firefox (any version).
<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">
## Millisecond diff
When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">
## Conventions
If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output.
## Wildcards
The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
The `*` character may be used as a wildcard. Suppose for example your library has
debuggers named "connect:bodyParser", "connect:compress", "connect:session",
instead of listing all three with
`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
You can also exclude specific debuggers by prefixing them with a "-" character.
For example, `DEBUG=*,-connect:*` would include all debuggers except those
starting with "connect:".
## Environment Variables
When running through Node.js, you can set a few environment variables that will
change the behavior of the debug logging:
When running through Node.js, you can set a few environment variables that will
change the behavior of the debug logging:

@@ -107,18 +152,19 @@ | Name | Purpose |

| `DEBUG` | Enables/disables specific debugging namespaces. |
| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). |
| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
| `DEBUG_DEPTH` | Object inspection depth. |
| `DEBUG_DEPTH` | Object inspection depth. |
| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
__Note:__ The environment variables beginning with `DEBUG_` end up being
converted into an Options object that gets used with `%o`/`%O` formatters.
See the Node.js documentation for
[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
for the complete list.
__Note:__ The environment variables beginning with `DEBUG_` end up being
converted into an Options object that gets used with `%o`/`%O` formatters.
See the Node.js documentation for
[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
for the complete list.
## Formatters
Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
Below are the officially supported formatters:
Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters:
| Formatter | Representation |

@@ -133,5 +179,8 @@ |-----------|----------------|

### Custom formatters
You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like:
You can add custom formatters by extending the `debug.formatters` object.
For example, if you wanted to add support for rendering a Buffer as hex with
`%h`, you could do something like:

@@ -150,11 +199,13 @@ ```js

## Browser support
You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
if you don't want to build it yourself.
Debug's enable state is currently persisted by `localStorage`.
Consider the situation shown below where you have `worker:a` and `worker:b`,
and wish to debug both. You can enable this using `localStorage.debug`:
## Browser Support
You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
if you don't want to build it yourself.
Debug's enable state is currently persisted by `localStorage`.
Consider the situation shown below where you have `worker:a` and `worker:b`,
and wish to debug both. You can enable this using `localStorage.debug`:
```js

@@ -179,14 +230,3 @@ localStorage.debug = 'worker:*'

#### Web Inspector Colors
Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
option. These are WebKit web inspectors, Firefox ([since version
31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
and the Firebug plugin for Firefox (any version).
Colored output looks something like:
![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
## Output streams

@@ -196,3 +236,3 @@

Example _stdout.js_:
Example [_stdout.js_](./examples/node/stdout.js):

@@ -219,3 +259,19 @@ ```js

## Checking whether a debug target is enabled
After you've created a debug instance, you can determine whether or not it is
enabled by checking the `enabled` property:
```javascript
const debug = require('debug')('http');
if (debug.enabled) {
// do stuff...
}
```
You can also manually toggle this property to force the debug instance to be
enabled or disabled.
## Authors

@@ -226,3 +282,3 @@

- Andrew Rhyne
## Backers

@@ -303,3 +359,3 @@

Copyright (c) 2014-2016 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
Copyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt;

@@ -306,0 +362,0 @@ Permission is hereby granted, free of charge, to any person obtaining

@@ -23,8 +23,13 @@ /**

exports.colors = [
'lightseagreen',
'forestgreen',
'goldenrod',
'dodgerblue',
'darkorchid',
'crimson'
'#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
'#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
'#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
'#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
'#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
'#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
'#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
'#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
'#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
'#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
'#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
];

@@ -48,2 +53,7 @@

// Internet Explorer and Edge do not support colors.
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
return false;
}
// is webkit? http://stackoverflow.com/a/16459606/376773

@@ -50,0 +60,0 @@ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632

@@ -17,2 +17,7 @@

/**
* Active `debug` instances.
*/
exports.instances = [];
/**
* The currently active debug mode names, and names to skip.

@@ -33,8 +38,2 @@ */

/**
* Previous log timestamp.
*/
var prevTime;
/**
* Select a color.

@@ -67,2 +66,4 @@ * @param {String} namespace

var prevTime;
function debug() {

@@ -124,2 +125,3 @@ // disabled?

debug.color = selectColor(namespace);
debug.destroy = destroy;

@@ -131,5 +133,17 @@ // env-specific initialization logic for debug instances

exports.instances.push(debug);
return debug;
}
function destroy () {
var index = exports.instances.indexOf(this);
if (index !== -1) {
exports.instances.splice(index, 1);
return true;
} else {
return false;
}
}
/**

@@ -149,6 +163,7 @@ * Enables a debug mode by namespaces. This can include modes

var i;
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
var len = split.length;
for (var i = 0; i < len; i++) {
for (i = 0; i < len; i++) {
if (!split[i]) continue; // ignore empty strings

@@ -162,2 +177,7 @@ namespaces = split[i].replace(/\*/g, '.*?');

}
for (i = 0; i < exports.instances.length; i++) {
var instance = exports.instances[i];
instance.enabled = exports.enabled(instance.namespace);
}
}

@@ -184,2 +204,5 @@

function enabled(name) {
if (name[name.length - 1] === '*') {
return true;
}
var i, len;

@@ -186,0 +209,0 @@ for (i = 0, len = exports.skips.length; i < len; i++) {

@@ -6,3 +6,3 @@ /**

if (typeof process !== 'undefined' && process.type === 'renderer') {
if (typeof process === 'undefined' || process.type === 'renderer') {
module.exports = require('./browser.js');

@@ -9,0 +9,0 @@ } else {

@@ -26,4 +26,19 @@ /**

exports.colors = [6, 2, 3, 4, 5, 1];
exports.colors = [ 6, 2, 3, 4, 5, 1 ];
try {
var supportsColor = require('supports-color');
if (supportsColor && supportsColor.level >= 2) {
exports.colors = [
20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68,
69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134,
135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204,
205, 206, 207, 208, 209, 214, 215, 220, 221
];
}
} catch (err) {
// swallow - we only care if `supports-color` is available; it doesn't have to be.
}
/**

@@ -56,19 +71,2 @@ * Build up the default `inspectOpts` object from the environment variables.

/**
* The file descriptor to write the `debug()` calls to.
* Set the `DEBUG_FD` env variable to override with another value. i.e.:
*
* $ DEBUG_FD=3 node script.js 3>debug.log
*/
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
if (1 !== fd && 2 !== fd) {
util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
}
var stream = 1 === fd ? process.stdout :
2 === fd ? process.stderr :
createWritableStdioStream(fd);
/**
* Is stdout a TTY? Colored output is enabled when `true`.

@@ -80,3 +78,3 @@ */

? Boolean(exports.inspectOpts.colors)
: tty.isatty(fd);
: tty.isatty(process.stderr.fd);
}

@@ -117,18 +115,26 @@

var c = this.color;
var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c);
var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m';
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
} else {
args[0] = new Date().toUTCString()
+ ' ' + name + ' ' + args[0];
args[0] = getDate() + name + ' ' + args[0];
}
}
function getDate() {
if (exports.inspectOpts.hideDate) {
return '';
} else {
return new Date().toISOString() + ' ';
}
}
/**
* Invokes `util.format()` with the specified arguments and writes to `stream`.
* Invokes `util.format()` with the specified arguments and writes to stderr.
*/
function log() {
return stream.write(util.format.apply(util, arguments) + '\n');
return process.stderr.write(util.format.apply(util, arguments) + '\n');
}

@@ -165,70 +171,2 @@

/**
* Copied from `node/src/node.js`.
*
* XXX: It's lame that node doesn't expose this API out-of-the-box. It also
* relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
*/
function createWritableStdioStream (fd) {
var stream;
var tty_wrap = process.binding('tty_wrap');
// Note stream._type is used for test-module-load-list.js
switch (tty_wrap.guessHandleType(fd)) {
case 'TTY':
stream = new tty.WriteStream(fd);
stream._type = 'tty';
// Hack to have stream not keep the event loop alive.
// See https://github.com/joyent/node/issues/1726
if (stream._handle && stream._handle.unref) {
stream._handle.unref();
}
break;
case 'FILE':
var fs = require('fs');
stream = new fs.SyncWriteStream(fd, { autoClose: false });
stream._type = 'fs';
break;
case 'PIPE':
case 'TCP':
var net = require('net');
stream = new net.Socket({
fd: fd,
readable: false,
writable: true
});
// FIXME Should probably have an option in net.Socket to create a
// stream from an existing fd which is writable only. But for now
// we'll just add this hack and set the `readable` member to false.
// Test: ./node test/fixtures/echo.js < /etc/passwd
stream.readable = false;
stream.read = null;
stream._type = 'pipe';
// FIXME Hack to have stream not keep the event loop alive.
// See https://github.com/joyent/node/issues/1726
if (stream._handle && stream._handle.unref) {
stream._handle.unref();
}
break;
default:
// Probably an error on in uv_guess_handle()
throw new Error('Implement me. Unknown stream file type!');
}
// For supporting legacy API we put the FD here.
stream.fd = fd;
stream._isStdio = true;
return stream;
}
/**
* Init logic for `debug` instances.

@@ -235,0 +173,0 @@ *

@@ -6,3 +6,5 @@ var stream = require('readable-stream')

var SIGNAL_FLUSH = new Buffer([0])
var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from)
? Buffer.from([0])
: new Buffer([0])

@@ -14,5 +16,9 @@ var onuncork = function(self, fn) {

var autoDestroy = function (self, err) {
if (self._autoDestroy) self.destroy(err)
}
var destroyer = function(self, end) {
return function(err) {
if (err) self._destroyInterval(err)
if (err) autoDestroy(self, err.message === 'premature close' ? null : err)
else if (end && !self._ended) self.end()

@@ -42,2 +48,3 @@ }

this._autoDestroy = !opts || opts.autoDestroy !== false
this._forwardDestroy = !opts || opts.destroy !== false

@@ -52,4 +59,2 @@ this._forwardEnd = !opts || opts.end !== false

this._ended = false
this._error = null
this._preferError = false

@@ -176,4 +181,2 @@ this.destroyed = false

Duplexify.prototype.destroy = function(err) {
if (this._preferError && !this._error && err) this._error = err
if (this.destroyed) return

@@ -184,13 +187,6 @@ this.destroyed = true

process.nextTick(function() {
self._destroy(self._preferError ? self._error : err)
self._destroy(err)
})
}
Duplexify.prototype._destroyInterval = function(err) {
if (this.destroyed) return
if (err.message !== 'premature close') return this.destroy(err)
this._preferError = true
this.destroy(null)
}
Duplexify.prototype._destroy = function(err) {

@@ -197,0 +193,0 @@ if (err) {

{
"_from": "duplexify@^3.4.2",
"_id": "duplexify@3.5.3",
"_id": "duplexify@3.6.0",
"_inBundle": false,
"_integrity": "sha512-g8ID9OroF9hKt2POf8YLayy+9594PzmM3scI00/uBXocX3TWNgoB67hjzkFe9ITAbQOne/lLdBxHXvYUM4ZgGA==",
"_integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==",
"_location": "/duplexify",

@@ -19,10 +19,9 @@ "_phantomChildren": {},

"_requiredBy": [
"/make-fetch-happen/mississippi",
"/mississippi",
"/pumpify"
],
"_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.3.tgz",
"_shasum": "8b5818800df92fd0125b27ab896491912858243e",
"_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz",
"_shasum": "592903f5d80b38d037220541264d69a198fb3410",
"_spec": "duplexify@^3.4.2",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/mississippi",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/mississippi",
"author": {

@@ -68,3 +67,3 @@ "name": "Mathias Buus"

},
"version": "3.5.3"
"version": "3.6.0"
}
var stream = require('readable-stream')
var inherits = require('inherits')
var SIGNAL_FLUSH = new Buffer([0])
var SIGNAL_FLUSH =(Buffer.from && Buffer.from !== Uint8Array.from)
? Buffer.from([0])
: new Buffer([0])

@@ -6,0 +8,0 @@ module.exports = WriteStream

{
"_from": "flush-write-stream@^1.0.0",
"_id": "flush-write-stream@1.0.2",
"_id": "flush-write-stream@1.0.3",
"_inBundle": false,
"_integrity": "sha1-yBuQ2HRnZvGmCaRoCZRsRd2K5Bc=",
"_integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==",
"_location": "/flush-write-stream",

@@ -19,9 +19,8 @@ "_phantomChildren": {},

"_requiredBy": [
"/make-fetch-happen/mississippi",
"/mississippi"
],
"_resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.2.tgz",
"_shasum": "c81b90d8746766f1a609a46809946c45dd8ae417",
"_resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz",
"_shasum": "c5d586ef38af6097650b49bc41b55fabb19f35bd",
"_spec": "flush-write-stream@^1.0.0",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/mississippi",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/mississippi",
"author": {

@@ -55,3 +54,3 @@ "name": "Mathias Buus",

},
"version": "1.0.2"
"version": "1.0.3"
}

@@ -39,2 +39,3 @@ 'use strict'

'browsetemplate': 'https://{domain}/{project}{/committish}',
'browsefiletemplate': 'https://{domain}/{project}{/committish}{#path}',
'docstemplate': 'https://{domain}/{project}{/committish}',

@@ -44,3 +45,6 @@ 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}',

'pathtemplate': '{project}{#committish}',
'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz'
'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz',
'hashformat': function (fragment) {
return 'file-' + formatHashFragment(fragment)
}
}

@@ -53,2 +57,3 @@ }

'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}',
'browsefiletemplate': 'https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}',
'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme',

@@ -59,3 +64,4 @@ 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}',

'pathtemplate': '{user}/{project}{#committish}',
'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/
'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,
'hashformat': formatHashFragment
}

@@ -73,1 +79,5 @@

})
function formatHashFragment (fragment) {
return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-')
}
'use strict'
var gitHosts = require('./git-host-info.js')
var extend = Object.assign || require('util')._extend

@@ -26,4 +25,5 @@ var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation, opts) {

if (!template) return
var vars = extend({}, opts)
opts = extend(extend({}, this.opts), opts)
var vars = Object.assign({}, opts)
vars.path = vars.path ? vars.path.replace(/^[/]+/g, '') : ''
opts = Object.assign({}, this.opts, opts)
var self = this

@@ -35,2 +35,4 @@ Object.keys(this).forEach(function (key) {

var rawComittish = vars.committish
var rawFragment = vars.fragment
var rawPath = vars.path
Object.keys(vars).forEach(function (key) {

@@ -40,2 +42,6 @@ vars[key] = encodeURIComponent(vars[key])

vars['auth@'] = rawAuth ? rawAuth + '@' : ''
vars['#fragment'] = rawFragment ? '#' + this.hashformat(rawFragment) : ''
vars.fragment = vars.fragment ? vars.fragment : ''
vars['#path'] = rawPath ? '#' + this.hashformat(rawPath) : ''
vars['/path'] = vars.path ? '/' + vars.path : ''
if (opts.noCommittish) {

@@ -73,4 +79,15 @@ vars['#committish'] = ''

GitHost.prototype.browse = function (opts) {
return this._fill(this.browsetemplate, opts)
GitHost.prototype.browse = function (P, F, opts) {
if (typeof P === 'string') {
if (typeof F !== 'string') {
opts = F
F = null
}
return this._fill(this.browsefiletemplate, Object.assign({
fragment: F,
path: P
}, opts))
} else {
return this._fill(this.browsetemplate, P)
}
}

@@ -107,5 +124,3 @@

GitHost.prototype.file = function (P, opts) {
return this._fill(this.filetemplate, extend({
path: P.replace(/^[/]+/g, '')
}, opts))
return this._fill(this.filetemplate, Object.assign({ path: P }, opts))
}

@@ -112,0 +127,0 @@

{
"_from": "hosted-git-info@^2.4.2",
"_id": "hosted-git-info@2.5.0",
"_from": "hosted-git-info@^2.6.0",
"_id": "hosted-git-info@2.6.0",
"_inBundle": false,
"_integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==",
"_integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==",
"_location": "/hosted-git-info",

@@ -11,18 +11,17 @@ "_phantomChildren": {},

"registry": true,
"raw": "hosted-git-info@^2.4.2",
"raw": "hosted-git-info@^2.6.0",
"name": "hosted-git-info",
"escapedName": "hosted-git-info",
"rawSpec": "^2.4.2",
"rawSpec": "^2.6.0",
"saveSpec": null,
"fetchSpec": "^2.4.2"
"fetchSpec": "^2.6.0"
},
"_requiredBy": [
"/lock-verify/npm-package-arg",
"/normalize-package-data",
"/npm-package-arg"
],
"_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz",
"_shasum": "6d60e34b3abbc8313062c3b798ef8d901a07af3c",
"_spec": "hosted-git-info@^2.4.2",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/lock-verify/node_modules/npm-package-arg",
"_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz",
"_shasum": "23235b29ab230c576aab0d4f13fc046b0b038222",
"_spec": "hosted-git-info@^2.6.0",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/npm-package-arg",
"author": {

@@ -41,4 +40,8 @@ "name": "Rebecca Turner",

"standard": "^9.0.2",
"standard-version": "^4.3.0",
"tap": "^10.3.0"
},
"engines": {
"node": ">=4"
},
"files": [

@@ -64,5 +67,9 @@ "index.js",

"scripts": {
"test": "standard && tap -J --coverage test/*.js"
"postrelease": "npm publish && git push --follow-tags",
"prerelease": "npm t",
"pretest": "standard",
"release": "standard-version -s",
"test": "tap -J --nyc-arg=--all --coverage test"
},
"version": "2.5.0"
"version": "2.6.0"
}

@@ -80,5 +80,7 @@ # hosted-git-info

* info.browse(opts)
* info.browse(path, fragment, opts)
eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`
eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`,
`https://github.com/npm/hosted-git-info/tree/v1.2.0/package.json`,
`https://github.com/npm/hosted-git-info/tree/v1.2.0/REAMDE.md#supported-hosts`

@@ -133,2 +135,1 @@ * info.bugs(opts)

additional hosts welcome.
2.1.0 / 2018-03-03
==================
* Add "engines" to package.json
* Use `Buffer.from()`
* Update package.json - outdated debug version (#7)
2.0.0 / 2017-06-27

@@ -3,0 +10,0 @@ ==================

@@ -78,5 +78,7 @@

// inject the `Proxy-Authorization` header if necessary
var auth = proxy.auth;
if (auth) {
req.setHeader('Proxy-Authorization', 'Basic ' + new Buffer(auth).toString('base64'));
if (proxy.auth) {
req.setHeader(
'Proxy-Authorization',
'Basic ' + Buffer.from(proxy.auth).toString('base64')
);
}

@@ -83,0 +85,0 @@

{
"_from": "http-proxy-agent@^2.0.0",
"_id": "http-proxy-agent@2.0.0",
"_from": "http-proxy-agent@^2.1.0",
"_id": "http-proxy-agent@2.1.0",
"_inBundle": false,
"_integrity": "sha1-RkgqLwUjpNYIJVFwn0acs+SoX/Q=",
"_integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==",
"_location": "/http-proxy-agent",

@@ -11,8 +11,8 @@ "_phantomChildren": {},

"registry": true,
"raw": "http-proxy-agent@^2.0.0",
"raw": "http-proxy-agent@^2.1.0",
"name": "http-proxy-agent",
"escapedName": "http-proxy-agent",
"rawSpec": "^2.0.0",
"rawSpec": "^2.1.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
"fetchSpec": "^2.1.0"
},

@@ -22,6 +22,6 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.0.0.tgz",
"_shasum": "46482a2f0523a4d6082551709f469cb3e4a85ff4",
"_spec": "http-proxy-agent@^2.0.0",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/make-fetch-happen",
"_resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz",
"_shasum": "e4821beef5b2142a2026bd73926fe537631c5405",
"_spec": "http-proxy-agent@^2.1.0",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/make-fetch-happen",
"author": {

@@ -38,3 +38,3 @@ "name": "Nathan Rajlich",

"agent-base": "4",
"debug": "2"
"debug": "3.1.0"
},

@@ -47,2 +47,5 @@ "deprecated": false,

},
"engines": {
"node": ">= 4.5.0"
},
"homepage": "https://github.com/TooTallNate/node-http-proxy-agent#readme",

@@ -65,3 +68,3 @@ "keywords": [

},
"version": "2.0.0"
"version": "2.1.0"
}
2.2.0 / 2018-03-03
==================
* Add "engines" to package.json - requires Node.js >= 4.5.0
* Use `Buffer.from()`
2.1.1 / 2017-11-28

@@ -3,0 +9,0 @@ ==================

@@ -59,2 +59,3 @@ /**

this.proxy = proxy;
this.defaultPort = 443;
}

@@ -208,3 +209,3 @@ inherits(HttpsProxyAgent, Agent);

headers['Proxy-Authorization'] =
'Basic ' + new Buffer(proxy.auth).toString('base64');
'Basic ' + Buffer.from(proxy.auth).toString('base64');
}

@@ -211,0 +212,0 @@

{
"_from": "https-proxy-agent@^2.1.0",
"_id": "https-proxy-agent@2.1.1",
"_from": "https-proxy-agent@^2.2.1",
"_id": "https-proxy-agent@2.2.1",
"_inBundle": false,
"_integrity": "sha512-LK6tQUR/VOkTI6ygAfWUKKP95I+e6M1h7N3PncGu1CATHCnex+CAv9ttR0lbHu1Uk2PXm/WoAHFo6JCGwMjVMw==",
"_integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==",
"_location": "/https-proxy-agent",

@@ -11,8 +11,8 @@ "_phantomChildren": {},

"registry": true,
"raw": "https-proxy-agent@^2.1.0",
"raw": "https-proxy-agent@^2.2.1",
"name": "https-proxy-agent",
"escapedName": "https-proxy-agent",
"rawSpec": "^2.1.0",
"rawSpec": "^2.2.1",
"saveSpec": null,
"fetchSpec": "^2.1.0"
"fetchSpec": "^2.2.1"
},

@@ -22,6 +22,6 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.1.1.tgz",
"_shasum": "a7ce4382a1ba8266ee848578778122d491260fd9",
"_spec": "https-proxy-agent@^2.1.0",
"_where": "/Users/zkat/Documents/code/libcipm/bin/node_modules/make-fetch-happen",
"_resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz",
"_shasum": "51552970fa04d723e04c56d04178c3f92592bbc0",
"_spec": "https-proxy-agent@^2.2.1",
"_where": "/Users/zkat/Documents/code/work/libcipm/bin/node_modules/make-fetch-happen",
"author": {

@@ -46,2 +46,5 @@ "name": "Nathan Rajlich",

},
"engines": {
"node": ">= 4.5.0"
},
"homepage": "https://github.com/TooTallNate/node-https-proxy-agent#readme",

@@ -64,3 +67,3 @@ "keywords": [

},
"version": "2.1.1"
"version": "2.2.1"
}

@@ -110,2 +110,7 @@

});
it('should set a `defaultPort` property', function () {
var opts = url.parse("http://127.0.0.1:" + proxyPort);
var agent = new HttpsProxyAgent(opts);
assert.equal(443, agent.defaultPort);
});
describe('secureProxy', function () {

@@ -307,4 +312,33 @@ it('should default to `false`', function () {

it('should not send a port number for the default port', function (done) {
sslServer.once('request', function (req, res) {
res.end(JSON.stringify(req.headers));
});
var proxy = process.env.HTTPS_PROXY || process.env.https_proxy || "https://127.0.0.1:" + sslProxyPort;
proxy = url.parse(proxy);
proxy.rejectUnauthorized = false;
var agent = new HttpsProxyAgent(proxy);
agent.defaultPort = sslServerPort;
var opts = url.parse("https://127.0.0.1:" + sslServerPort);
opts.agent = agent;
opts.rejectUnauthorized = false;
https.get(opts, function(res) {
var data = "";
res.setEncoding("utf8");
res.on("data", function(b) {
data += b;
});
res.on("end", function() {
data = JSON.parse(data);
assert.equal("127.0.0.1", data.host);
done();
});
});
});
});
});
# 0.4.23 / 2018-05-07
* Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann)
* Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn)
# 0.4.22 / 2018-05-05
* Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson)
* Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson)
# 0.4.21 / 2018-04-06
* Fix encoding canonicalization (#156)
* Fix the paths in the "browser" field in package.json (#174 by @LMLB)
* Removed "contributors" section in package.json - see Git history instead.
# 0.4.20 / 2018-04-06
* Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR)
# 0.4.19 / 2017-09-09

@@ -3,0 +27,0 @@

"use strict";
var Buffer = require("buffer").Buffer;
var Buffer = require("safer-buffer").Buffer;

@@ -284,3 +284,3 @@ // Multibyte codec. In this scheme, a character is represented by 1 or more bytes.

DBCSEncoder.prototype.write = function(str) {
var newBuf = new Buffer(str.length * (this.gb18030 ? 4 : 3)),
var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)),
leadSurrogate = this.leadSurrogate,

@@ -408,3 +408,3 @@ seqObj = this.seqObj, nextChar = -1,

var newBuf = new Buffer(10), j = 0;
var newBuf = Buffer.alloc(10), j = 0;

@@ -445,3 +445,3 @@ if (this.seqObj) { // We're in the sequence.

this.nodeIdx = 0;
this.prevBuf = new Buffer(0);
this.prevBuf = Buffer.alloc(0);

@@ -456,3 +456,3 @@ // Static data

DBCSDecoder.prototype.write = function(buf) {
var newBuf = new Buffer(buf.length*2),
var newBuf = Buffer.alloc(buf.length*2),
nodeIdx = this.nodeIdx,

@@ -534,3 +534,3 @@ prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,

// Parse remaining as usual.
this.prevBuf = new Buffer(0);
this.prevBuf = Buffer.alloc(0);
this.nodeIdx = 0;

@@ -537,0 +537,0 @@ if (buf.length > 0)

"use strict";
var Buffer = require("buffer").Buffer;
var Buffer = require("safer-buffer").Buffer;

@@ -36,3 +36,3 @@ // Export Node.js internal encodings.

// Add decoder for versions of Node not supporting CESU-8
if (new Buffer('eda0bdedb2a9', 'hex').toString() !== '💩') {
if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {
this.decoder = InternalDecoderCesu8;

@@ -71,3 +71,3 @@ this.defaultCharUnicode = iconv.defaultCharUnicode;

InternalEncoder.prototype.write = function(str) {
return new Buffer(str, this.enc);
return Buffer.from(str, this.enc);
}

@@ -92,7 +92,7 @@

return new Buffer(str, "base64");
return Buffer.from(str, "base64");
}
InternalEncoderBase64.prototype.end = function() {
return new Buffer(this.prevStr, "base64");
return Buffer.from(this.prevStr, "base64");
}

@@ -108,3 +108,3 @@

InternalEncoderCesu8.prototype.write = function(str) {
var buf = new Buffer(str.length * 3), bufIdx = 0;
var buf = Buffer.alloc(str.length * 3), bufIdx = 0;
for (var i = 0; i < str.length; i++) {

@@ -111,0 +111,0 @@ var charCode = str.charCodeAt(i);

"use strict";
var Buffer = require("buffer").Buffer;
var Buffer = require("safer-buffer").Buffer;

@@ -23,7 +23,6 @@ // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that

this.decodeBuf = new Buffer(codecOptions.chars, 'ucs2');
this.decodeBuf = new Buffer.from(codecOptions.chars, 'ucs2');
// Encoding buffer.
var encodeBuf = new Buffer(65536);
encodeBuf.fill(iconv.defaultCharSingleByte.charCodeAt(0));
var encodeBuf = new Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));

@@ -45,3 +44,3 @@ for (var i = 0; i < codecOptions.chars.length; i++)

SBCSEncoder.prototype.write = function(str) {
var buf = new Buffer(str.length);
var buf = Buffer.alloc(str.length);
for (var i = 0; i < str.length; i++)

@@ -64,3 +63,3 @@ buf[i] = this.encodeBuf[str.charCodeAt(i)];

var decodeBuf = this.decodeBuf;
var newBuf = new Buffer(buf.length*2);
var newBuf = Buffer.alloc(buf.length*2);
var idx1 = 0, idx2 = 0;

@@ -67,0 +66,0 @@ for (var i = 0; i < buf.length; i++) {

"use strict";
var Buffer = require("buffer").Buffer;
var Buffer = require("safer-buffer").Buffer;

@@ -23,3 +23,3 @@ // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js

Utf16BEEncoder.prototype.write = function(str) {
var buf = new Buffer(str, 'ucs2');
var buf = Buffer.from(str, 'ucs2');