Create a TypeScript Project

From Scratch

mkdir myproj && cd myproj
npm init -y
npm i -D typescript @types/node tsx
npx tsc --init        # generates tsconfig.json

Sensible tsconfig.json starting points:

{
  "compilerOptions": {
    "target": "ES2023",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "outDir": "dist"
  }
}

Run without a build step during dev:

npx tsx src/index.ts        # execute TS directly
node --watch dist/index.js  # after tsc build

AWS CDK Project

npx aws-cdk init --language typescript

Recommended alias (skip a global install):

alias cdk="npx aws-cdk"

See AWS CDK for the construct model and deploy workflow.