Socket
Book a DemoInstallSign in
Socket

tar-parse

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tar-parse

streaming tar parser

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
105
2000%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

tarball

FAQs

Package last updated on 01 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts