initial commit

This commit is contained in:
air66
2019-07-24 18:16:32 +01:00
commit 5efebf4ded
8591 changed files with 899103 additions and 0 deletions

29
node_modules/tar/test/parse-discard.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
var tap = require("tap")
, tar = require("../tar.js")
, fs = require("fs")
, path = require("path")
, file = path.resolve(__dirname, "fixtures/c.tar")
tap.test("parser test", function (t) {
var parser = tar.Parse()
var total = 0
var dataTotal = 0
parser.on("end", function () {
t.equals(total-513,dataTotal,'should have discarded only c.txt')
t.end()
})
fs.createReadStream(file)
.pipe(parser)
.on('entry',function(entry){
if(entry.path === 'c.txt') entry.abort()
total += entry.size;
entry.on('data',function(data){
dataTotal += data.length
})
})
})