Libraries#

TypeScript runs anywhere JavaScript does and uses the same package ecosystem (npm). Most popular JS libraries ship with type definitions or have community types under the @types scope.

Built-in Globals#

  • Array, Map, Set, WeakMap, WeakSet

  • Promise, async / await

  • JSON.parse / JSON.stringify

  • Date, Math, Intl

  • fetch (in modern Node and browsers)

Tooling#

$ npx tsc --init
$ npx tsc
$ npx tsc --noEmit
$ npx tsx src/main.ts
$ npm install -D typescript @types/node

Useful Packages#

  • zod, runtime schemas with inferred types

  • axios / undici / node-fetch, HTTP

  • vitest / jest, testing

  • tsx, run TS without a build step

  • eslint, linting

  • prettier, formatter

  • prisma, type-safe database client

  • pino, structured logging