A tiny CLI to package a folder into a zip archive with simple include, exclude, and .gitignore support.
npm install -g foldpakOr run directly with npx:
npx foldpak .foldpak [source]-o, --output <file>— Output zip file path--no-gitignore— Don't use .gitignore rules (by default, .gitignore is respected)--ignore-file <file>— Load ignore patterns from custom file (can be repeated)-i, --include <glob>— Include files matching glob (can be repeated)-e, --exclude <glob>— Exclude files matching glob (can be repeated)--verbose— Show detailed output
# Package current directory
foldpak .
# Package a specific directory
foldpak ./my-project
# Specify output file
foldpak . -o my-app.zip
# Ignore .gitignore rules
foldpak . --no-gitignore
# Include only specific files
foldpak . -i "src/**" -i "package.json"
# Exclude specific files (in addition to .gitignore)
foldpak . -e "dist/**" -e "node_modules/**"
# Combine options
foldpak . --include "dist/**" --exclude "**/*.map"
# Use custom ignore file
foldpak . --ignore-file .foldpakignore
# Use multiple ignore files
foldpak . --ignore-file .foldpakignore --ignore-file .dockerignore- Files are archived relative to the source root
.gitignorerules are applied by default (use--no-gitignoreto disable)--includenarrows the file set to matching files--excluderemoves matching files (always wins last)
npm install
npm run buildThe compiled CLI will be at dist/cli.js.
npm testWe are committed to making foldpak the most intuitive and versatile packaging tool for developers. Here are the features we are planning for future releases:
- Tar & Tar.GZ — Support for
.tarand.tar.gzarchives for Unix-friendly workflows - 7-Zip — Support for
.7zformat with higher compression ratios - Tar.ZST — Support for Zstandard-compressed tarballs for modern compression speeds
- Nested
.gitignoreSupport — Respect.gitignorefiles recursively throughout the project tree - Config File Support — Per-project configuration via
.foldpakrcorfoldpak.config.js - Watch Mode — Auto-repackage on file changes during development
- Dry Run Mode — Preview what would be packaged without creating the archive
- List Contents — View archive contents without extracting
- Strip Root Option — Option to include/exclude the root directory in the archive
- Progress Indicators — Visual feedback for large directories
- Prebuilt Binaries — Standalone executables for major platforms (no Node.js required)
- GitHub Action — Official action for CI/CD workflows
- Checksum Generation — Automatic SHA256 checksums for integrity verification
Have a suggestion? Open an issue — we'd love to hear from you!