zip-build is a specialized Node.js command-line utility designed for automating the archival of project build artifacts. It streamlines the process of zipping or tarring a specified output directory, making it particularly useful for deployment pipelines or versioned backups. The package automatically generates archive filenames based on the project's `name` and `version` fields extracted from `package.json`, and can optionally include a timestamp for uniqueness. Currently, at version 1.8.0, it demonstrates active maintenance through its GitHub repository, though a formal release cadence is not explicitly defined. Its key differentiators include flexible output formatting (supporting both `.zip` and `.tar`), customizable filename templating, and an optional interactive mode for guided execution. It primarily serves as a `devDependency` to be integrated into `npm scripts` for an automated build workflow, rather than offering a direct programmatic API for `import` into JavaScript or TypeScript modules.
npm install zip-buildVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to integrate `zip-build` into an npm script workflow, showing installation, directory creation, and archiving with custom naming.
To allow overwriting, always include the `--override` (or `-o`) flag when running `zip-build`, e.g., `zip-build build dist --override`.
Always explicitly specify your source and destination directories, e.g., `zip-build output archives`. Alternatively, ensure your build output goes into a `build` directory and you want the archive in a `dist` directory.
To use the `--name` option, combine it with `--interactive`: `zip-build --interactive --name`.
Integrate `zip-build` into your project via npm `scripts` in `package.json`, or by invoking the CLI command directly using `child_process` functions (like `spawn` or `exec`) if programmatic execution within Node.js is necessary.
Ensure the `buildDir` exists before running the command. Check that `zipDir` is a valid path. If an archive already exists at the target, add the `--override` flag (e.g., `zip-build my-build my-dist --override`).
Install it as a devDependency (`npm install --save-dev zip-build`) and then run it via an npm script (e.g., `"build": "zip-build"` in `package.json` then `npm run build`), or use `npx zip-build` to execute it directly.
To allow overwriting existing archives, add the `--override` flag to your `zip-build` command (e.g., `zip-build --override`). Alternatively, modify the `--template` option to ensure unique filenames.
No dependency data recorded yet.