BanglaScript
raw JSON → 4.1.0 verified Fri May 01 auth: no javascript
BanglaScript is a transpiler that converts Bangla (Bengali) syntax into JavaScript, enabling native Bengali speakers to code in their mother tongue. Current stable version is 4.1.0, released with regular updates. It offers a CLI, REPL, project templates, caching, and full support for modern JavaScript features including async/await, classes, and modules. Differentiates from other language-localization projects by providing a complete toolchain (build, watch, eval) and TypeScript type definitions.
Common errors
error Error: Cannot find module 'banglascript' ↓
cause Package not installed or not globally linked.
fix
Run 'npm install -g banglascript' to install globally.
error SyntaxError: Unexpected token ↓
cause Mixing BanglaScript with plain JavaScript in the same file without proper extension.
fix
Use .bjs extension for BanglaScript files; avoid mixing syntaxes.
error bjs: command not found ↓
cause Global npm bin not in PATH.
fix
Add '$(npm root -g)/bin' to PATH or use 'npx bjs'.
Warnings
breaking v4.0 changed transpiler output format; built JavaScript may differ from v3. ↓
fix Rebuild all .bjs files with v4. Review generated JS for breaking changes like variable scoping.
deprecated CLI commands 'bjs transpile' and 'bjs eval' are deprecated in v4.1. ↓
fix Use 'bjs run <file>' for eval-like behavior or 'bjs build' with stdin redirection.
gotcha Async keywords like 'অ্যাসিঙ্ক' and 'অপেক্ষা_করো' must be used exactly as documented; typos may cause silent failures. ↓
fix Always use the predefined keyword map; refer to the README table.
gotcha When using '--no-translit', Bangla identifiers are preserved but may cause issues with JavaScript tools that expect ASCII. ↓
fix Use '--translit' (default) to convert identifiers to transliterated Latin script for better tool compatibility.
Install
npm install banglascript yarn add banglascript pnpm add banglascript Imports
- bjs CLI wrong
node bjs run file.bjscorrectnpx bjs run file.bjs
Quickstart
npm install -g banglascript && bjs init my-project && cd my-project && echo 'ধ্রুবক নাম = "দুনিয়া"; লিখো(`হ্যালো ${নাম}!`);' > src/main.bjs && bjs run src/main.bjs