Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twlite/qbasic
QBasic compiler that runs on node.js
https://github.com/twlite/qbasic
compiler node qbasic
Last synced: 26 days ago
JSON representation
QBasic compiler that runs on node.js
- Host: GitHub
- URL: https://github.com/twlite/qbasic
- Owner: twlite
- License: gpl-3.0
- Created: 2021-12-13T16:23:09.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-15T15:13:49.000Z (almost 3 years ago)
- Last Synced: 2024-10-01T08:08:15.162Z (about 1 month ago)
- Topics: compiler, node, qbasic
- Language: TypeScript
- Homepage: https://npmjs.com/package/qbasic
- Size: 47.9 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QBasic.js
QBasic.js allows you to use **[qb.js](https://github.com/smhanov/qb.js)** inside node projects.
# Example
## CLI
```sh
$ npx qbasic --source=filePath.bas
````index.js`
```js
const { compileFile } = require("qbasic");
const fs = require("fs");const { bytecode } = compileFile("./demo.bas");
fs.writeFileSync("./bytecode.txt", bytecode);
````demo.bas`
```basic
CLS
PRINT "Hello from QBasic"
END
````bytecode.txt`
```txt
' L1 CLS
syscall CLS
' L2 PRINT "Hello from QBasic"
pushconst Hello from QBasic
syscall print
pushconstsyscall print
' L3 END
end
ret
end
```