bengaliscript
Version:
🚀 BengaliScript — Code in pure বাংলা! Write, run, and see output entirely in Bengali. Break language barriers, bring code closer to culture. Crafted with ❤️ by Atikin Verse.
37 lines (31 loc) • 1.04 kB
JavaScript
/* Created by Atikin Verse */
import { Command } from "commander";
import path from "path";
import fs from "fs";
import { runBS } from "./index.js";
const program = new Command();
program
.name("bengaliscript")
.description("Run BengaliScript (.bs) files")
.argument("<file>", "Path to .bs file")
.option("--no-dom", "Disable in-memory DOM")
.action(async (file, options) => {
try {
if (!file.endsWith(".bs")) {
console.error("Please provide a .bs file.");
process.exit(1);
}
const abs = path.isAbsolute(file) ? file : path.join(process.cwd(), file);
if (!fs.existsSync(abs)) {
console.error(`File not found: ${abs}`);
process.exit(1);
}
// 👉 Pass only the file path; index.js will read + translate + run
await runBS(abs, { enableDOM: options.dom });
} catch (err) {
console.error("Error:", err?.message ?? err);
process.exit(1);
}
});
program.parse(process.argv);