> deno-deploy
You are an expert in Deno Deploy, the globally distributed serverless platform by Deno. You help developers deploy TypeScript/JavaScript applications to 35+ edge locations with zero cold starts, built-in KV storage, BroadcastChannel for real-time, cron scheduling, and npm compatibility — running code within milliseconds of users worldwide without managing infrastructure.
curl "https://skillshub.wtf/TerminalSkills/skills/deno-deploy?format=md"Deno Deploy — Global Edge Serverless Platform
You are an expert in Deno Deploy, the globally distributed serverless platform by Deno. You help developers deploy TypeScript/JavaScript applications to 35+ edge locations with zero cold starts, built-in KV storage, BroadcastChannel for real-time, cron scheduling, and npm compatibility — running code within milliseconds of users worldwide without managing infrastructure.
Core Capabilities
Edge Functions
// main.ts — runs on Deno Deploy edge
import { Hono } from "jsr:@hono/hono";
const app = new Hono();
// KV storage (built-in, globally replicated)
const kv = await Deno.openKv();
app.get("/api/visits", async (c) => {
const result = await kv.get(["visits", "total"]);
return c.json({ visits: result.value ?? 0 });
});
app.post("/api/visits", async (c) => {
// Atomic increment
const result = await kv.get(["visits", "total"]);
const current = (result.value as number) ?? 0;
await kv.atomic()
.check(result) // Optimistic concurrency
.set(["visits", "total"], current + 1)
.commit();
return c.json({ visits: current + 1 });
});
// URL shortener
app.post("/api/shorten", async (c) => {
const { url } = await c.req.json();
const id = crypto.randomUUID().slice(0, 8);
await kv.set(["urls", id], url, { expireIn: 30 * 24 * 60 * 60 * 1000 });
return c.json({ short: `https://myapp.deno.dev/${id}` });
});
app.get("/:id", async (c) => {
const id = c.req.param("id");
const result = await kv.get(["urls", id]);
if (!result.value) return c.text("Not found", 404);
return c.redirect(result.value as string);
});
// Cron (built-in scheduler)
Deno.cron("cleanup expired", "0 * * * *", async () => {
const iter = kv.list({ prefix: ["urls"] });
let cleaned = 0;
for await (const entry of iter) {
if (entry.value === null) {
await kv.delete(entry.key);
cleaned++;
}
}
console.log(`Cleaned ${cleaned} expired URLs`);
});
// BroadcastChannel for real-time (cross-isolate communication)
const channel = new BroadcastChannel("chat");
app.get("/api/chat/stream", (c) => {
const body = new ReadableStream({
start(controller) {
channel.onmessage = (e) => {
controller.enqueue(`data: ${JSON.stringify(e.data)}\n\n`);
};
},
cancel() { channel.close(); },
});
return new Response(body, {
headers: { "Content-Type": "text/event-stream", "Cache-Control": "no-cache" },
});
});
Deno.serve(app.fetch);
Installation
# Install Deno
curl -fsSL https://deno.land/install.sh | sh
# Deploy
deno install -Agf jsr:@deno/deployctl
deployctl deploy --project=my-app main.ts
# Or connect GitHub repo for auto-deploy on push
Best Practices
- Deno KV — Use built-in KV for state; globally replicated, strongly consistent per-region, eventually consistent globally
- Zero cold starts — V8 isolates boot in <5ms; no container startup like Lambda/Cloud Functions
- Edge-first — Code runs in 35+ regions; users hit the nearest edge; ideal for low-latency APIs
- Hono for routing — Use Hono framework for Express-like routing; lightweight, works perfectly on Deno Deploy
- Cron built-in — Use
Deno.cron()for scheduled tasks; no external cron service needed - BroadcastChannel — Use for real-time features across isolates; simpler than WebSocket servers
- NPM compatibility — Import npm packages with
npm:specifier; most Node.js libraries work - Environment variables — Set via dashboard or
deployctl; access withDeno.env.get("KEY")
> related_skills --same-repo
> zustand
You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.
> zoho
Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.
> zod
You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.
> zipkin
Deploy and configure Zipkin for distributed tracing and request flow visualization. Use when a user needs to set up trace collection, instrument Java/Spring or other services with Zipkin, analyze service dependencies, or configure storage backends for trace data.