Skip to content
Back to skills

Bun Runtime

ASecurity

Build and run TypeScript apps with Bun safely: lockfiles, native APIs, Node compatibility and bun test

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 30, 2026
developmenttypescriptsqlnodetestingapi

Works with

  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill bun-runtime --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bun Runtime?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Bun Runtime
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-bun-runtime/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-bun-runtime)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Build and run TypeScript apps with Bun safely: lockfiles, native APIs, Node compatibility and bun test
profile: standard
tags: bun, typescript, runtime, tooling
---

# 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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.