LVskripts

raw JSON →
1.3.0 verified Fri May 01 auth: no javascript

LVskripts is a transpiler that converts code from a Latvian-language JavaScript syntax (LVskripts) to regular JavaScript, enabling programmers to write JavaScript using Latvian keywords (e.g., 'konstante' for 'const', 'ja' for 'if', 'printēt' for 'console.log'). Version 1.3.0 is the latest stable release; the library is in active development with a focus on educational/novelty use rather than production. It provides both Latvian-to-JS and JS-to-Latvian transpilation via a CLI tool. The package does not expose a programmatic API.

error lvskripts: command not found
cause Package not installed globally or not in PATH.
fix
Run 'npm install -g lvskripts' and ensure npm global bin is in PATH.
error Unexpected token: konstante
cause Attempting to run .lv file directly with Node without transpiling.
fix
Transpile first using 'lvskripts -k input.lv' to generate JavaScript, then run with Node.
error Error: Cannot find module 'lvskripts'
cause Importing the package in code without global install or local node_modules.
fix
Install locally: 'npm install lvskripts' or use CLI globally.
gotcha The package is a CLI tool with no documented programmatic API. Importing it as a Node module may result in unexpected behavior or errors.
fix Use as a CLI only; run via 'lvskripts' command. For programmatic use, consider forking or using child_process.
gotcha CLI flags are in Latvian (e.g., -kompilet, -otradi); not translated to English. Use -h or --help to see available flags.
fix Run 'lvskripts --help' for usage information in Latvian.
breaking No versioning guarantees; breaking changes may occur in minor/patch releases. Review changelog before upgrading.
fix Pin exact version in production or rely on CLI behavior.
npm install lvskripts
yarn add lvskripts
pnpm add lvskripts

Shows how to install the CLI globally and use two main commands: transpile Latvian JS to JS and reverse.

// Install globally
npm install -g lvskripts

// Create a test file 'hello.lv' with Latvian JS:
// konstante x = 10
// ja (x > 5) { printēt("Liels") }

// Transpile to JavaScript:
lvskripts -kompilet hello.lv

// Or use short flag:
lvskripts -k hello.lv

// Reverse transpile from JS to Latvian:
lvskripts -otradi hello.js