First Step: Check node install or not: node --version
Second Step
// global
npm install -g typescript
// local
npm install --save-dev typescriptCheck installed or not: tsc --version
tsc file-name
// If you don't want to do the same comman everytime, then use the following
tsc file-name --watch- tsc file-name to convert ts file to js file
- now run js code using node
else
- install ts-node-dev
- install globally
npm i -g ts-node-dev
ts-node-dev --respawn --transpile-only ts_file_location
</br>
# TypeScript Configuration
- in terminal -> tsc --init
- edit rootDir, outDir of tsconfig.json as shown in the following example
- you can also change es version from target of tsconfig.json
</br>