tar-map-stream

1.0.0 • Public • Published

tar-map-stream

Streaming mapping of tarball headers

npm install tar-map-stream

build status

Usage

var map = require('tar-map-stream')
 
// map returns a duplex stream
var stream = map(function(header) {
  // this function is run on every tar header
  // strip one level
  header.name = header.name.split('/').slice(1).join('/')
 
  // return null to remove this file from the tarball
  // or return the modified header
  return header
})
 
fs.createReadStream('archive.tar')
  .pipe(stream)
  .pipe(fs.createWriteStream('stripped-archive.tar'))

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    265
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    265

Package Sidebar

Install

npm i tar-map-stream

Weekly Downloads

265

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mafintosh