UNPKG

fast-extract

Version:

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

17 lines (16 loc) 666 B
import path from 'path'; import statsBasename from '../../sourceStats/basename.js'; import DataProgressTransform from '../transforms/DataProgress.js'; import createWriteStream from '../write/file.js'; export default function createFilePipeline(dest, streams, options) { const basename = statsBasename(options.source, options); const fullPath = basename === undefined ? dest : path.join(dest, basename); streams = streams.slice(); !options.progress || streams.push(DataProgressTransform({ basename: basename, fullPath: fullPath, ...options })); streams.push(createWriteStream(fullPath, options)); return streams; }