qbasic
v0.1.4
Published
API to run qb.js inside node
Readme
QBasic.js
QBasic.js allows you to use qb.js inside node projects.
Example
CLI
$ npx qbasic --source=filePath.basindex.js
const { compileFile } = require("qbasic");
const fs = require("fs");
const { bytecode } = compileFile("./demo.bas");
fs.writeFileSync("./bytecode.txt", bytecode);demo.bas
CLS
PRINT "Hello from QBasic"
ENDbytecode.txt
' L1 CLS
syscall CLS
' L2 PRINT "Hello from QBasic"
pushconst Hello from QBasic
syscall print
pushconst
syscall print
' L3 END
end
ret
end