betterscript
v1.0.2
Published
like typescript idk
Downloads
6
Maintainers
Readme
betterScript
Better Script is a package for javascript that is meant to keep errors out of the workflow with feature like automatic typecasting and global definitions. There it is fine tuned for me, however it is well documented and will be easy to edit and work for yourself if you want. If you have spotted a bug, well idk how to work github. Just don't commit to master branch. Also if you fork this, please let me know. I would love to see your work and maybe it can influence future versions of this project!
Installation
Currently there is an npm repo avalible. To install just run:
npm i betterscript
Usage
Okay so this shouldn't be too complex. Say you have a file and want to run it as betterScript instantly in node js. This is how you would do so.
const fs = require('fs');
const bs = require('betterscript');
// read a file with betterscript code in it
let myFile = fs.readFileSync('server.js');
// make sure the file is not still a buffer
MyFile = myFile.toString();
// create an instance with the code from the file
let MyInstance = new bs(MyFile);
// get the string for the file just read
let MyCode = MyInstance.string;
// finally run the code
eval(MyCode);