UNPKG

fast-extract

Version:

Extract contents from various archive types (tar, tar.bz2, tar.gz, tar.xz, tgz, zip)

21 lines (20 loc) 575 B
import progressStream from 'progress-stream'; import statsSize from '../../sourceStats/size.js'; export default function DataProgressTransform(options) { const stats = { basename: options.basename }; const progress = progressStream({ time: options.time }, (update)=>{ if (options.progress) options.progress({ ...update, ...stats, progress: 'write' }); }); statsSize(options.source, options, (err, size)=>{ err || progress.setLength(size || 0); }); return progress; }