aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tar-stream/sandbox.js
blob: 9b82d40107490dfe572eaaf79e5e24b7a41e849e (plain)
1
2
3
4
5
6
7
8
9
10
11
const tar = require('tar-stream')
const fs = require('fs')
const path = require('path')
const pipeline = require('pump') // eequire('stream').pipeline

fs.createReadStream('test.tar')
  .pipe(tar.extract())
  .on('entry', function (header, stream, done) {
    console.log(header.name)
    pipeline(stream, fs.createWriteStream(path.join('/tmp', header.name)), done)
  })