replace progress-stream with our implementation

upstream is mostly unmaintained
This commit is contained in:
Girish Ramakrishnan
2022-11-06 10:17:14 +01:00
parent 5af1bbfb3c
commit 962d7030bb
5 changed files with 50 additions and 69 deletions

View File

@@ -14,7 +14,7 @@ const assert = require('assert'),
{ DecryptStream, EncryptStream } = require('../hush.js'),
once = require('../once.js'),
path = require('path'),
progressStream = require('progress-stream'),
ProgressStream = require('../progress-stream.js'),
storage = require('../storage.js'),
tar = require('tar-fs'),
zlib = require('zlib');
@@ -51,7 +51,7 @@ function tarPack(dataLayout, encryption) {
});
const gzip = zlib.createGzip({});
const ps = progressStream({ time: 10000 }); // emit 'progress' every 10 seconds
const ps = new ProgressStream({ interval: 10000 }); // emit 'progress' every 10 seconds
pack.on('error', function (error) {
debug('tarPack: tar stream error.', error);
@@ -84,7 +84,7 @@ function tarExtract(inStream, dataLayout, encryption) {
assert.strictEqual(typeof encryption, 'object');
const gunzip = zlib.createGunzip({});
const ps = progressStream({ time: 10000 }); // display a progress every 10 seconds
const ps = new ProgressStream({ interval: 10000 }); // display a progress every 10 seconds
const extract = tar.extract('/', {
map: function (header) {
header.name = dataLayout.toLocalPath(header.name);