{"id":25893,"library":"lisan-compiler","title":"lisan-compiler","description":"Lisan Compiler v0.1.1 compiles Translation objects into Dictionary objects for the Lisan i18n library. It provides functions like parseLisanLiteral, parse, and generate. Designed as a build-time tool (devDependency) to precompile translations, reducing runtime overhead. The library is TypeScript-friendly, ships type definitions, and supports UMD browser usage via CDN. Lisan focuses on minimal bundle size and performance. Compiler handles Lisan Literal syntax and converts it to optimized dictionary format.","status":"active","version":"0.1.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/lisanjs/lisan","tags":["javascript","i18n","l10n","cli","lisan","translation","internationalization","localization","compiler","typescript"],"install":[{"cmd":"npm install lisan-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add lisan-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add lisan-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM import preferred. The package is tree-shakeable.","wrong":"const parseLisanLiteral = require('lisan-compiler').parseLisanLiteral;","symbol":"parseLisanLiteral","correct":"import { parseLisanLiteral } from 'lisan-compiler';"},{"note":"parse is a named export, not default.","wrong":"import parse from 'lisan-compiler';","symbol":"parse","correct":"import { parse } from 'lisan-compiler';"},{"note":"ESM style; CJS require also works but may not benefit from tree-shaking.","wrong":"const generate = require('lisan-compiler').generate;","symbol":"generate","correct":"import { generate } from 'lisan-compiler';"}],"quickstart":{"code":"import { parse, generate } from 'lisan-compiler';\n\nconst translations = {\n  greeting: 'Hello, {name}!',\n  farewell: { default: 'Goodbye', evening: 'Good night' },\n};\n\nconst dictionary = generate(parse(translations));\nconsole.log(dictionary);\n// Output:\n// {\n//   greeting: { t: 'Hello, {name}!', p: ['name'] },\n//   farewell: { t: { default: 'Goodbye', evening: 'Good night' }, p: [] }\n// }","lang":"typescript","description":"Compiles a translations object into a Lisan dictionary using parse and generate."},"warnings":[{"fix":"Always call parse() first, then generate().","message":"parse and generate are separate steps; calling generate on raw translations will throw.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Access named exports via window.lisanCompiler in UMD.","message":"The UMD global is lisanCompiler, not lisanCompiler. Default export behavior differs between builds.","severity":"deprecated","affected_versions":"0.1.0-0.1.1"},{"fix":"Use parse() for objects, parseLisanLiteral() for individual literals.","message":"parseLisanLiteral expects a single Lisan Literal string, not full translations object.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Wrap the object in an array: parse([translations]) instead of parse(translations).","cause":"Passing a single translation object without an array where an array is expected.","error":"TypeError: translations.map is not a function"},{"fix":"Move lisan-compiler to dependencies if needed, or use it in build scripts only.","cause":"Installed as devDependency but trying to use in runtime code.","error":"Cannot find module 'lisan-compiler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}