New typescript project

For frontend dev, the simplest web API to joke around with.

Create the project

npm init -y
npm install --save-dev typescript
nano tsconfig.json
// tsconfig.json
{
  "compilerOptions": {
    "module": "commonjs",
    "esModuleInterop": true,
    "target": "es6",
    "moduleResolution": "node",
    "sourceMap": true,
    "outDir": "dist"
  },
  "lib": ["es2015"]
}

Code

nano src/app.ts

Write the code.

Compile and run

npx tsc
node dist/app.js