deno-to-bun — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited deno-to-bun (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are assisting with migrating an existing Deno project to Bun. This involves converting Deno APIs, updating configurations, and adapting to Bun's runtime model.
For detailed patterns, see:
Check if Bun is installed:
bun --versionAnalyze current Deno project:
# Check Deno version
deno --version
# Check for deno.json/deno.jsonc
ls -la | grep -E "deno.json|deno.jsonc"
# List permissions used
grep -r "deno run" .Read deno.json or deno.jsonc to understand the project configuration.
Common Deno APIs and their Bun equivalents:
#### File System
// Deno
const text = await Deno.readTextFile("file.txt");
await Deno.writeTextFile("file.txt", "content");
// Bun
const text = await Bun.file("file.txt").text();
await Bun.write("file.txt", "content");#### HTTP Server
// Deno
Deno.serve({ port: 3000 }, (req) => {
return new Response("Hello");
});
// Bun
Bun.serve({
port: 3000,
fetch(req) {
return new Response("Hello");
},
});#### Environment Variables
// Deno
const value = Deno.env.get("KEY");
// Bun (same as Node.js)
const value = process.env.KEY;#### Reading JSON
// Deno
const data = await Deno.readTextFile("data.json");
const json = JSON.parse(data);
// Bun
const json = await Bun.file("data.json").json();For complete API mapping, see api-mapping.md.
Convert deno.json to package.json and bunfig.toml:
deno.json:
{
"tasks": {
"dev": "deno run --allow-net --allow-read main.ts",
"test": "deno test"
},
"imports": {
"oak": "https://deno.land/x/[email protected]/mod.ts"
},
"compilerOptions": {
"lib": ["deno.window"]
}
}package.json (Bun):
{
"name": "my-bun-project",
"type": "module",
"scripts": {
"dev": "bun run --hot main.ts",
"test": "bun test"
},
"dependencies": {
"hono": "^3.0.0"
}
}bunfig.toml:
[test]
preload = ["./tests/setup.ts"]Deno imports:
// Deno - URL imports
import { serve } from "https://deno.land/[email protected]/http/server.ts";
import { oak } from "https://deno.land/x/[email protected]/mod.ts";Bun imports:
// Bun - npm packages
import { Hono } from "hono";
// Or for std library equivalents, use npm packagesCommon replacements:
deno.land/std/http → hono or native Bun.servedeno.land/x/oak → hono or expressdeno.land/std/testing → bun:testdeno.land/std/path → Node.js path moduleDeno permissions:
deno run --allow-read --allow-write --allow-net main.tsBun (no permission system):
bun run main.ts # Full system access by defaultSecurity implications:
For detailed permission migration, see permissions.md.
Deno allows extension-less imports:
// Deno
import { helper } from "./utils"; // Resolves to utils.tsBun requires extensions:
// Bun
import { helper } from "./utils.ts"; // Explicit extensionDeno test:
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
Deno.test("example", () => {
assertEquals(1 + 1, 2);
});Bun test:
import { test, expect } from "bun:test";
test("example", () => {
expect(1 + 1).toBe(2);
});Create or update package.json:
{
"name": "migrated-from-deno",
"type": "module",
"scripts": {
"dev": "bun run --hot main.ts",
"start": "bun run main.ts",
"test": "bun test"
},
"dependencies": {
"hono": "^3.0.0"
}
}# Remove deno.lock if present
rm deno.lock
# Install Bun dependencies
bun installCreate tsconfig.json:
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["bun-types"],
"lib": ["ES2022"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"allowImportingTsExtensions": true,
"noEmit": true
}
}Deno:
Deno.serve({ port: 3000 }, (req) => {
const url = new URL(req.url);
if (url.pathname === "/") {
return new Response("Hello");
}
return new Response("Not found", { status: 404 });
});Bun:
Bun.serve({
port: 3000,
fetch(req) {
const url = new URL(req.url);
if (url.pathname === "/") {
return new Response("Hello");
}
return new Response("Not found", { status: 404 });
},
});Deno:
const file = await Deno.open("file.txt");
const decoder = new TextDecoder();
const content = decoder.decode(await Deno.readAll(file));
file.close();Bun:
const content = await Bun.file("file.txt").text();Deno:
const apiKey = Deno.env.get("API_KEY");
Deno.env.set("NEW_VAR", "value");Bun:
const apiKey = process.env.API_KEY;
process.env.NEW_VAR = "value"; // Note: Setting at runtime doesn't persistDeno:
const command = new Deno.Command("ls", {
args: ["-la"],
});
const { stdout } = await command.output();Bun:
import { $ } from "bun";
const output = await $`ls -la`.text();Run these commands to verify migration:
# 1. Install dependencies
bun install
# 2. Type check
bun run --bun tsc --noEmit
# 3. Run tests
bun test
# 4. Try development server
bun run dev
# 5. Test production build (if applicable)
bun run buildPresent this checklist to the user:
bun installbun testDeno.* APIs (use Bun/Node equivalents)Once migration is complete, provide summary:
Suggest to the user:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.