Registry / serialization / hinjs-cli

hinjs-cli

JSON →
library0.3.0jsnpmunverified

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.

npm install hinjs-cli
INSTALL
IMPORT
SIG · HINJS-CLI
H
hinjs-cli
serializationjavascriptv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

hinjs CLI (executable)
npx hinjs input.hjs
hinjs input.hjs (without global install)
The package provides a CLI binary, not a programmatic API. Use npx or install globally.
Transpilation via CLI
hinjs src -d dist
hinjs src --output-dir dist
--outdir is the correct flag for directory output; '-d' is shorthand. Using '--output-dir' gives error.
package.json script
{"build": "hinjs ./src -d ./dist"}
{"build": "hinjs src --outDir dist"}
CLI uses lowercase '-d' or '--out-dir'. Watch: '--outDir' is invalid.

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
hinjs --version
Debug
Known issues
breakingKeyword 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.
affects: >=0.1.0 <0.4.0
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.
affects: >=0.1.0 <0.4.0
gotchaThe 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.
affects: >=0.1.0
gotchaAll .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.
affects: >=0.1.0
breakingOutput 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.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module '@babel/core'
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.
hinjs: error: required option '--out-dir <path>' not specified
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'.
SyntaxError: Unexpected token (1:6)
.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').
ReferenceError: console is not defined
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).
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies
@babel/corerequiredUsed for parsing and transforming JavaScript code (transpilation engine)
@babel/preset-envrequiredEnsures output JavaScript is compatible with target environments
commanderrequiredProvides CLI argument parsing and command structure
Agent activity
6 hits · last 30 days
node
6
Resources
hinjs-cli — npm install hinjs-cli · libregistry