streaming tar parser
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
streams
test
.travis.yml
README.md
header.js
index.js
package.json
parser.js

README.md

tar-parse

just the parsing part of node-tar lifted out and reworked using dominictarr's duplex library. primary goal is to get tar working in the browser.

Build Status browser support

var parse = require('tar-parse')
  , mkdirp = require('mkdirp')
  , path = require('path')
  , fs = require('fs')

fs.createReadStream('assets.tar')
  .pipe(parse())
  .on('data', function(entry) {
    entry.pause()
    mkdirp(path.dirname(entry.path), function() {
      if(entry.props.size) {
        entry.pipe(fs.createWriteStream(entry.path))
      }
      entry.resume()
    })
  })

data events will be files, links (symbolic and otherwise), devices, fifos, and directories.

they represent a pausable, readable stream. pausing an entry will cause the parse stream to pause as well.

passes the parse subset of tests from node tar. uses tape instead of tap.

license

MIT