fast-extract
Version:
Extract contents from various archive types (tar, tar.bz2, tar.gz, tar.xz, tgz, zip)
21 lines (20 loc) • 568 B
JavaScript
import progressStream from 'progress-stream';
import statsSize from '../../sourceStats/size.js';
export default function DataProgressTransform(options) {
const stats = options ? {
basename: options.basename
} : {};
const progress = progressStream({
time: options.time
}, (update)=>{
options.progress({
progress: 'write',
...update,
...stats
});
});
statsSize(options.source, options, (err, size)=>{
err || progress.setLength(size || 0);
});
return progress;
}