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.
Tagged:
TypeScript
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment