Install
npm install -g typescript
$
TypeScript adds optional static types to JavaScript so editors and the tsc compiler can flag mistakes before code runs, such as accessing a property that does not exist on an object. The compiler simply strips the types, emitting plain JavaScript that runs anywhere JS does, including browsers, Node.js, Deno, and Bun. Reach for it on any non-trivial JS project where type checking and richer editor tooling pay off.