Create
.tar
archive of files matching glob(s)
Makes a great team with extrakt.
$ npm install --save nectar
const nectar = require('nectar');
await nectar(['resources/**/*.js'], 'bundle.tar');
// packs all .js files inside 'resources' into 'bundle.tar'
const fs = require('fs');
const zlib = require('zlib');
const gZip = zlib.createGzip();
nectar(['resources/**/*.js'])
.pipe(gZip)
.pipe(fs.createWriteStream('bundle.tar.gz'));
Creates a .tar
archive containing all files matched by the given input glob(s). The directory structure, relative to the working directory, is preserved.
If the output
argument is provided, the archive is written to output
and a promise is returned for an array of the paths of the matches entries.
If no output
argument is provided, a promise for a readable stream for the archive will be returned.
Type: string|string[]
Input glob(s).
Type: string|WritableStream
Optional output path or a writable stream.
Type: string
Default: process.cwd()
Optional working directory for glob matching
MIT © sgtlambda