Setup TypeScript in Node.js project
18 March 2022 (Updated 29 July 2022)
Install packages:
npm i -D typescript ts-node-dev
Create tsconfig.json
:
npx tsc --init
Add NPM script to package.json
:
"scripts": {
"dev": "DEBUG=app:* ts-node-dev --files src/main.ts"
}
Change src/main.ts
to whatever is the entry point to your application.
Tagged:
TypeScript