{"id":25726,"library":"hinjs-cli","title":"HinJS CLI","description":"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.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/your-username/hinjs-cli","tags":["javascript","hinjs","hindi","transpiler","compiler","language","babel"],"install":[{"cmd":"npm install hinjs-cli","lang":"bash","label":"npm"},{"cmd":"yarn add hinjs-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add hinjs-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for parsing and transforming JavaScript code (transpilation engine)","package":"@babel/core","optional":false},{"reason":"Ensures output JavaScript is compatible with target environments","package":"@babel/preset-env","optional":false},{"reason":"Provides CLI argument parsing and command structure","package":"commander","optional":false}],"imports":[{"note":"The package provides a CLI binary, not a programmatic API. Use npx or install globally.","wrong":"hinjs input.hjs (without global install)","symbol":"hinjs CLI (executable)","correct":"npx hinjs input.hjs"},{"note":"--outdir is the correct flag for directory output; '-d' is shorthand. Using '--output-dir' gives error.","wrong":"hinjs src --output-dir dist","symbol":"Transpilation via CLI","correct":"hinjs src -d dist"},{"note":"CLI uses lowercase '-d' or '--out-dir'. Watch: '--outDir' is invalid.","wrong":"{\"build\": \"hinjs src --outDir dist\"}","symbol":"package.json script","correct":"{\"build\": \"hinjs ./src -d ./dist\"}"}],"quickstart":{"code":"// Install globally\nnpm install -g hinjs-cli\n\n// Create example.hjs\ncat > example.hjs << 'EOF'\nsthir greeting = \"Namaste Duniya\";\nrakho score = 80;\n\nkaam calculateGrade(s) {\n    agar (s > 90) {\n        lautao \"A\";\n    } warna agar (s > 75) {\n        lautao \"B\";\n    } warna {\n        lautao \"C\";\n    }\n}\n\nlikho(greeting);\nlikho(\"Grade:\", calculateGrade(score));\nEOF\n\n// Compile\nhinjs example.hjs\n\n// Check output\ncat example.js","lang":"javascript","description":"Shows global install, creation of a .hjs file with Hindi keywords, transpilation to JS, and viewing the output."},"warnings":[{"fix":"Lock version to exact minor; test transpiled output after upgrades.","message":"Keyword mapping may change without major version bump – code written for v0.1 may not work in v0.3.","severity":"breaking","affected_versions":">=0.1.0 <0.4.0"},{"fix":"Use 'while' keyword or standard JS loops in .hjs files for stability.","message":"'dohrao' (loop) mapping may be deprecated in future – consider using 'while' or direct JS loops.","severity":"deprecated","affected_versions":">=0.1.0 <0.4.0"},{"fix":"Use external file watchers (e.g., nodemon) with --delay flag to trigger rebuilds.","message":"The CLI does not support watch mode or incremental compilation – each run transpiles all files from scratch.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Organize .hjs source files in a dedicated folder (e.g., src/) and avoid placing non-project files there.","message":"All .hjs files in the source directory are transpiled, including partials or test files – no ignore mechanism.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use unique file names or run per-directory.","message":"Output file names may collide if input files have the same name in different subdirectories (no collision detection).","severity":"breaking","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install @babel/core' in your project.","cause":"Missing Babel dependency – hinjs-cli lists @babel/core as a peer dependency but does not install it automatically.","error":"Error: Cannot find module '@babel/core'"},{"fix":"Use 'hinjs src -d dist' or 'hinjs src --out-dir dist'. Do not use '--output-dir'.","cause":"Using '-d' without a value or providing '--output-dir' (wrong flag name).","error":"hinjs: error: required option '--out-dir <path>' not specified"},{"fix":"Ensure proper spacing: 'sthir greeting = \"Hello\";'. Check that all keywords are correctly spelled (e.g., 'vaps' instead of 'lautao').","cause":".hjs file contains invalid Hindi keyword or missing space/punctuation (e.g., 'sthir greeting=\"Hello\"' without space).","error":"SyntaxError: Unexpected token (1:6)"},{"fix":"The output file uses 'console.log'; ensure your environment supports it (Node.js or modern browser).","cause":"Running transpiled JS in an environment without console (e.g., strict mode in some runners).","error":"ReferenceError: console is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}