Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Bun Runtime?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-bun-runtime-anvil)
---
name: bun-runtime
description: "Build and run TypeScript apps with Bun safely: lockfiles, native APIs, Node compatibility and bun test"
---
<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->
# Bun runtime
Use when developing, testing, or containerizing services targeting the Bun runtime.
## Dependencies and determinism
- Commit `bun.lock` (text lockfile in Bun 1.2+) and run `bun install --frozen-lockfile` in CI so dependency resolution is reproducible.
- Set explicit Node/Bun version expectations (`package.json` `engines`) if a workspace shares tooling with Node.
## Native APIs and Node compatibility
- Prefer `Bun.serve`, `Bun.file`, `Bun.password`, and `bun:sqlite` for clean fast paths in Bun-only apps, while wrapping platform calls behind interfaces if libraries also target Node.
- Test native CJS/N-API dependencies (`bcrypt`, `sharp`, Prisma engines) early; Bun implements most `node:*` built-ins, but niche native addons or `node:vm` edge semantics can differ.
- Use Bun's built-in `.env` loading carefully in CI/production so local `.env` files are never baked into container images.
## Testing and bundling
- Use `bun test` (`bun:test`) with isolated setup via `bunfig.toml` preloads; avoid global module mocks that leak across test files.
- When building bundles (`bun build`), specify `--target=bun` or `--target=browser` explicitly and exclude native server packages with `--external`.
## Verify
Run `bun test`, `tsc --noEmit` (Bun strips types without typechecking), and smoke-test the built bundle or container image under production env vars.