Copy of the legacy ~/.pi/agent/docs tree rebuilt as the command-center knowledge base: concept files promoted to path identity, index listings stripped of frontmatter, all wikilinks/relative links resolved, every checkable claim verified against the live fleet (Dankserver = Ryzen 7 7700X + RTX 3090; Strix Halo is Dankclaw), unverifiable claims tagged. kb-lint exits 0.
2.3 KiB
2.3 KiB
type, title, description, tags, timestamp, verified
| type | title | description | tags | timestamp | verified | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| reference | Node.js and JavaScript | Current bootstrap, tooling, and framework best practices for Node.js and JavaScript projects. |
|
2026-08-11 | 2026-08-28 |
CUT
Node.js and JavaScript
This page covers current (2025/2026) best practices for Node.js and JavaScript projects.
Runtime and Package Manager
Use Node.js 22 LTS or Node.js 24 LTS. Use these versions for stability in production.
Choose a package manager by project type:
- npm for the default.
- pnpm for monorepos.
- Bun as an all-in-one runtime, package manager, test runner, and bundler.
TypeScript
TypeScript is the default for new projects. Configure strict: true in tsconfig.json. Target ES2022 or later. Use module: ESNext and moduleResolution: bundler.
Bootstrap
Scaffold a Vite project with:
npm create vite@latest my-app -- --template react-ts
Scaffold a full-stack SSR app with Next.js:
npx create-next-app@latest my-app --yes
Tooling
| Category | Tool | Notes |
|---|---|---|
| Linter | ESLint 9 with flat config | Use eslint.config.mjs. |
| Formatter | Prettier or Biome | Biome is faster and Prettier-compatible. |
| Testing | Vitest or Jest | Vitest is the default for Vite projects. |
| Bundler | Vite or Turbopack | Turbopack is the Next.js default. |
Use Biome if you want one fast tool for lint and format. Biome gained many lint rules from ESLint and TypeScript ESLint.
Frameworks
- Express and Fastify for minimal servers.
- NestJS for structured, opinionated applications.
- Next.js for full-stack React with server-side rendering.
Monorepos
Use Turborepo or Nx for JavaScript and TypeScript monorepos. Combine these tools with pnpm workspaces for dependency management.
Related Technologies
- Remix, Nuxt, Astro, and SvelteKit as other meta-frameworks.
- Deno as an alternative runtime.
- esm.sh as a CDN for npm packages as ES modules.