{"library":"messageformat-cli","title":"messageformat-cli","description":"CLI for compiling ICU MessageFormat strings using the messageformat library. Version 2.1.1 is current stable. Provides a command-line interface to convert messageformat JSON files to JavaScript modules. Requires messageformat as a peer dependency. Lightweight wrapper with no additional runtime dependencies. Supports Node.js >=6.0. Not actively developed; core library has moved to version 4.x with breaking changes.","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install messageformat-cli"],"cli":{"name":"messageformat","version":null}},"imports":["messageformat-cli is used as a CLI tool; no programmatic import. Run via npx messageformat-cli or global install.","messageformat-cli generates a .js file that can be imported as a CommonJS module. const msg = require('./messages.js');","npx messageformat-cli input.json output.js"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"npm install -g messageformat-cli messageformat@2\n# Create a JSON file with translations\ncat > messages.json <<EOF\n{\n  \"greeting\": \"Hello {name}!\",\n  \"farewell\": \"Goodbye {name}!\"\n}\nEOF\n# Compile to JavaScript\nmessageformat-cli messages.json messages.js\n# Use in Node.js\nconst greeting = require('./messages.js').greeting;\nconsole.log(greeting({ name: 'World' })); // Output: Hello World!","lang":"typescript","description":"Shows installation, creating a message JSON file, running the CLI to compile, and using the generated module.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}