{"id":26401,"library":"slt-js","title":"slt-js","description":"SLT (Script Localization Tool) transpiler for JavaScript that replaces localized keywords in ES (Spanish), FR (French), and IT (Italian) source files with canonical JavaScript keywords. Version 0.2.0, pre-1.0, with no scheduled release cadence. Differentiators: simple reference implementation with header-based language detection (#!slt <lang>), custom mapping support, and CLI. Limitations: not a full JS tokenizer, may mishandle regex literals; not production-ready.","status":"active","version":"0.2.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","slt","localization","transpiler"],"install":[{"cmd":"npm install slt-js","lang":"bash","label":"npm"},{"cmd":"yarn add slt-js","lang":"bash","label":"yarn"},{"cmd":"pnpm add slt-js","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"No programmatic API; only CLI usage.","wrong":"npx slt-js <file> (does not expose programmatic API)","symbol":"slt-js (CLI)","correct":"slt-js <file> [options]"}],"quickstart":{"code":"// example-esp.js\n#!slt es\nfunction saludar(nombre) {\n  consola.escribir('Hola, ' + nombre);\n}\n\n// Install globally: npm install -g slt-js\n// Transpile: slt-js example-esp.js -o example.js\n// Output:\n// function saludar(nombre) {\n//   console.log('Hola, ' + nombre);\n// }","lang":"javascript","description":"Transpile a Spanish-localized JavaScript file to canonical JS using the CLI tool."},"warnings":[{"fix":"Ensure the file starts with '#!slt <lang>' on the first line, no BOM or spaces.","message":"SLT header must be exactly at line 1, no leading whitespace.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Avoid using localized keywords inside strings or comments, or use a full parser like @babel/parser.","message":"Transpiler is not token-aware and may modify strings or comments if they contain localized keywords.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use --map to provide a custom mapping file for other languages.","message":"Only three built-in languages: es, fr, it.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Check file path and ensure the file exists.","cause":"File not found.","error":"slt-js: error: cannot read file 'nonexistent.js'"},{"fix":"Add '#!slt es' (or fr/it) as the first line of the source file.","cause":"Missing or malformed SLT header on first line.","error":"Error: No language header found. Use #!slt <lang> at the top of the file."},{"fix":"Ensure mapping file is valid JSON with key-value pairs: { \"localized\": \"canonical\" }.","cause":"JSON parse error or invalid structure.","error":"slt-js: error: Invalid mapping file 'bad.json'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}