How to use the tar-stream/headers.decode function in tar-stream

To help you get started, we’ve selected a few tar-stream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github digidem / indexed-tarball / lib / integrity.js View on Github external
fs.read(fd, sector, 0, 512, position, function (err, bytesRead) {
    if (err) return cb(err)
    if (bytesRead < 512) return cb(new Error('read < 512 bytes'))
    try {
      var header = tarHeader.decode(sector)
      cb(null, header)
    } catch (e) {
      cb(e)
    }
  })
}

tar-stream

tar-stream is a streaming tar parser and generator and nothing else. It operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.

MIT
Latest version published 6 months ago

Package Health Score

79 / 100
Full package analysis

Similar packages