HinJS CLI

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

HinJS CLI (v0.3.0) is an experimental transpiler that converts .hjs files written with Hindi keywords into standard JavaScript. It acts as a preprocessor, replacing keywords like 'rakho', 'kaam', 'agar', 'likho' with their JavaScript equivalents. Built on top of Babel, it supports single file and directory compilation, generates source maps, and is installable via npm. Unlike full-language transpilers, HinJS is a simple keyword substitution layer, making it lightweight but limited in scope. Release cadence is irregular; breaking changes may occur between minor versions. Primarily designed for educational or playful use, not production.

error Error: Cannot find module '@babel/core'
cause Missing Babel dependency – hinjs-cli lists @babel/core as a peer dependency but does not install it automatically.
fix
Run 'npm install @babel/core' in your project.
error hinjs: error: required option '--out-dir <path>' not specified
cause Using '-d' without a value or providing '--output-dir' (wrong flag name).
fix
Use 'hinjs src -d dist' or 'hinjs src --out-dir dist'. Do not use '--output-dir'.
error SyntaxError: Unexpected token (1:6)
cause .hjs file contains invalid Hindi keyword or missing space/punctuation (e.g., 'sthir greeting="Hello"' without space).
fix
Ensure proper spacing: 'sthir greeting = "Hello";'. Check that all keywords are correctly spelled (e.g., 'vaps' instead of 'lautao').
error ReferenceError: console is not defined
cause Running transpiled JS in an environment without console (e.g., strict mode in some runners).
fix
The output file uses 'console.log'; ensure your environment supports it (Node.js or modern browser).
breaking Keyword mapping may change without major version bump – code written for v0.1 may not work in v0.3.
fix Lock version to exact minor; test transpiled output after upgrades.
deprecated 'dohrao' (loop) mapping may be deprecated in future – consider using 'while' or direct JS loops.
fix Use 'while' keyword or standard JS loops in .hjs files for stability.
gotcha The CLI does not support watch mode or incremental compilation – each run transpiles all files from scratch.
fix Use external file watchers (e.g., nodemon) with --delay flag to trigger rebuilds.
gotcha All .hjs files in the source directory are transpiled, including partials or test files – no ignore mechanism.
fix Organize .hjs source files in a dedicated folder (e.g., src/) and avoid placing non-project files there.
breaking Output file names may collide if input files have the same name in different subdirectories (no collision detection).
fix Use unique file names or run per-directory.
npm install hinjs-cli
yarn add hinjs-cli
pnpm add hinjs-cli

Shows global install, creation of a .hjs file with Hindi keywords, transpilation to JS, and viewing the output.

// Install globally
npm install -g hinjs-cli

// Create example.hjs
cat > example.hjs << 'EOF'
sthir greeting = "Namaste Duniya";
rakho score = 80;

kaam calculateGrade(s) {
    agar (s > 90) {
        lautao "A";
    } warna agar (s > 75) {
        lautao "B";
    } warna {
        lautao "C";
    }
}

likho(greeting);
likho("Grade:", calculateGrade(score));
EOF

// Compile
hinjs example.hjs

// Check output
cat example.js