source-code-zip

Package source code directories into filtered ZIP archives using a dependency-free Node.js script.

2|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/NAMEWTA/learning-open-code --skill source-code-zip-namewta
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: source-code-zip
Source: https://github.com/NAMEWTA/learning-open-code/tree/main/speculo/skills/source-code-zip
Command: npx skills add https://github.com/NAMEWTA/learning-open-code --skill source-code-zip-namewta

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Archiving or transferring a source code directory often means accidentally including node_modules, build artifacts, .env files, keys, and other sensitive or bulky content. This Skill packages a directory into a lean ZIP that contains essentially only source code, using editable JavaScript regex IGNORE rules to exclude dependencies, build outputs, archives, YAML, secrets, media, and other non-code files. ## Core Features & Use Cases - Safe default filtering: Two-layer filtering combines editable IGNORE regexes (excluding .git, node_modules, dist, .env, YAML, keys, archives, media) with a source-code extension whitelist covering JS/TS, Python, Java, Go, Rust, C/C++, and more. - Zero-dependency single script: The implementation is one JavaScript file using only Node.js built-in modules (fs, path, zlib, stream, crypto); no npm install, no system zip command, Node.js 14+ only. - Preview and control options: Supports --dry-run and --verbose previews, --include/--ignore regex overrides, --all-files mode, custom output paths, compression levels 0-9, --contents-only layout, and ZIP64 support for large archives. - Use Case: Before submitting a project for code review or sharing it with a colleague, run a dry-run preview to confirm no .env or key files are included, then create my-app.code.zip containing only the source files. ## Quick Start Ask the agent to run node scripts/zip_source_code.js with your project directory path, starting with the --dry-run --verbose flags to preview what will be included before creating the final ZIP archive.

Frequently Asked Questions about source-code-zip

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I zip a source code folder excluding node_modules?▼

Run node scripts/zip_source_code.js with your project path. The script's built-in IGNORE regexes automatically exclude node_modules, vendor, dist, build, and other dependency or output directories, so the ZIP contains only source files.

How to create a ZIP file in Node.js without external libraries?▼

This script creates standard ZIP archives using only Node.js built-in modules like fs, zlib, and stream. It computes CRC32 itself, writes local headers and the central directory manually, and supports ZIP64, so no npm packages or system zip command are needed.

Does the script require npm install or any dependencies?▼

No. The script uses only Node.js built-in modules and must be run directly with node. Running npm install is explicitly unnecessary and discouraged, and Node.js 14 or higher is the only requirement.

Why is package.json or YAML missing from the generated ZIP?▼

JSON files are excluded by the default source-code extension whitelist, and YAML is excluded by a deliberate IGNORE safety rule. Use --include '(^|/)package\.json$' to add manifests; YAML requires editing the IGNORE list since --include cannot override it.

How can I preview which files will be included before zipping?▼

Run the script with --dry-run to list included files without creating a ZIP, and add --verbose to see the reason each skipped item was excluded. This is the recommended first step before any real archive run.

What happens with symlinks and existing output files?▼

All symbolic links are skipped and never followed outside the source tree. The script refuses to overwrite an existing ZIP unless --force is passed, and it writes to a temporary file first, installing it atomically only after completion.