155 — TypeScript with Express and Node (tsc Init, Scripts, rimraf, concurrently)
Full companion narrative for Colt Steele's Express plus TypeScript build — scaffolding the app, installing @types, initializing tsconfig, and wiring dev, build, and serve scripts
Video: 155 · How To Use TypeScript With Express & Node | ~17:04 lesson | watch · Colt Steele
Source: this is a written companion to the video. Part of the Favorite TypeScript Videos curated path, module 00 (foundations) — the framework capstone of the Node run: 154 builds the typed pipeline, and this video runs Express through it. Forward, the
@types/expressinstall replays 149’s declaration lesson inside a shipping build.
Colt builds in layers: a working JavaScript Express app, then TypeScript support, then the script automation that makes the typed workflow livable. Each layer is verified running before the next lands — “Hello from express plus TS” in the route response marks the halfway point, announced before types even enter.
const express = require("express");
const app = express();
const port = 8000;
app.get("/", (req, res) => {
res.send("HELLO FROM EXPRESS + TS (Not TS Yet!)");
});
app.listen(port, () => {
console.log(`now listening on port ${port}`);
});

install: TypeScript plus the Express and Node declarations
“We want typescript here, so I need to install the type declarations for typescript” — one command adds the compiler and both @types packages, closing the exact gap 149 names and 154 closes for bare Node.
npm install typescript @types/express @types/node

configure: tsc init, then point at dist
“I’ll change that to something like dist” — npx tsc --init generates the config, then outDir aims emit at dist with strict, esModuleInterop, and skipLibCheck set. The frame’s full tsconfig block (target es2016, commonjs, consistent casing) is the same config family 154 and 114 document.
npx tsc --init

script: build, start, dev
“I would do something like npm run build that will get me my JavaScript files” — three scripts cover the lifecycle: build emits, start runs the emit, dev watches plus restarts via nodemon. The typed workflow becomes three memorized commands instead of a flags incantation.
{
"scripts": {
"build": "npx tsc",
"start": "node dist/index.js",
"dev": "npx tsc -w & nodemon dist/index.js"
}
}

harden: rimraf cleans what tsc will not
“I’m going to set up a script for my build instead of just doing NPX” — stale emit is a real bug source, so rimraf dist wipes the output directory before every rebuild. The dependency list in the frame (express, rimraf, typescript, both @types) is the complete typed-Express bill of materials.
rimraf dist && npx tsc

parallelize: concurrently for one-command dev
“Here’s our first command and then we have a space and then the second command follow the same pattern backslash quote” — concurrently runs the watch compiler and nodemon side by side, cross-platform, under a single serve script. The dev loop from the scripts section becomes one command that survives Windows shells too.
concurrently "npx tsc -w" "nodemon dist/index.js"

The applied end of the Node run: backward it spends 154’s pipeline on a real framework and 152’s server primitive grows into Express. Its @types install is the production instance of 149’s lesson. No corpus successor continues the backend story — the next step is the reader’s own API.
Prev: 154 — TypeScript Setup for Node.js · Next: 156 — Event Loop, Web APIs, Task Queues
Transcript notes: Quotes (“Hello from express plus TS”, “We want typescript here, so I need to install the type declarations for typescript”, “I’ll change that to something like dist”, “I would do something like npm run build that will get me my JavaScript files”, “I’m going to set up a script for my build instead of just doing NPX”, “Here’s our first command and then we have a space and then the second command follow the same pattern backslash quote”) verified against the transcript segments; the app code, install commands, tsconfig contents, and all three script tiers verified against the frame captions. Screenshot refs cover 6 sampled frames in order (source frames 3, 5, 8, 11, 14, 16): frame-0001.png (plain Express app) through frame-0006.png (concurrent serve) across the ~17:04 runtime.