tar-map-stream
Streaming mapping of tarball headers
Last updated 10 years ago by mafintosh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install tar-map-stream 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (10 years ago)

1 Versions

  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |