🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Deno

by @ivangdavila

Build with Deno runtime avoiding permission gotchas, URL import traps, and Node.js migration pitfalls.

Versionv1.0.0
Downloads1,069
Stars⭐ 2
TERMINAL
clawhub install deno

πŸ“– About This Skill


name: Deno slug: deno version: 1.0.0 description: "Build with Deno runtime avoiding permission gotchas, URL import traps, and Node.js migration pitfalls." metadata: {"clawdbot":{"emoji":"πŸ¦•","requires":{"bins":["deno"]},"os":["linux","darwin","win32"]}}

When to Use

User needs Deno expertise β€” secure TypeScript runtime with permissions model. Agent handles permission configuration, dependency management via URLs/npm, and migration from Node.js.

Quick Reference

| Topic | File | |-------|------| | Permission system | permissions.md | | Imports and dependencies | imports.md | | Node.js migration | node-compat.md |

Permission Traps

  • --allow-all in development β€” then production crashes because you don't know what permissions you actually need
  • --allow-read without path β€” grants access to entire filesystem, security hole
  • --allow-run without list β€” subprocess can run anything, specify: --allow-run=git,npm
  • --allow-env without list β€” leaks all env vars, specify: --allow-env=API_KEY,DATABASE_URL
  • --allow-net without list β€” can connect anywhere, specify hosts: --allow-net=api.example.com
  • Missing permission in CI β€” hangs waiting for prompt that never comes, add --no-prompt
  • Import Traps

  • Remote URLs in production β€” network failure = app won't start, vendor dependencies locally
  • No lockfile by default β€” deps can change between runs, always use deno.lock
  • @^1.0.0 semver syntax doesn't exist β€” use exact URLs or import maps
  • Import maps in wrong place β€” must be in deno.json, not separate file (Deno 2.x)
  • HTTPS required β€” HTTP imports blocked by default, most CDNs work but self-hosted may not
  • URL typo β€” no error until runtime when import fails
  • TypeScript Traps

  • .ts extension required in imports β€” model generates extensionless imports that fail
  • tsconfig.json paths ignored β€” Deno uses import maps in deno.json, not tsconfig
  • Type-only imports β€” must use import type or bundler may fail
  • Decorators β€” experimental, different from tsc behavior
  • /// β€” handled differently than tsc, may be ignored
  • Deployment Traps

  • deno compile includes runtime β€” binary is 50MB+ minimum
  • --cached-only requires prior cache β€” fresh server needs deno cache first
  • Deno Deploy limitations β€” no filesystem, no subprocess, no FFI
  • Environment variables β€” different API: Deno.env.get("VAR") not process.env.VAR
  • Signals β€” Deno.addSignalListener not process.on("SIGTERM")
  • Testing Traps

  • Deno.test different from Jest β€” no describe, different assertions
  • Async test without await β€” test passes before promise resolves
  • Resource leaks β€” tests fail if you don't close files/connections
  • Permissions in tests β€” test may need different permissions than main code
  • Snapshot testing β€” format differs from Jest snapshots
  • npm Compatibility Traps

  • npm: specifier β€” works for most packages but native addons fail
  • node: specifier required β€” import fs from 'fs' fails, need import fs from 'node:fs'
  • node_modules optional β€” enable with "nodeModulesDir": true in deno.json
  • package.json scripts β€” not automatically supported, use deno.json tasks
  • Peer dependencies β€” handled differently, may get wrong versions
  • Runtime Differences

  • Deno.readTextFile vs fs.readFile β€” different API, different error types
  • fetch is global β€” no import needed, unlike Node 18-
  • Top-level await β€” works everywhere, no wrapper needed
  • Permissions at runtime β€” can request dynamically but user must approve
  • ⚑ When to Use

    User needs Deno expertise β€” secure TypeScript runtime with permissions model. Agent handles permission configuration, dependency management via URLs/npm, and migration from Node.js.