2.0.0 • Published 6 years ago

tar-files v2.0.0

Weekly downloads
17
License
ISC
Repository
-
Last release
6 years ago

tar-files

convenience wrapper around fs gunzip and node-tar to stream file entries' data.

var te = require('tar-files')
var eos = require('end-of-stream')

// the first argument may be a file name or a readable stream.

te('package.tar',function(stream,cb){
  if(stream.path === "package/README.md") {
    eos(stream.pipe(fs.createWriteStream('./tar-README.md')),cb)
  } else {
    // skip this entry (make sure to call stream.resume() if skipping)
    stream.resume()
    cb()
  }
},function(err){
  
  // all done!

})

this example saves the README.md file from package.tar to the file ./tar-README.md

  • works with gzipped or not compressed tars.

  • pass in a stream or a file name

2.0.0

6 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.0

9 years ago