Files
e-tib.com/node_modules/.pnpm/icu-minify@4.9.0/node_modules/icu-minify/README.md
Marc Mintel d14122005d Initial commit: E-TIB production hardening & E2E foundation
Former-commit-id: ef04fca3d76375630c05aac117bf586953f3b657
2026-04-28 19:11:38 +02:00

1.2 KiB

icu-minify

ICU message format compiler with a 650 bytes runtime

Features

  1. Build-time compilation
    Converts ICU messages to a compact JSON intermediate representation
  2. Minimal runtime 📦
    650 bytes (minified + compressed) with zero runtime dependencies
  3. Full ICU support 🌍
    {arguments}, plural, select, selectordinal, date, time, number and <tags>

Usage

import compile from 'icu-minify/compile';
import format from 'icu-minify/format';

// At build time
const compiled = compile('Hello {name}!');

// ["Hello ", ["name"], "!"]
console.log(compiled);

// At runtime
format(compiled, 'en', {name: 'World'});

Acknowledgments

This library is heavily inspired by icu-to-json and @lingui/message-utils, which similarly use an array-based intermediate representation for compiled messages.

Design

For detailed design rationale, motivation, tradeoffs, and implementation details, see RFC: Ahead-of-time compilation of ICU messages.