返回顶部
D

Deno

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

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
616
下载量
2
收藏
概述
安装方式
版本历史

Deno

## 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 - `/// <reference>` — 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

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 deno-1776419997 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 deno-1776419997 技能

通过命令行安装

skillhub install deno-1776419997

下载 Zip 包

⬇ 下载 Deno v1.0.0

文件大小: 6.09 KB | 发布时间: 2026-4-17 18:14

v1.0.0 最新 2026-4-17 18:14
Initial release

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部