archiver-pack

Archive files with node-archiver with a promise

Usage no npm install needed!

<script type="module">
  import archiverPack from 'https://cdn.skypack.dev/archiver-pack';
</script>

README

archiver-pack

Build Status Dependency Status Dev dependency Status

Archive files with any supported format returning a Promise object. It rely in archiver for archive generation.

Installation

npm install archiver-pack

Usage

Better use full file paths.

const archiverPack = require('archiver-pack');
const files = [
  '/a/b/foo',
  '/a/b/bar',
  '/a/b/xyz',
];
const tgzFile = '/a/b/backup.tar.gz';
const archiverOptions = {
  gzip: true,
  gzipOptions: {
    level: 1
  },
};
archiverPack('tar', files, tgzFile, archiverOptions).then(function() {
  console.log('tgz file generated succesfully');
});

Tests

Use npm test to run the tests.

Issues

If you discover a bug, please raise an issue on Github.