@sjmeverett/zip-util

Thin wrapper around archiver to output zip files, optionally with the file hash in the filename.

Usage no npm install needed!

<script type="module">
  import sjmeverettZipUtil from 'https://cdn.skypack.dev/@sjmeverett/zip-util';
</script>

README

@sjmeverett/zip-util

Thin wrapper around archiver to output zip files, optionally with the file hash in the filename.

Installation

npm install -S @sjmeverett/zip-util

Usage

import { createZip } from "@sjmeverett/zip-util";

await createZip(
  "myzip",
  (archive) => {
    archive.directory("source", "dest");
  },
  { destinationDir: "dest/dir", hash: true }
);

The callback function receives one argument, archive, which is an instance of archiver. It can return a promise if necessary, which will be awaited.