Token-aware prompt minifier with explainable diff, version 0.1.1. Shrinks LLM prompts by replacing verbose phrases with shorter equivalents, providing a detailed diff of changes. Supports multiple optimization levels (safe, balanced, aggressive) and custom tokenizers. Zero runtime dependencies, ESM/CJS, TypeScript types included. Released under MIT license.
npm install prompt-minifierNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic minify usage with balanced level, showing token savings and detailed changes.
Pin to exact version and watch for breaking releases.
Pass a custom tokenizer function for accurate counts (e.g., from gpt-tokenizer or tiktoken).
Test CLI commands thoroughly or use the library API directly.
N/A
npm install prompt-minifier
Ensure Node >=18 and use ES module (type: module in package.json or .mjs extension).
Use import { minify } from 'prompt-minifier' instead of import minify from 'prompt-minifier'.No dependency data recorded yet.