Registry / devops / slt-js

slt-js

JSON →
library0.2.0jsnpmunverified

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.

npm install slt-js
INSTALL
IMPORT
SIG · SLT-JS
S
slt-js
devopsjavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

slt-js (CLI)
slt-js <file> [options]
npx slt-js <file> (does not expose programmatic API)
No programmatic API; only CLI usage.

Transpile a Spanish-localized JavaScript file to canonical JS using the CLI tool.

// example-esp.js #!slt es function saludar(nombre) { consola.escribir('Hola, ' + nombre); } // Install globally: npm install -g slt-js // Transpile: slt-js example-esp.js -o example.js // Output: // function saludar(nombre) { // console.log('Hola, ' + nombre); // }
slt --version
Debug
Known issues
gotchaSLT header must be exactly at line 1, no leading whitespace.
fix
Ensure the file starts with '#!slt <lang>' on the first line, no BOM or spaces.
affects: >=0.0.0
gotchaTranspiler is not token-aware and may modify strings or comments if they contain localized keywords.
fix
Avoid using localized keywords inside strings or comments, or use a full parser like @babel/parser.
affects: >=0.0.0
gotchaOnly three built-in languages: es, fr, it.
fix
Use --map to provide a custom mapping file for other languages.
affects: >=0.0.0
Errors
Common errors & fixes
slt-js: error: cannot read file 'nonexistent.js'
File not found.
fix
Check file path and ensure the file exists.
Error: No language header found. Use #!slt <lang> at the top of the file.
Missing or malformed SLT header on first line.
fix
Add '#!slt es' (or fr/it) as the first line of the source file.
slt-js: error: Invalid mapping file 'bad.json'
JSON parse error or invalid structure.
fix
Ensure mapping file is valid JSON with key-value pairs: { "localized": "canonical" }.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
slt-js — npm install slt-js · libregistry