提供Windows 11/10/7、Ghost镜像、驱动及常用软件下载与安装教程,并提供“装机大师”等一键重装工具 后台管理
📢 欢迎访问系统之家!所有资源均经过安全检测。

Deno examples and tutorials

发布时间:2026-10-13 | 浏览:1
📥 下载地址(文章开头)
装机神器,安装一切系统。纯净版原版应有尽有!
A collection of walkthrough tutorials, examples, videos and guides to teach you about the Deno runtime and how to use it with your favorite tools. Filter by type: Basics Jump to heading # Built in TypeScript support Deno natively understands TypeScript code with no compiler to configure. Check if two values are deeply equal Two objects with the same contents are not equal with the === operator, which compares references. Executable scripts Guide to creating executable scripts with Deno. Generating documentation with deno doc Learn how to generate professional documentation for your Deno projects using the built-in deno doc command. Hello World The one and only line in this program will print "Hello, World!" to the console. Import and export functions To build composable programs, it is necessary to be able to import and export functions from other modules. Initialize a project Guide to creating and structuring new Deno projects. Run a script A guide to creating and running basic scripts with Deno. Sharing your local server with tunnel Expose a public URL instantly with the --tunnel option Simple API server Build a simple link shortener API with Deno KV and web standard primitives, then deploy it to Deno Deploy. Simple file server Tutorial on building a file server with Deno. Sleep and delay execution Scripts often need to wait: between retries, while polling, or to pace requests. Top level await Example of how top-level await can be used by default in Deno. Update from CommonJS to ESM Step-by-step guide to migrating Node.js projects from CommonJS to ESM modules. Modules and package management Jump to heading # Add and remove dependencies Manage project dependencies with deno add and deno remove: npm and JSR packages, version pinning, dev dependencies, and aliasing packages in your import map. Configure a monorepo with workspaces Set up a Deno workspace with multiple packages: member names and exports, glob patterns, root-only options, shared imports, and centralized dependency versions with catalogs. Import modules from npm Use JavaScript modules from npm in your Deno programs with the "npm:" specifier in your imports. Lock dependencies with deno.lock Use deno.lock for reproducible installs: what the lockfile records, reviewing lockfile diffs, frozen lockfiles for CI with --frozen and deno ci, and regenerating or relocating the lockfile. Module Metadata A guide to working with module metadata in Deno. Re-map import paths Use the imports field in deno.json as an import map: path aliases like @/ for src/, bare names for local modules, and scoped overrides for transitive imports. Run Deno in GitHub Actions Set up a GitHub Actions workflow for a Deno project: install Deno with setup-deno, cache dependencies, run fmt, lint and test, install with a frozen lockfile, and test across Deno versions. Run npm lifecycle scripts Allow npm postinstall and other lifecycle scripts in Deno with deno approve-scripts, and persist approvals with the allowScripts field in deno.json. Use Deno in an existing Node.js project Run an existing Node.js project with Deno without rewriting it: install from package.json, run npm scripts with deno task, use node: built-ins, and adopt Deno's built-in tooling incrementally. Use local and unpublished packages Work with code that isn't on a registry: link a local package copy with the links field, import straight from HTTPS URLs including private GitHub repos, and know which specifiers Deno does not support. Use Node.js built-in modules Deno supports most built-in Node.js modules natively - you can include them in your code using "node:" specifiers in your imports. Use private npm registries Configure Deno to install npm packages from private registries: .npmrc scoped registries and auth tokens, the NPM_CONFIG_REGISTRY override, DENO_AUTH_TOKENS, and worked setups for Azure Artifacts and JFrog Artifactory. Network Jump to heading # Authentication with Auth.js Auth.js is the most widely used authentication library for JavaScript. Build a chat app with WebSockets A tutorial on building a real-time chat app using Deno WebSockets. Communicate over QUIC QUIC is the transport protocol underneath HTTP/3. Connect two peers with WebTransport WebTransport is the web platform's API for low-latency, multiplexed communication over HTTP/3. Creating and verifying JWT This example demonstrates how to create and verify a JSON Web Token (JWT) using the `jose` library in Deno. Download a file with progress Streaming a download straight to disk keeps memory flat no matter how big the file is. Email and password auth with Better Auth Better Auth is a framework-agnostic, TypeScript-first auth library. Fetch over a Unix socket Local services like the Docker daemon expose HTTP over a Unix domain socket instead of a TCP port. File Based Routing Tutorial on implementing file-based routing in Deno. Find a free port Test servers and helper processes should not fight over hardcoded ports. Generate an RSS feed An RSS feed is a small XML document that lets readers subscribe to a site. Generate sitemap.xml and robots.txt Search engines discover pages through a sitemap and learn crawling rules from robots.txt. Hono HTTP server An example of an HTTP server that uses the Hono framework. HTTP requests This example demonstrates how to make an HTTP request to a server. HTTP server: Basic authentication Basic authentication sends a username and password base64-encoded in the authorization header. HTTP server: Caching headers Cache headers let clients skip downloads they already have. HTTP server: Cookies Cookies carry state between requests in the cookie and set-cookie headers. HTTP server: CORS Browsers block cross-origin requests unless the server opts in with CORS headers. HTTP server: CRUD with SQLite3 An example of an HTTP server for CRUD routes with oak middleware framework and SQLite3 database. HTTP server: Graceful shutdown Killing a server mid-request drops connections and loses work. HTTP server: Health checks Health endpoints let load balancers and orchestrators decide what to do with a process. HTTP Server: Hello world An example of an HTTP server that serves a "Hello World" message. HTTP server: Hot reload Restarting a server by hand after every edit gets old fast. HTTP server: Node.js streams Code ported from Node.js often produces Node streams: file streams, database cursors, archive generators. HTTP server: Paginating results APIs that return lists need pagination so a single response stays small. HTTP server: Rate limiting A rate limiter protects a server from clients that send too many requests. HTTP server: Request timeouts A handler that depends on a slow upstream can hold a connection open forever. HTTP server: Routing An example of an HTTP server that handles requests with different responses based on the incoming URL. HTTP server: Scaling across CPU cores A single process handles requests on one core. HTTP server: Server-sent events Server-sent events push updates from the server to the browser over a single long-lived HTTP response, with automatic reconnection built into the EventSource API. HTTP server: Serving files An example of an HTTP server that serves files. HTTP server: Sessions A session keeps a user logged in across requests. HTTP server: Streaming An example HTTP server that streams a response back to the client. HTTP server: TLS Deno.serve speaks HTTPS when given a certificate and private key. HTTP server: Verifying webhook signatures Webhook senders sign each delivery so receivers can prove the payload came from them and was not tampered with in transit. HTTP server: WebSockets An example of an HTTP server that handles websocket requests. Outbound WebSockets Opening a WebSocket connection for real-time, bi-directional communication with Deno is very simple. Piping streams Deno implements web-standard streams which comes with many advantages. Protect routes with JWT in Hono A common auth pattern is issuing a JSON Web Token at login and requiring it on protected routes. Proxy HTTP requests A reverse proxy receives requests and forwards them to another server. Route fetch through an HTTP proxy Deno honors the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables by default, for both module downloads and fetch, with no code changes. Running DNS queries There are some cases when running DNS queries is useful. Sign in with GitHub (OAuth) The OAuth authorization code flow lets users sign in with an existing account. TCP connector: Ping An example of connecting to a TCP server on localhost and writing a 'ping' message to the server. TCP Echo Server An echo server is a simple network application that listens for incoming connections and requests, and then repeats back any data it receives from clients. TCP listener: Ping An example of a TCP listener on localhost that will log the message if written to and close the connection if connected to. TCP/TLS connector: Ping An example of connecting to a TCP server using TLS on localhost and writing a 'ping' message to the server. TCP/TLS listener: Ping An example of a TCP listener using TLS on localhost that will log the message if written to and close the connection if connected to. Two-way streaming with WebSocketStream WebSocketStream is a promise-based alternative to the event-based WebSocket API. UDP connector: Ping An example of writing a 'ping' message to a UDP server on localhost. UDP listener: Ping An example of a UDP listener on localhost that will log the message if written to and close the connection if connected to. Upgrade a TCP connection to TLS (STARTTLS) Some protocols start as plaintext and negotiate encryption mid-connection instead of connecting over TLS from the start. WebSocket server: Broadcasting messages Chat rooms, live dashboards, and multiplayer games all need one thing: deliver a message from one client to all the others. WebSocket server: Per-socket state Most WebSocket servers need to know who each socket belongs to: a username, a room, a session. File system Jump to heading # Checking for directory existence When creating directories it can be useful to first ensure that such a directory doesn't already exist. Checking for file existence When creating files it can be useful to first ensure that such a file doesn't already exist. Convert between file URLs and paths Modules are identified by URLs in Deno, while file system APIs take paths. Copy a file Copying a file is a single call in Deno. Create and extract tar archives A tar archive bundles many files and directories into a single file, usually compressed with gzip to produce the familiar .tar.gz format. Create hard links A hard link is a second name for the same file. Creating & removing directories Creating and removing directories is a common task. Creating & resolving symlinks Creating and resolving symlink is a common task. Deleting files Removing files and directories is a common task. File system events Tutorial on monitoring file system changes with Deno. Find files with glob patterns Glob patterns describe sets of file paths in one compact string, with * matching within a path segment and ** matching across directories. Get the MIME type of a file Serving a file over HTTP needs a content type header. Lock files across processes When two processes write the same file at the same time, the result is a mess. Moving/Renaming files An example of how to move and rename files and directories in Deno. Path operations Many applications need to manipulate file paths in one way or another. Read and change file metadata Every file carries metadata besides its contents: size, timestamps, type and permissions. Reading files Many applications need to read files from disk. Streaming file operations Sometimes we need more granular control over file operations. Temporary files & directories Temporary files and directories are used to store data that is not intended to be permanent. Truncate a file Truncating sets a file to an exact length without rewriting its contents. Unix cat In Unix, the `cat` command is a utility that reads files and writes them to standard output. Walking directories When doing something like filesystem routing, it is useful to be able to walk down a directory to visit files. Watching the filesystem When creating frameworks or CLI tools, it is often necessary to watch the filesystem for changes. Write a file incrementally Writing a file all at once is fine until the data is large or arrives in pieces, like a download or a log. Writing files Many applications need to write files to disk. System Jump to heading # Call C functions with FFI The Foreign Function Interface lets Deno call functions in native shared libraries directly, with no glue code or build step. Collecting output from subprocesses We don't often write programs in isolation. Communicate with a child process over IPC Pipes carry bytes, but coordinating with a worker process is easier with structured messages. Create a subprocess A guide to working with subprocesses in Deno. Detect a TTY and get terminal size A program can check whether it is talking to a real terminal or to a pipe. Environment variables Environment variables can be used to configure the behavior of a program, or pass data from one program to another. Find an executable on the PATH Before spawning a tool like git or ffmpeg, it is useful to know whether it is installed and where. Get operating system information Scripts often need to know what system they are running on, for example to pick a platform specific binary or to include host details in logs. Handle OS signals Tutorial on handling operating system signals in Deno. List network interfaces Deno.networkInterfaces lists every network address of the machine. Listen for OS signals You can listen for OS signals using the `Deno.addSignalListener` function. Pipe data into a subprocess Many command line tools read their input from stdin. Process information An example of how to access the current process ID and parent process ID. Read from stdin Command line tools that work in pipelines read their input from stdin. Read input line by line with node:readline The node:readline module reads a stream one line at a time, no matter how the bytes are chunked, and it powers interactive prompts in many Node.js programs. Reading system metrics This example demonstrates how to use Deno's built-in methods to read system metrics such as memory information, load averages and memory usage. Run a subprocess with custom env and cwd A subprocess normally inherits the environment variables and working directory of its parent. Set and read process exit codes The exit code is how a program reports success or failure to the shell, where zero means success and anything else means failure. Set the time zone Date, Intl, and Temporal all format times in the process time zone, which defaults to the operating system setting. Subprocesses: Spawning For more complex usecases, we don't simply want the output of some command. Use EventEmitter from node:events EventEmitter is the classic Node.js building block for things that emit named events, and countless npm packages hand you one. Use worker_threads in Deno Deno supports the node:worker_threads module for moving work off the main thread. Write to stdout console.log is fine for debugging, but command line tools often need precise control over standard output: no forced newline, raw bytes, or piping a whole stream. Web standard APIs Jump to heading # Better debugging with the console API An in-depth guide to advanced console debugging in Deno. Build and send forms with FormData FormData collects key and value pairs, including files, and fetch knows how to send it as a multipart request. Cache HTTP responses with the Web Cache API Deno implements the Web Cache API from service workers. Cancel async work with AbortController AbortController produces an AbortSignal that can cancel fetch requests, remove event listeners, and stop any code that checks the signal. Communicate between workers with BroadcastChannel BroadcastChannel is a named bus. Create and dispatch custom events EventTarget is the eventing system behind the DOM, and it works as a base class for your own types. Deep clone objects with structuredClone structuredClone deep copies a value, so changes to the copy never leak back into the original. Distribute work across a worker pool A single web worker moves heavy computation off the main thread, but a pool of workers uses every CPU core. Escape an HTML string Interpolating user input into HTML without escaping it opens the door to cross-site scripting. Extract links and metadata from HTML Scrapers, link checkers, and preview cards all start the same way: fetch a page and pull data out of its HTML. Fetch and stream data A tutorial on working with network requests in Deno. Format dates for any locale Intl.DateTimeFormat turns a Date into text for any locale and time zone. Format numbers and currencies Intl.NumberFormat formats numbers for any locale and style. Format relative time Intl.RelativeTimeFormat produces phrases like 3 days ago or in 2 months for any locale. Logging with colors Most modern terminals can display program logs in colors and with text decorations. Manipulating & parsing URLs URL is the web standard interface to parse and manipulate URLs. Match URLs with URLPattern URLPattern matches URLs against route-style patterns and extracts the dynamic parts. Measure performance with marks and measures The performance API measures elapsed time with sub-millisecond precision. Parse and format dates Everyday date work is parsing a value, formatting it for people, and doing arithmetic on it. Pluralize and format lists Hand-rolled pluralization like adding an s breaks as soon as you leave English. Run a compute shader with WebGPU WebGPU gives JavaScript direct access to the GPU, and unlike WebGL it is not limited to graphics: compute shaders run arbitrary parallel computation. Set a timeout on fetch fetch has no timeout option, but it accepts an AbortSignal, and AbortSignal.timeout builds one that aborts after a given number of milliseconds. Set timeout and intervals Timers are used to schedule functions to happen at a later time. Split text by words, sentences, and graphemes Splitting text with split or slice breaks on punctuation, emoji, and languages that do not use spaces. Temporal API An example of using the Temporal API to work with dates, times, and timestamps. Transform data with TransformStream A TransformStream sits in the middle of a stream pipeline and rewrites chunks as they pass through. Web assembly WebAssembly is a binary format for describing a program's data and instructions. Web workers Workers are the only way of running javascript off of the main thread. Standard library Jump to heading # Add a timeout to any promise A promise has no built-in time limit, so a stalled request can hang a program forever. Convert string case Identifiers, file names, CSS classes, and database columns all expect different casing conventions. Debounce a function A debounced function waits until calls stop arriving before it runs. Escape text for regular expressions Building a RegExp from user input is dangerous, because characters like parentheses and dots have special meaning in patterns. Exponential backoff Exponential backoff is a technique used in computer systems to handle retries and avoid overwhelming services. Format bytes and durations for humans Raw numbers like 1536 bytes or 97000 milliseconds are hard to read in logs and user interfaces. Generate seeded random numbers Math.random gives you no way to set a seed, so test runs and simulations that need reproducible randomness cannot use it. Memoize an expensive function Memoization caches the result of a function call so repeated calls with the same arguments return instantly. Parse and compare semver versions Version strings cannot be compared as plain text, because "1.10.0" sorts before "1.2.0" alphabetically. Run async tasks with a concurrency limit Firing hundreds of requests at once can overwhelm a server or hit rate limits.
📥 下载地址(文章中间)
装机神器,安装一切系统。纯净版原版应有尽有!
Structured logging The @std/log package routes log records through configurable handlers with severity levels. User Data Processing with Deno Collections Demonstrates using Deno's @std/collections library for processing user data. Encoding Jump to heading # Compress and decompress data Compressing data before storing or sending it saves space and bandwidth. Compress data with node:zlib The node:zlib module is built into Deno and offers more codecs and options than the web standard streams, including brotli and synchronous one-shot helpers. Convert a Blob Blobs show up whenever you handle files or multipart form data, since an uploaded File is a Blob too. Convert a Buffer (node:buffer) Node.js APIs and many npm packages produce Buffer objects. Convert a Node.js Readable Node.js APIs and npm packages often return a Node.js Readable rather than a web ReadableStream. Convert a ReadableStream Network responses, file handles, and subprocess output all hand you a ReadableStream. Convert a string to bytes and back Hashing, file writes, and network protocols all want bytes, not strings. Convert a Uint8Array Uint8Array is the workhorse binary type in Deno: file reads, network payloads, and hashes all produce or consume it. Convert an ArrayBuffer An ArrayBuffer is a chunk of raw memory with no read or write interface of its own. Encode and decode CBOR CBOR is a binary serialization format standardized as RFC 8949. Encode and decode MessagePack MessagePack is a binary serialization format with the same data model as JSON. Extract front matter from markdown Front matter is a metadata block at the top of a markdown file, fenced by --- lines and usually written in YAML. Hex and base64 encoding Binary data often needs to travel as text, in URLs, JSON, or HTTP headers. Importing bytes Binary files can be imported in JS and TS files using the `import` keyword. Importing JSON JSON files can be imported in JS and TS files using the `import` keyword. Importing text Text files can be imported in JS and TS files using the `import` keyword. Manipulating byte arrays When working with lower-level data we often deal with byte arrays in the form of Uint8Arrays. Parse and generate XML The @libs/xml package on JSR converts XML in both directions: XML text to plain JavaScript objects and back. Parse large CSV files as streams Reading a whole CSV file into memory does not work once the file grows to gigabytes. Parsing and serializing CSV CSV is a data serialization format that is designed to be portable for table-like applications. Parsing and serializing INI INI is a plain text configuration format built from key value pairs that can be grouped into sections. Parsing and serializing JSON JSON is a widely used data interchange format. Parsing and serializing TOML TOML is a widely used configuration language designed to be feature-rich and intuitive to write. Parsing and serializing YAML YAML is a widely used data serialization language designed to be easily human readable and writeable. Parsing JSONC JSONC is JSON extended with comments and trailing commas, which makes it a friendlier format for configuration files that humans edit. Stream JSON Lines data JSON Lines, also called NDJSON, stores one JSON value per line. CLI Jump to heading # Build a CLI with subcommands Tools like git and deno itself take a subcommand first and flags after it. Bundle code with Deno.bundle Deno.bundle compiles a module graph into a single JavaScript file, resolving and inlining all imports, including jsr: and npm: packages. Command line arguments Command line arguments are often used to pass configuration options to a program. Compile a script into an executable The deno compile subcommand turns a script and all of its dependencies into a single self-contained binary. Control the terminal with ANSI escape codes Terminals interpret special byte sequences, called ANSI escape codes, as commands: change the text color, erase a line, move or hide the cursor. Debugging with Chrome DevTools Find and update outdated dependencies Dependencies pinned months ago quietly fall behind. Getting the Deno version How to examine the version of Deno being used. Input prompts Prompts are used to ask the user for input or feedback on actions. Inspect memory with heap snapshots When memory keeps growing, a heap snapshot shows what is holding it: a full dump of every live object, inspectable in Chrome DevTools. Permission management There are times where depending on the state of permissions granted to a process, we want to do different things. Rich output in Jupyter notebooks Deno ships a Jupyter kernel, so notebooks can run TypeScript with full access to the Deno and web APIs. Show progress bars and spinners Long-running command line tools feel broken when they print nothing. Write benchmarks with Deno.bench Deno has a built-in benchmark runner. Cryptography Jump to heading # AES Encryption and Decryption This example demonstrates AES encryption and decryption using Deno's built-in SubtleCrypto API. Compare secrets in constant time An ordinary comparison like a === b returns as soon as the first byte differs, so a correct first byte takes measurably longer to reject than a wrong one. Derive encryption keys from passwords A password is not an encryption key: it is short, low entropy, and the wrong size for AES. Generate secure random values Session tokens, password reset links, and API keys must be impossible to guess. Generating & validating UUIDs UUIDs (universally unique identifier) can be used to uniquely identify some object or data. Hash and sign with node:crypto Deno supports the node:crypto module so that npm packages relying on it work out of the box. Hash large files with streams The Web Crypto digest function takes a single buffer, so hashing a file with it means reading the whole file into memory first. Hashing Hashing data is a common operation that is facilitated through Deno's support for the Web Crypto API. Hashing and verifying passwords Passwords must never be stored in plain text, and a plain digest like SHA-256 is too fast to resist brute force. HMAC Generation and Verification This example demonstrates how to generate and verify an HMAC (Hash-based Message Authentication Code) using Deno's built-in SubtleCrypto API with the SHA-256 hash function. RSASSA-PKCS1-v1_5 Signature and Verification This example demonstrates RSA signature and verification using Deno's built-in SubtleCrypto API. Shamir's Secret Sharing This example demonstrates Shamir's Secret Sharing, where a secret, split into shares, allows its reconstruction only when a sufficient number of shares are combined. Sign and verify data with ECDSA A digital signature proves that a message was produced by the holder of a private key and was not modified in transit. ULID One common need for distributed systems are identifiers. Testing Jump to heading # Basics of testing Learn key concepts like test setup and structure, assertions, async testing, mocking, test fixtures, and code coverage BDD testing Implementing Behavior-Driven Development with Deno's Standard Library's BDD module. Filtering and controlling test runs The test runner has flags for the everyday loops: run one test by name, stop at the first failure, rerun on save, and spread test files across CPU cores. Mocking and test doubles Skipping and focusing tests Sometimes a test should not run: it is half-written, broken on one platform, or you want to focus on a single failing case. Snapshot testing Spy functions A function spy allows us to assert that a function was called with the correct arguments and a specific number of times. Testing web applications A comprehensive guide to testing web applications with Deno Use Testing Library with Deno Test DOM behavior with @testing-library/dom and happy-dom in deno test: querying by role and text, simulating events, and the permissions the setup needs. Writing tests One of the most common tasks in developing software is writing tests for existing code. Web frameworks and libraries Jump to heading # Accept payments with Stripe Checkout Stripe Checkout hosts the payment page for you. Build a Fresh app Complete guide to building Full-stack applications with Fresh and Deno. Build a Next.js app Walkthrough guide to building a Next.js application with Deno. Build a Nuxt app with Deno Step-by-step guide to building Nuxt applications with Deno. Build a Qwik app with Deno Step-by-step guide to building Qwik applications with Deno. Build a React App Complete guide to building React applications with Deno and Vite. Build a SolidJS app Build a SolidJS application with Deno. Build a Svelte app A tutorial on building SvelteKit applications with Deno. Build a Tanstack app Complete guide to building applications with Tanstack and Deno. Build a Typesafe API with tRPC and Deno A guide to building type-safe APIs with tRPC and Deno. Build a Vue app A tutorial on building Vue.js applications with Deno. Build a word finder app A tutorial on creating a word search application with Deno. Build an Astro site with Deno Step-by-step tutorial on building web applications with Astro and Deno. Generate a PDF The pdf-lib package creates and edits PDF documents in pure JavaScript, so it runs anywhere Deno does, including Deno Deploy. Generate a QR code A QR code encodes a short piece of text, usually a URL, as a scannable image. How to use Apollo with Deno Step-by-step tutorial on integrating Apollo GraphQL with Deno. HTTP server file upload An example HTTP server that provides sending and receiving of a file upload. Render HTML templates with Eta When JSX is more than you need, a string template engine renders HTML from plain templates and data. Render markdown to HTML The @deno/gfm module renders GitHub Flavored Markdown to HTML, with the same tables, task lists, and syntax highlighting you see on GitHub. Resize and convert images sharp is the standard high-performance image processing library, and it runs in Deno through npm. Send email with Resend Transactional email, like sign-up confirmations and receipts, is a common need. Send email with SendGrid SendGrid is a widely used transactional email service. Upload files to S3-compatible storage The AWS SDK works with any S3-compatible store, including Amazon S3 and Cloudflare R2. Use Express with Deno Step-by-step guide to using Express.js with Deno. Use Vite with Deno Step-by-step tutorial on building a front-end app with Vite and Deno. Databases Jump to heading # Drizzle Step-by-step guide to building database applications with Drizzle ORM and Deno. DuckDB Using Deno with DuckDB, you can connect to memory or a persistent database with a filename. How to use Redis with Deno Step-by-step guide to using Redis with Deno. MongoDB Using the official MongoDB driver, you can connect to a MongoDB database running anywhere. Mongoose Step-by-step guide to using Mongoose with Deno. MySQL Step-by-step guide to using MySQL2 with Deno. Overview A guide to database connectivity in Deno. PlanetScale Step-by-step guide to using Planetscale with Deno. Postgres Using the npm Postgres client, you can connect to a Postgres database running anywhere. Prisma Guide to building a RESTful API using Prisma and Oak with Deno. Redis quick start Using the npm:redis module (node-redis), you can connect to a Redis database running anywhere. SQLite Using the `node:sqlite` module, you can connect to an SQLite3 database stored locally and perform basic database operations. Supabase Connect to a Supabase database with the supabase-js library. Deno KV and scheduling Jump to heading # Atomic transactions in Deno KV Deno KV transactions group reads and writes so they either all happen or none do, with optimistic concurrency: a transaction only commits if the values it read have not changed in the meantime. Deno Cron Deno Cron is a cron task scheduler built into the Deno runtime and works with zero configuration on Deno Deploy. Deno KV watch Deno KV watch allows you to detect changes to your KV database, making it easier to build real-time applications, newsfeeds, chat, and more. Deno KV: Key/Value database Deno KV is a key/value database built in to the Deno runtime, and works with zero configuration on Deno Deploy. Deno queues Deno Queues, built on Deno KV, allow you to offload parts of your application or schedule work for the future to run asynchronously. AI Jump to heading # Build an agent with OpenAI function calling Function calling lets the model call functions you define and act on the results. Build an agent with tool use Tool use lets Claude call functions you define and act on the results. Build an MCP server The Model Context Protocol (MCP) is the standard way to expose tools and data to AI assistants like Claude. Connect to an MCP server from a client The other side of the Model Context Protocol: a client connects to a server, discovers the tools it advertises, and calls them. Connect to Claude (Anthropic API) The official Anthropic SDK runs in Deno straight from npm. Connect to OpenAI - Chat completion This example demonstrates how to interact with OpenAI's chat completions API using Deno, where we send a user prompt and receive a response from the GPT-4 model. Get structured JSON output from Claude When you need machine-readable output, constrain Claude's response to a JSON schema with output_config.format. Get structured JSON output from OpenAI When you need machine-readable output, constrain the response to a JSON schema with response_format. LLM Chat app Learn how to integrate Large Language Models (LLM) with Deno to create an interactive roleplay chat application with AI characters using OpenAI or Anthropic APIs. RAG: ground an OpenAI answer in your documents Retrieval-augmented generation grounds an answer in your own data. RAG: ground Claude's answer in your documents Retrieval-augmented generation grounds an answer in your own data. Stream a chat response from OpenAI The official OpenAI SDK runs in Deno straight from npm. Stream a Claude response to the browser A chat UI needs tokens to appear as the model produces them. Stream an OpenAI response to the browser A chat UI needs tokens to appear as the model produces them. Deploying Deno projects Jump to heading # AWS ECS Fargate Step-by-step tutorial on deploying a Deno app to AWS ECS Fargate. AWS Lambda Step-by-step tutorial on deploying Deno applications to AWS Lambda. AWS Lightsail Step-by-step tutorial on deploying Deno applications to AWS Lightsail. Cloudflare workers Step-by-step tutorial on deploying Deno functions to Cloudflare Workers. Cloudflare workers with wrangler Learn how to build and deploy a Deno application to Cloudflare Workers using Wrangler Connecting to a database both locally and on Deno Deploy Connect a Postgres database to your local development server with Deno Deploy and Deno's tunnel feature Deploy with Deno Deploy A step-by-step tutorial for deploying your first Deno application to Deno Deploy. Deploy with the deploy command Step-by-step tutorial for using the deno deploy CLI command to create and deploy your first application to Deno Deploy. Digital Ocean A step-by-step guide to deploying Deno applications on Digital Ocean. Google Cloud Run Step-by-step guide to deploying Deno applications on Google Cloud Run. Kinsta Step-by-step guide to deploying Deno applications on Kinsta. Migrating a custom domain to Deno Deploy Learn how to migrate your custom domain from Deploy Classic to Deno Deploy Use Deno in Docker OpenTelemetry Jump to heading # Basic OpenTelemetry setup Set up basic OpenTelemetry instrumentation in a Deno application. Export telemetry to Grafana Complete guide to exporting telemetry data with OpenTelemetry and Grafana. Export telemetry to Honeycomb Complete guide to exporting telemetry data with OpenTelemetry and Honeycomb.io. Export telemetry to Hyperdx Complete guide to exporting telemetry data with OpenTelemetry and HyperDX. OpenTelemetry with Deno Deploy A step-by-step tutorial for adding custom OpenTelemetry instrumentation to your Deno Deploy application. Span propagation Implement end-to-end distributed tracing with automatic context propagation in Deno applications. View telemetry data for your local application Send telemetry from your local development server using Deno's tunnel feature Deno Sandbox Jump to heading # Add read-write volumes to your Sandbox Add read-write block storage to your Deno sandbox. Boot a Python environment with snapshots Create a sandbox, preload Python + scientific packages, snapshot it, and boot zero-setup sandboxes that run a Mandelbrot explorer. Boot instantly with snapshots Use read only images to create isolated and reproducible environments. Command cancellation Learn how to cancel commands in a sandbox. Configure sandbox memory Learn how to configure the memory allocated to a sandbox Control sandbox timeout Learn how to control how long your sandbox stays alive using the timeout option. Error handling Learn how to handle errors in a sandbox. Evaluating JavaScript You can evaluate JavaScript code in a sandbox using the `eval` function. Interactive JavaScript REPL Learn how to provide an interactive Deno REPL in a sandbox. Provide a VSCode instance in a sandbox Learn how to provide a VSCode instance in a sandbox. Provide SSH access to a sandbox Learn how to provide SSH access to a sandbox. Run AI generated code Deno Deploy's Sandbox API lets you create secure microVMs to run untrusted code safely. Serve a web framework Create a package.json, install deps, run a web framework (Express), and expose it publicly from a sandbox Set and get environment variables Learn how to set and get environment variables in a sandbox. Spawn a subprocess Learn how to spawn a subprocess, and get buffered output in a sandbox. Stream output to a local file Learn how to stream output to a local file in a sandbox. Streaming access string and binary output Learn how to stream string and binary output from commands in a sandbox. Upload files and directories to a sandbox Learn how to upload files and directories to a sandbox. Use template literals with variable interpolation Learn how to use template literal commands with variable interpolation in a sandbox. Oops! You've filtered everything Maybe remove a filter to see some examples?
📥 下载地址(文章结尾)
装机神器,安装一切系统。纯净版原版应有尽有!