惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
L
LangChain Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
M
MIT News - Artificial intelligence
D
Docker
WordPress大学
WordPress大学
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
博客园 - 叶小钗
Last Week in AI
Last Week in AI
Stack Overflow Blog
Stack Overflow Blog
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog
博客园 - Franky

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - muhammadmuzzammil1998/pack-src: Recursively pack...
muzzammildot · 2026-05-24 · via Hacker News: Show HN

npm version CI Release License: MIT Node.js: >=22

Recursively pack source code directories into clean ZIP archives — fast, smart, and ignore-aware.


Features

  • Smart ignoring — respects .packsrcignore, .gitignore, .dockerignore, .npmignore and built-in defaults
  • Force-include support — use .packsrcinclude to override ignore rules for specific files
  • Streaming ZIP — never loads entire files into memory; scales to large repos
  • Deterministic output — files are sorted for reproducible archives
  • Polished CLI — progress spinners, colored output, human-readable stats
  • Zip-slip safe — all paths are validated before archiving
  • Zero config — sensible defaults out of the box

Installation

# npm (global)
npm install -g pack-src

# pnpm
pnpm add -g pack-src

# yarn
yarn global add pack-src

# npx (no install)
npx pack-src .

Usage

# Pack current directory
pack-src

# Pack a specific directory
pack-src ./my-project

# Specify output file
pack-src ./my-project -o snapshot.zip

# With timestamp in filename
pack-src ./my-project --timestamp
# → my-project-2026-05-21.zip

# Dry run — preview files without creating archive
pack-src ./my-project --dry-run

# List files only
pack-src ./my-project --list-files

# Print compression statistics
pack-src ./my-project --stats

# Set compression level (0 = store, 9 = maximum)
pack-src ./my-project -c 9

# Include .env files (excluded by default)
pack-src ./my-project --include-env

# Include .git directory (excluded by default)
pack-src ./my-project --include-git

# Disable .gitignore
pack-src ./my-project --no-gitignore

# Disable all built-in exclusions
pack-src ./my-project --no-default-ignore

# Overwrite existing output
pack-src ./my-project --overwrite

# Quiet mode (CI-friendly)
pack-src ./my-project -q

CLI Reference

Usage: pack-src [options] [source]

Arguments:
  source                    Source directory to pack (default: ".")

Options:
  -o, --output <file>       Output ZIP file path
  -c, --compression <0-9>   Compression level (default: 6)
  --dry-run                 Preview files without creating archive
  --verbose                 Verbose output
  --include-env             Include .env and secret files
  --include-git             Include .git directory in archive
  --no-gitignore            Do not use .gitignore files
  --no-default-ignore       Do not apply built-in exclusions
  --stats                   Print compression statistics
  --list-files              List files that would be included
  --timestamp               Append date (YYYY-MM-DD) to output filename
  --overwrite               Overwrite existing output file
  -q, --quiet               Suppress all output except errors
  -v, --version             Show version
  -h, --help                Show help

Ignore Behavior

Ignore rules are loaded in this priority order:

  1. .packsrcignore — project-specific overrides
  2. .gitignore — standard git ignores
  3. .dockerignore — Docker ignores
  4. .npmignore — npm ignores
  5. Built-in defaults — see below

Built-in Default Exclusions

node_modules   dist          build         coverage
.git           .next         .nuxt         .cache
.turbo         .parcel-cache .svelte-kit   .angular
.vercel        .output       .yarn         .pnpm-store
__pycache__    .pytest_cache .mypy_cache   .ruff_cache
.venv          venv          env           target
bin            obj           .gradle       .idea
.vscode        .DS_Store     Thumbs.db

Env File Exclusion

These patterns are excluded by default to prevent accidental secret leakage:

.env   .env.*   *.pem   *.key   *.p12   id_rsa   id_ed25519   *.secret

Use --include-env to explicitly include them.

Nested Ignore Files

pack-src loads ignore files from every subdirectory it traverses, so nested .gitignore rules are respected correctly — just like git itself.

Negation Support

Negation patterns (e.g., !important.log) work as expected within any ignore file.

Force-Include with .packsrcinclude

Sometimes you need to include specific files that would otherwise be ignored. Create a .packsrcinclude file with patterns to force-include:

# Include specific build artifacts
dist/bundle.min.js
dist/styles.css

# Include all .wasm files in build directory
build/**/*.wasm

How it works:

  • Files matching .packsrcinclude patterns bypass all ignore rules
  • Works with glob patterns (powered by the same engine as .gitignore)
  • Useful for including specific generated files, build artifacts, or vendored dependencies
  • Can be placed in any subdirectory (rules apply to that directory and below)

Example use case:

# Your .gitignore excludes dist/
# But you want to include the final bundle

echo "dist/bundle.min.js" > .packsrcinclude
pack-src .
# → dist/bundle.min.js is now included despite dist/ being ignored

Output Naming

Scenario Output
pack-src ./my-project my-project.zip
pack-src ./my-project --timestamp my-project-2026-05-21.zip
pack-src ./my-project -o out/snap.zip out/snap.zip

Accidental overwrites are prevented by default. Use --overwrite to replace existing files.


Benchmarks

Tested on a MacBook Pro M2 with a 1,000-file TypeScript project:

Tool Time Memory
pack-src ~180ms ~18MB
zip -r (naive) ~240ms ~24MB
tar czf ~160ms ~15MB
naive recursive fs ~410ms ~85MB

pack-src achieves near-native performance by:

  • Using fast-glob for concurrent directory traversal
  • Streaming files directly into the archive without buffering
  • Limiting concurrency to avoid I/O saturation

Run the benchmarks yourself after building:

pnpm build
pnpm benchmark

Programmatic API

import { runPack, collectFiles, IgnoreEngine } from 'pack-src';

// Pack a directory
await runPack({
  source: './my-project',
  output: 'snapshot.zip',
  compression: 6,
  stats: true,
});

// Use the ignore engine directly
const engine = new IgnoreEngine({
  root: './my-project',
  gitignore: true,
  defaultIgnore: true,
  includeEnv: false,
  includeGit: false,
  verbose: false,
});
await engine.loadDirectory('./my-project');

// Collect files
const files = await collectFiles('./my-project', engine, false);
console.log(files.map((f) => f.archivePath));

Development

git clone https://github.com/muhammadmuzzammil1998/pack-src.git
cd pack-src
pnpm install
pnpm build
pnpm test

See CONTRIBUTING.md for full contribution guide.


Release

Releases are managed with Changesets.

# Create a changeset
pnpm changeset

# Bump versions
pnpm version

# Publish to npm
pnpm release

The release.yml workflow publishes automatically when a release PR is merged to main.


License

MIT © Mohammad Muzammil Khan