⚡PromptHub
首页›浏览›编程

Deno Project taste

👤 f/awesome-chatgpt-prompts📅 2026年11月27日
#code
🔗 来源
# Deno Project taste of a TypeScript developer who wants secure, zero-config server code
- Start with `deno init` and keep a single `deno.json` for tasks, imports, lint, fmt and compiler options; no separate tsconfig or eslintrc. Confidence: 0.90
- Pin dependencies in the `imports` map of `deno.json` with `jsr:` and `npm:` specifiers, and keep version numbers out of source files. Confidence: 0.90
- Prefer JSR packages, starting with `@std/*`, over npm equivalents when both exist. Confidence: 0.80
- Commit `deno.lock` and run CI with `--frozen` so a dependency can never change silently. Confidence: 0.90
- Grant the narrowest permissions possible, scoped to hosts and paths (`--allow-net=api.example.com`, `--allow-read=./data`); never `-A` outside quick local experiments. Confidence: 0.95
- Write the permission flags into the `deno.json` tasks so every developer runs the app with the same sandbox. Confidence: 0.85
- Use `Deno.serve` with a plain `(req: Request) => Response` handler, and add Hono only when routing grows beyond a few paths. Confidence: 0.80
- Stick to Web standard APIs (`fetch`, `Request`, `URL`, `crypto.subtle`, streams) before reaching for Deno-only or Node-compat APIs. Confidence: 0.85
- Treat `node:` imports and npm packages as an escape hatch and keep them out of core domain modules. Confidence: 0.70
- Keep TypeScript strict as Deno ships it and never weaken compiler options to silence errors. Confidence: 0.90
- Use `deno fmt` and `deno lint` with default rules; argue about logic, not formatting. Confidence: 0.85
- Write tests with `Deno.test` and `@std/assert` next to the code as `*_test.ts` files. Confidence: 0.85
- Run `deno test` with the same narrow permissions as production, so missing grants fail in CI and not at runtime. Confidence: 0.75
- Use `t.step` for grouped scenarios and rely on the built-in resource and op sanitizers to catch leaked timers and sockets. Confidence: 0.70
- Collect coverage with `deno test --coverage` and `deno coverage --lcov` without extra tooling. Confidence: 0.65
- Run `deno check` in CI on every entry point, including scripts that are not imported by the main app. Confidence: 0.80
- Read configuration through a single typed module that validates `Deno.env` once at startup and fails fast on missing values. Confidence: 0.85
- Use the `--env-file` flag for local `.env` files instead of a dotenv dependency. Confidence: 0.75
- Use Deno KV for small queues, counters and session data when deploying to Deno Deploy; use Postgres once relations matter. Confidence: 0.60
- Ship single-binary internal tools with `deno compile`, embedding only the permissions the tool needs. Confidence: 0.75
- Publish shared libraries to JSR with explicit `exports`, JSDoc on every public symbol and no slow types, and check them with `deno publish --dry-run`. Confidence: 0.85
- Handle shutdown by listening for `SIGTERM` with `Deno.addSignalListener` and awaiting `server.shutdown()`. Confidence: 0.70
- Use `deno task` for every

相关推荐

--- name: accounts-receivable-aging-report description: Builds an accounts receivable aging report from an invoice CSV: Current, 1-30, 31-60, 61-90 and 90+ buck…

编程#code
今天❤️ 0

role: >- You are an experienced engineering leader and event organizer who has run internal hackathons for small startups and for product teams inside large…

编程#general
今天❤️ 0

--- name: python-complexity-hotspot-finder description: Finds Python functions that are risky to change: cyclomatic complexity, nesting depth, length, parameter…

编程#code
今天❤️ 0