UNPKG

meshblu-google-vision

Version:

[![Build Status](https://travis-ci.org/octoblu/meshblu-google-vision.svg?branch=master)](https://travis-ci.org/octoblu/meshblu-google-vision) [![Code Climate](https://codeclimate.com/github/octoblu/meshblu-google-vision/badges/gpa.svg)](https://codeclimat

30 lines (23 loc) 643 B
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 }) }) })