Quick Steps to add Typescript to an NodeJS app

Add typescript to your NodeJS app in 4 easy steps.

  1. Install typescript and ts-node
npm install -g typescript
npm install -g ts-node

2. Rename js files to end with ts

find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;

3. create a tsconfig.json file

4. run app using ts-node

ts-node {yourMainEntryPoint}.ts

That should be it!