tar-parse

0.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i tar-parse

Weekly Downloads

25

Version

0.0.2

License

MIT

Last publish

Collaborators

  • chrisdickinson