README
@ainc/script
Script compiler for typescript
Install
$ yarn global add @ainc/script
Usage
# execute file
$ esc script.ts
# run code
$ esc -r 'console.log(process.cwd());'
VS Code
{
"name": "Launch Script",
"type": "node",
"request": "launch",
"autoAttachChildProcesses": true,
"runtimeExecutable": "esc",
"args": [
"${file}"
]
}
API
import Script from '@ainc/script';
// create Script
const script = new Script();
// run code
script.run('console.log("run script")');
// execute file
script.execute('./script.ts');
// dependenise file
console.log(script.files);