The Axiom

JavaScript / TypeScript

5 pages

Start here

Hub

JavaScript/TypeScript Brain

JavaScript/TypeScript Brain hub — covers the full JS/TS ecosystem for AI engineers: Node.js async model, TypeScript type system, pnpm package management, and production AI SDK patterns.

AI SDK Patterns in TypeScript

Two TypeScript SDK layers for LLM work — @anthropic-ai/sdk for direct Anthropic API access (streaming, tool use, prompt caching) and the Vercel AI SDK for unified multi-provider UI-connected streaming (streamText, generateObject, useChat).

anthropic-sdkvercel-ai-sdkstreamingtool-use

Node.js Async and the Event Loop

Node.js runs JavaScript on a single-threaded event loop backed by libuv's thread pool — I/O is non-blocking by default, CPU work blocks everything; async/await is syntactic sugar over Promises; key gotchas vs Python asyncio are explicit context, unhandled rejections, and the lack of asyncio.gather semantics.

nodejsasyncevent-looplibuv

npm, pnpm, and the Node.js Ecosystem

pnpm is the production-grade Node.js package manager — 3-5x faster than npm via a global content-addressable store with hard links, strict dependency isolation by default, and first-class monorepo workspace support.

npmpnpmpackage-managementworkspaces

TypeScript Fundamentals

TypeScript type system for AI engineers — type narrowing, interfaces vs types, generics for LLM response wrappers, utility types (Partial/Required/Pick/Omit), satisfies operator, as const, and a production-ready strict tsconfig.

typescripttype-systemgenericsutility-types