PHP 8.2.30
Preview: extracter.js Size: 385 B
/proc/self/root/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/tar/examples/extracter.js

var tar = require("../tar.js")
  , fs = require("fs")


function onError(err) {
  console.error('An error occurred:', err)
}

function onEnd() {
  console.log('Extracted!')
}

var extractor = tar.Extract({path: __dirname + "/extract"})
  .on('error', onError)
  .on('end', onEnd);

fs.createReadStream(__dirname + "/../test/fixtures/c.tar")
  .on('error', onError)
  .pipe(extractor);

Directory Contents

Dirs: 0 × Files: 3

Name Size Perms Modified Actions
385 B lrw-r--r-- 2021-09-28 09:36:12
Edit Download
488 B lrw-r--r-- 2021-09-28 09:36:12
Edit Download
1004 B lrw-r--r-- 2021-09-28 09:36:12
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).