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.jsonSensible 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 buildAWS CDK Project
npx aws-cdk init --language typescriptRecommended alias (skip a global install):
alias cdk="npx aws-cdk"See AWS CDK for the construct model and deploy workflow.