# Bun Project taste of a TypeScript developer who wants one fast tool for everything
- Use Bun as the runtime, package manager, test runner and bundler in new TypeScript projects instead of stitching together Node, npm, Jest and esbuild. Confidence: 0.85
- Pin the Bun version in package.json "packageManager" and in CI with oven-shhttps://www.aitopic.com/setup-bun so every machine runs the same build. Confidence: 0.90
- Commit the text lockfile (bun.lock) and run bun install --frozen-lockfile in CI. Confidence: 0.95
- Write TypeScript directly and let Bun run it; keep tsc only for type checking with "noEmit": true. Confidence: 0.90
- Turn on "strict", "noUncheckedIndexedAccess" and "verbatimModuleSyntax" in tsconfig.json. Confidence: 0.85
- Use ES modules only; no CommonJS require in new code. Confidence: 0.90
- Serve HTTP with Bun.serve and its routes object for small services; reach for Hono when you need middleware and validation. Confidence: 0.80
- Read files with Bun.file and write with Bun.write instead of pulling in fs-extra. Confidence: 0.75
- Use the built-in bun:sqlite for local and embedded data before adding a native SQLite package. Confidence: 0.75
- Prefer Web standard APIs (fetch, Request, Response, URL, crypto.subtle) so code also runs on Node, Deno and edge runtimes. Confidence: 0.85
- Write tests with bun:test (describe, test, expect, mock) and keep them next to the code as *.test.ts. Confidence: 0.85
- Run bun test --coverage in CI and fail the job on new uncovered critical paths, not on a global percentage. Confidence: 0.70
- Load configuration from Bun's automatic .env loading plus a Zod schema that validates process.env at startup. Confidence: 0.85
- Never commit .env files; commit .env.example with every key and a comment. Confidence: 0.95
- Define scripts in package.json (dev, test, typecheck, lint, build) and call them with bun run so CI and humans use the same commands. Confidence: 0.90
- Use bun --watch for dev servers and bun --hot only when in-memory state must survive reloads. Confidence: 0.70
- Build single-file executables with bun build --compile for CLIs and small services shipped to servers. Confidence: 0.75
- Use Biome for linting and formatting to keep the toolchain as fast as the runtime. Confidence: 0.75
- Use Bun workspaces for monorepos and reference internal packages with "workspace:*". Confidence: 0.80
- Check a dependency for native addons or Node-only internals before adopting it, and keep a short list of known-incompatible packages in the README. Confidence: 0.70
- Ship Docker images from the official ovenhttps://www.aitopic.com/bun slim image with a multi-stage build and a non-root user. Confidence: 0.80
- Keep Node compatibility as a fallback: run the test suite on Node once a week if the package is published to npm. Confidence: 0.65
Comments & Questions (0)
No comments yet
Be the first to comment!