Typescript setup in VSCode
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true
},
"exclude": [
"node_modules"
]
}
class Startup {
public static main(): number {
console.log('Hello World');
return 0;
}
}
Startup.main();
Add typescript globally to to my computer
npm install -g typescript
Check to make sure it worked
tsc --version
tsc --help
First create a simple config file to build from the typescript files
Create helloworld file in typescript
Build in VSCode with tsconfig.json
type this in
node helloworld.js