Russian JavaScript Transpiler

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

A transpiler (v1.0.1) that converts Russian-language JavaScript-like code into standard JavaScript, enabling Russian speakers to write programs using native keywords. Supports modern JS features including variables, control flow, loops, functions, classes, error handling, modules, and template literals. Provides a CLI tool and programmatic API. Extensible architecture with full TypeScript support. Requires Node >=14.0.0. Differentiators: comprehensive mapping of Russian keywords to JS, support for standard JS features, and TypeScript-first development.

error Error: Cannot find module 'russian-js-transpiler'
cause Package not installed or not in node_modules.
fix
Run npm install russian-js-transpiler or check your import path.
error TypeError: rjs is not a function
cause Default import was used but called directly instead of accessing `.transpile`.
fix
Use import { transpile } from 'russian-js-transpiler' or call rjs.transpile(code).
error SyntaxError: Unexpected token 'переменная'
cause Trying to run .rjs file directly with Node.js instead of transpiling first.
fix
Transpile the .rjs file using rjs -i file.rjs -o file.js then run node file.js.
gotcha Russian keywords are case-sensitive; 'Переменная' (capitalized) will not be recognized as 'переменная'.
fix Always use lowercase Russian keywords as shown in documentation.
gotcha The default export is an object, not a function. Attempting to call `rjs(code)` will throw 'rjs is not a function'.
fix Use named import `{ transpile }` or access `rjs.transpile`.
breaking Version 1.0.0 removed support for the `translator` function; use `transpile` instead.
fix Replace `translator(code)` with `transpile(code)`.
deprecated The `--output` CLI flag is deprecated in v1.0.1; use `--out` instead.
fix Use `rjs -i input.rjs -o output.js`
npm install russian-js-transpiler
yarn add russian-js-transpiler
pnpm add russian-js-transpiler

Demonstrates basic transpilation using the named `transpile` function.

import { transpile } from 'russian-js-transpiler';

const russianCode = `
функция приветствовать(имя) {
  вернуть "Привет, " + имя + "!";
}
`;

const jsCode = transpile(russianCode);
console.log(jsCode);
// Output:
// function приветствовать(имя) {
//   return "Привет, " + имя + "!";
// }