ChavaScript
raw JSON → 0.1.3 verified Fri May 01 auth: no javascript
ChavaScript is a language transpiler (v0.1.3) that translates Hebrew-based syntax into JavaScript. It exposes parse, transpile, and run functions using acorn under the hood. Unlike alternatives like HebML or other multilingual programming languages, ChavaScript focuses on a minimal, intuitive mapping of keywords to JavaScript constructs. The package is experimental and has a low release cadence.
Common errors
error SyntaxError: Unexpected token ↓
cause ChavaScript code has a typo in Hebrew keyword.
fix
Double-check spelling of Hebrew keywords like 'יכולת' (function) and 'יהי' (let).
error TypeError: parse is not a function ↓
cause Using named import incorrectly with CJS require.
fix
Use default import: const chavascript = require('chavascript'); chavascript.parse(...). Or switch to ESM.
Warnings
gotcha Options passed to parse are forwarded to acorn; unsupported acorn options may cause errors. ↓
fix Only use acorn options that are documented: ecmaVersion, sourceType, locations, etc.
deprecated The require('chavascript') CommonJS pattern may be removed in future versions. ↓
fix Use ESM import syntax instead.
gotcha ChavaScript transpiles to JavaScript, but variable names are not transliterated (e.g., Hebrew identifiers remain). ↓
fix Ensure your runtime supports Unicode identifiers (Node.js 12+).
Install
npm install chavascript yarn add chavascript pnpm add chavascript Imports
- chavascript wrong
const chavascript = require('chavascript')correctimport * as chavascript from 'chavascript' - parse wrong
const { parse } = require('chavascript')correctimport { parse } from 'chavascript' - transpile
import { transpile } from 'chavascript'
Quickstart
import { parse, transpile, run } from 'chavascript';
const code = `
יכולת אחד() {
יהי א = 12;
בקרה.תעד(א);
}
אחד();
`;
// Parse into AST
const ast = parse(code);
console.log('AST:', JSON.stringify(ast, null, 2));
// Transpile to JavaScript
const js = transpile(code);
console.log('JS:', js);
// Execute and see output
run(code);