bump deps

This commit is contained in:
Mathias Buus 2019-02-04 10:46:57 +01:00
parent a9927c7c98
commit a443b1a06e
7 changed files with 23 additions and 32 deletions

View file

@ -1,6 +1,5 @@
language: node_js language: node_js
node_js: node_js:
- "0.10" - '6'
- '0.12' - '8'
- '4' - '10'
- '5'

View file

@ -1,6 +1,5 @@
var util = require('util') var util = require('util')
var bl = require('bl') var bl = require('bl')
var xtend = require('xtend')
var headers = require('./headers') var headers = require('./headers')
var Writable = require('readable-stream').Writable var Writable = require('readable-stream').Writable
@ -98,7 +97,7 @@ var Extract = function (opts) {
var onpaxheader = function () { var onpaxheader = function () {
var size = self._header.size var size = self._header.size
self._pax = headers.decodePax(b.slice(0, size)) self._pax = headers.decodePax(b.slice(0, size))
if (self._paxGlobal) self._pax = xtend(self._paxGlobal, self._pax) if (self._paxGlobal) self._pax = Object.assign({}, self._paxGlobal, self._pax)
b.consume(size) b.consume(size)
onstreamend() onstreamend()
} }

View file

@ -1,5 +1,4 @@
var toBuffer = require('to-buffer') var alloc = Buffer.alloc
var alloc = require('buffer-alloc')
var ZEROS = '0000000000000000000' var ZEROS = '0000000000000000000'
var SEVENS = '7777777777777777777' var SEVENS = '7777777777777777777'
@ -172,7 +171,7 @@ exports.encodePax = function (opts) { // TODO: encode more stuff in pax
result += addLength(' ' + key + '=' + pax[key] + '\n') result += addLength(' ' + key + '=' + pax[key] + '\n')
} }
} }
return toBuffer(result) return Buffer.from(result)
} }
exports.decodePax = function (buf) { exports.decodePax = function (buf) {

15
pack.js
View file

@ -1,8 +1,7 @@
var constants = require('fs-constants') var constants = require('fs-constants')
var eos = require('end-of-stream') var eos = require('end-of-stream')
var util = require('util') var inherits = require('inherits')
var alloc = require('buffer-alloc') var alloc = Buffer.alloc
var toBuffer = require('to-buffer')
var Readable = require('readable-stream').Readable var Readable = require('readable-stream').Readable
var Writable = require('readable-stream').Writable var Writable = require('readable-stream').Writable
@ -41,7 +40,7 @@ var Sink = function (to) {
this._destroyed = false this._destroyed = false
} }
util.inherits(Sink, Writable) inherits(Sink, Writable)
Sink.prototype._write = function (data, enc, cb) { Sink.prototype._write = function (data, enc, cb) {
this.written += data.length this.written += data.length
@ -62,7 +61,7 @@ var LinkSink = function () {
this._destroyed = false this._destroyed = false
} }
util.inherits(LinkSink, Writable) inherits(LinkSink, Writable)
LinkSink.prototype._write = function (data, enc, cb) { LinkSink.prototype._write = function (data, enc, cb) {
this.linkname += this._decoder.write(data) this.linkname += this._decoder.write(data)
@ -80,7 +79,7 @@ var Void = function () {
this._destroyed = false this._destroyed = false
} }
util.inherits(Void, Writable) inherits(Void, Writable)
Void.prototype._write = function (data, enc, cb) { Void.prototype._write = function (data, enc, cb) {
cb(new Error('No body allowed for this entry')) cb(new Error('No body allowed for this entry'))
@ -103,7 +102,7 @@ var Pack = function (opts) {
this._stream = null this._stream = null
} }
util.inherits(Pack, Readable) inherits(Pack, Readable)
Pack.prototype.entry = function (header, buffer, callback) { Pack.prototype.entry = function (header, buffer, callback) {
if (this._stream) throw new Error('already piping an entry') if (this._stream) throw new Error('already piping an entry')
@ -125,7 +124,7 @@ Pack.prototype.entry = function (header, buffer, callback) {
if (!header.gid) header.gid = 0 if (!header.gid) header.gid = 0
if (!header.mtime) header.mtime = new Date() if (!header.mtime) header.mtime = new Date()
if (typeof buffer === 'string') buffer = toBuffer(buffer) if (typeof buffer === 'string') buffer = Buffer.from(buffer)
if (Buffer.isBuffer(buffer)) { if (Buffer.isBuffer(buffer)) {
header.size = buffer.length header.size = buffer.length
this._encode(header) this._encode(header)

View file

@ -3,22 +3,17 @@
"version": "1.6.2", "version": "1.6.2",
"description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.", "description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.",
"author": "Mathias Buus <mathiasbuus@gmail.com>", "author": "Mathias Buus <mathiasbuus@gmail.com>",
"engines": {
"node": ">= 0.8.0"
},
"dependencies": { "dependencies": {
"bl": "^1.0.0", "bl": "^2.2.0",
"buffer-alloc": "^1.2.0", "end-of-stream": "^1.4.1",
"end-of-stream": "^1.0.0",
"fs-constants": "^1.0.0", "fs-constants": "^1.0.0",
"readable-stream": "^2.3.0", "inherits": "^2.0.3",
"to-buffer": "^1.1.1", "readable-stream": "^3.1.1"
"xtend": "^4.0.0"
}, },
"devDependencies": { "devDependencies": {
"concat-stream": "^1.6.2", "concat-stream": "^2.0.0",
"standard": "^11.0.1", "standard": "^12.0.1",
"tape": "^4.9.0" "tape": "^4.9.2"
}, },
"scripts": { "scripts": {
"test": "standard && tape test/extract.js test/pack.js", "test": "standard && tape test/extract.js test/pack.js",