Setup TypeScript in Node.js project
18 March 2022 (Updated 9 October 2023)
Install packages:
npm i -D typescript tsx @types/node
Create tsconfig.json:
npx tsc --init
Add NPM script to package.json:
"scripts": {
"dev": "DEBUG=app:* tsx watch src/main.ts"
}
Change src/main.ts to whatever is the entry point to your application.
Sources / related
Tagged:
TypeScript
References (2)
Posts that link to this one.
Mentions (1)
Posts this one links to.