Socket
Book a DemoInstallSign in
Socket

ls-tar

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ls-tar

ls a tar with node tar in child processes

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

ls-tar

ls a tar with gnu tar in child processes.

this is a silly wrapper around tar -tvf that manages spawning only up to a number of processes your system can handle.

warning. this may only work on linux as it parses the string output of gnutar. use node tar for x platform. https://www.npmjs.com/package/tar

example

const ls = require('ls-tar')

ls('./my-tar.tgz', function(err,result){
  console.log(result)
})

result is an array of entires. each entry has a name and size.

[{"name":"a/","size":"0"},{"name":"a/file.txt","size":"8"}]

api

ls(tar,cb)

  • default export. ls = require('ls-tar')
  • tar is the file you want to list. can be gzipped
  • cb(err,entries) the callback

ls.stream(tar,cb)

  • tar. the tarball
  • cb(err,stream)
    • stream as an object stream on entires
    • {"name":"a/file.txt","size":"8"}
    • errors from tar are emitted as errors on the stream. you must handle them.

FAQs

Package last updated on 13 Jul 2017

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