UNPKG

redis-smq-common

Version:

Provides essential components and utilities shared across RedisSMQ packages.

20 lines 601 B
import fs from 'fs'; import * as zlib from 'node:zlib'; import * as tar from 'tar'; export async function extractTgz(tgzPath, destDir) { return new Promise((resolve, reject) => { const readStream = fs.createReadStream(tgzPath); const gunzip = zlib.createGunzip(); const extract = tar.extract({ cwd: destDir }); readStream .pipe(gunzip) .pipe(extract) .on('finish', () => { resolve(); }) .on('error', (err) => { reject(err); }); }); } //# sourceMappingURL=extract-tgz.js.map