This skill guides you through starting Deno projects, configuring deno.json, and managing dependencies with JSR and deno CLI.
npx playbooks add skill donjo/denoland --skill deno-guidance
This skill provides foundational knowledge for building modern Deno applications. Deno is a secure JavaScript/TypeScript runtime that runs TypeScript directly, has built-in tools (formatter, linter, test runner), and uses modern package management through JSR.
deno.json settingsApply these practices whenever working in a Deno project (identified by the presence of deno.json).
When adding dependencies, follow this priority order:
jsr:) - Preferred for Deno-native packagesjsr:@std/http, jsr:@fresh/corenpm:) - Fully supported, use when no JSR alternative existsnpm:express, npm:zodhttps://deno.land/x/ - Deprecated registryjsr: insteadThe Deno standard library lives at @std/ on JSR:
import { serve } from "jsr:@std/http";
import { join } from "jsr:@std/path";
import { assertEquals } from "jsr:@std/assert";
Never use https://deno.land/std/ - always use jsr:@std/*.
Reference: https://docs.deno.com/runtime/fundamentals/
Key concepts:
--allow-net, --allow-read, --allow-envimports fieldRun these commands regularly, especially after significant changes:
deno fmt # Format all files
deno lint # Check for issues
deno test # Run tests
deno add jsr:@std/http # Add a package
deno install # Install all dependencies
deno upgrade # Update packages to latest
In deno.json, you can exclude directories from formatting/linting:
{
"fmt": {
"exclude": ["build/", "node_modules/"]
},
"lint": {
"exclude": ["build/", "node_modules/"]
}
}
For deploying to Deno Deploy, see the dedicated deno-deploy skill.
Quick command: deno deploy --prod
When you need more information:
deno doc <package> - Generate docs for any JSR or npm package locally| Command | Purpose |
|---------|---------|
| deno run file.ts | Run a TypeScript/JavaScript file |
| deno task <name> | Run a task from deno.json |
| deno fmt | Format code |
| deno lint | Lint code |
| deno test | Run tests |
| deno add <pkg> | Add a package |
| deno install | Install dependencies |
| deno upgrade | Update packages |
| deno doc <pkg> | View package documentation |
| deno deploy --prod | Deploy to Deno Deploy |
Using deno.land/x instead of JSR
// ❌ Wrong - deprecated registry
import { serve } from "https://deno.land/x/http/mod.ts";
// ✅ Correct - use JSR
import { serve } from "jsr:@std/http";
Forgetting to run fmt/lint before committing
# ❌ Committing without checking
git add . && git commit -m "changes"
# ✅ Always format and lint first
deno fmt && deno lint && git add . && git commit -m "changes"
Using https://deno.land/std/ for standard library
// ❌ Wrong - old URL
import { join } from "https://deno.land/std/path/mod.ts";
// ✅ Correct - JSR standard library
import { join } from "jsr:@std/path";
Running code without permission flags
# ❌ Confusing error - "Requires net access"
deno run server.ts
# ✅ Grant specific permissions
deno run --allow-net server.ts
Not using deno add for dependencies
# ❌ Manually editing imports without updating deno.json
# (works, but misses lockfile benefits)
# ✅ Use deno add to manage dependencies
deno add jsr:@std/httpWeekly roundup of top Claude Code skills, MCP servers, and AI coding tips.