mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 04:49:06 +00:00
This commit adds extensive documentation for previously undocumented APIs across multiple categories: **Utility APIs** (docs/api/utils.md): - Bun.nanoseconds() - high-precision timing - Bun.indexOfLine() - line boundary detection - Bun.shellEscape() - shell injection prevention - Bun.allocUnsafe() - unsafe memory allocation - Bun.shrink() - memory optimization - Bun.mmap() - memory-mapped file access - Bun.resolve()/resolveSync() - module resolution - Bun.unsafe namespace - low-level operations - Bun.CSRF - CSRF token generation/verification - Enhanced memory management APIs **Compression APIs** (new docs/guides/util/zstd.md + utils.md): - Bun.zstdCompress()/zstdCompressSync() - Bun.zstdDecompress()/zstdDecompressSync() - Performance comparisons and usage patterns **Hashing APIs** (docs/api/hashing.md): - Individual hash classes (MD4, MD5, SHA family) - Instance methods (.update(), .digest()) - Static methods (.hash(), .byteLength) - Security considerations for legacy algorithms **Binary Data APIs** (docs/api/binary-data.md): - Bun.CryptoHasher - hardware-accelerated hashing - Streaming and performance optimization examples **Shell APIs** (docs/runtime/shell.md): - Bun.createParsedShellScript() - script parsing - Bun.createShellInterpreter() - interpreter creation **Macro APIs** (docs/bundler/macros.md): - Bun.registerMacro() - internal macro registration **Embedded Files** (docs/bundler/executables.md): - Enhanced Bun.embeddedFiles documentation - HTTP serving and access patterns Total changes: 1,420+ lines of comprehensive documentation added across 7 files, with practical examples, security considerations, and performance guidance for all documented APIs. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>