JavaScript
Tar and zip this entire work directory
The tar command in Linux is often used to create .tar.gz or .tgz archive files. The tar command can extract the resulting archives, too.
However while using javascript if we want o use tar and zip the entie work directory the the following example code snippets can be used
const configPath = path.join(this.base, '.platform', data);
const createOpts = {gzip: true, cwd: configPath, sync: true};
const archive = tar.create(createOpts, fs.readdirSync(configPath));
Get Answers For Free
Most questions answered within 1 hours.