TypeScript - philipf/notebook GitHub Wiki
Install
Install NVM, check NVM git repo for the latest version:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
Install a stable version of Node
nvm install stable
Install TypeScript, in local development dir.
npm install typescript --save-dev
TypeScript init and run
# Generate tsconfig.json
npx tsc --init
# Compile hello.js
npx tsc hello.ts
# Watch for changes
npx tsc --watch
VS Code
Install Live Server
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "pwa-chrome",
"url": "/home/philipf/dev/automata/index.html",
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/helloworld.ts",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": ["${workspaceFolder}/out/**/*.js"]
}
]
}