lean-ts-patterns
Installation
SKILL.md
Lean TypeScript Patterns
Patterns for building lightweight, zero-dependency TypeScript/Bun tools. Distilled from studying exemplary repos: unjs/citty (CLI), unjs/consola (logging), unjs/ofetch (HTTP), unjs/defu (merging), unjs/scule (strings), unjs/pathe (paths), antfu/taze (package updates).
The 7 Principles
1. Zero Dependencies by Design
Inline tiny utils. Use node: builtins. Vendor at build time if needed.
- CLI parsing:
node:util.parseArgs(not commander/yargs) - Colors: 22 lines of ANSI codes (not chalk/picocolors)
- Path utils: 7-line normalizer (not
pathpolyfills) - HTTP:
globalThis.fetchwrapper (not axios) - Object merging: 40-line recursive merge (not lodash.merge)