惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
Spread Privacy
Spread Privacy
T
Threatpost
C
Cisco Blogs
P
Palo Alto Networks Blog
AI
AI
Cyberwarzone
Cyberwarzone
NISL@THU
NISL@THU
P
Privacy & Cybersecurity Law Blog
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
T
Tor Project blog
Latest news
Latest news
AWS News Blog
AWS News Blog
D
Docker
S
SegmentFault 最新的问题
博客园 - 聂微东
WordPress大学
WordPress大学
Vercel News
Vercel News
S
Securelist
爱范儿
爱范儿
J
Java Code Geeks
Know Your Adversary
Know Your Adversary
S
Schneier on Security
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
Last Week in AI
Last Week in AI
D
DataBreaches.Net
宝玉的分享
宝玉的分享
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
K
Kaspersky official blog
美团技术团队
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
量子位
博客园_首页
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
腾讯CDC
T
Threat Research - Cisco Blogs
雷峰网
雷峰网
有赞技术团队
有赞技术团队
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
S
Security Affairs

Deno

Deno 2.8 | Deno Claw Patrol: an open-source security firewall for agents | Deno Fresh 2.3: Zero JS by default, View Transitions, and Temporal support | Deno Deno 2.7: Temporal API, Windows ARM, and npm overrides | Deno Build a dinosaur runner game with Deno, pt. 6 | Deno Build a dinosaur runner game with Deno, pt. 5 | Deno Deno Deploy is Generally Available | Deno Introducing Deno Sandbox | Deno Build a dinosaur runner game with Deno, pt. 4 | Deno Build a dinosaur runner game with Deno, pt. 3 | Deno Build a dinosaur runner game with Deno, pt. 2 | Deno React / Next.js Denial-of-Service Vulnerability: Deno Deploy users protected | Deno Deno 2.6: dx is the new npx | Deno Build a dinosaur runner game with Deno, pt. 1 | Deno React Server Functions / Next.js Vulnerability: Deno Deploy users protected | Deno My highlights from the new Deno Deploy | Deno Deno's Other Open Source Projects | Deno How Deno protects against npm exploits | Deno Help Us Raise $200k to Free JavaScript from Oracle | Deno Deno 2.5: Permissions in the config file | Deno Fresh 2.0 Graduates to Beta, Adds Vite Support | Deno Deno 2.4: deno bundle is back | Deno JavaScript™ Trademark Update | Deno What's coming to JavaScript | Deno A brief history of JavaScript | Deno Reports of Deno's Demise Have Been Greatly Exaggerated | Deno An Update on Fresh | Deno How Plaid migrated 100 services to a new database platform 5x faster with Deno | Deno Deno 2.3: Improved deno compile, local npm packages, and more | Deno Add JSR packages with pnpm and Yarn | Deno Zero-config Debugging with Deno and OpenTelemetry | Deno Exploring Art with TypeScript, Jupyter, Polars, and Observable Plot | Deno Deno v Oracle Update 3: Fighting the JavaScript Trademark | Deno Build a custom RAG AI agent in TypeScript and Jupyter | Deno How to get deep traces in your Node.js backend with OTel and Deno | Deno toranoana.deno #20 登録受付中(2025年3月14日) | Deno Node just added TypeScript support. What does that mean for Deno? | Deno The Dino 🦕, the Llama 🦙, and the Whale 🐋 | Deno Publish a lint rule, get a prize | Deno Deno 2.2: OpenTelemetry, Lint Plugins, node:sqlite | Deno If you're not using npm specifiers, you're doing it wrong | Deno How Deno's documentation is evolving | Deno Oracle justified its JavaScript trademark with Node.js—now it wants that ignored | Deno Introducing the JSR open governance board | Deno Intro to Wasm in Deno | Deno Announcing OpenAI on JSR | Deno Deno in 2024 | Deno Goodbye WinterCG, welcome WinterTC | Deno Build a SolidJS app with Deno | Deno Run your Next.js SSR app on Deno Deploy | Deno Solve Advent of Code 2024 with Deno and Win Prizes! | Deno Deno v. Oracle: Canceling the JavaScript Trademark | Deno Deno 2.1: Wasm Imports and other enhancements | Deno Build a Typesafe API with tRPC and Deno | Deno Self-contained Executable Programs with Deno Compile | Deno Build a Database App with Drizzle ORM and Deno | Deno Introducing your new JavaScript package manager: Deno | Deno Announcing Growthbook on JSR | Deno Build an Astro site with Deno | Deno How to convert CommonJS to ESM | Deno Announcing Deno 2 | Deno The Final Touches: What’s New In v2.0.0-rc.10 | Deno Announcing Stable V8 Bindings for Rust | Deno Deno 2.0 Release Candidate | Deno Secure, efficient private npm registries with Cloudsmith and Deno | Deno Painting the Plane as We Fly It: Designing JSR | Deno Introducing Web Cache API support on Deno Deploy | Deno Deno 1.46: The Last 1.x Release | Deno Protect your cloud spend with new Deno Deploy spend limits | Deno What we got wrong about HTTP imports | Deno Benchmarking AWS Lambda Cold Starts Across JavaScript Runtimes | Deno Announcing Supabase on JSR | Deno Deno 1.45: Workspace and Monorepo Support | Deno Introducing KV Backup for Deno Subhosting | Deno A Gentle Intro to TypeScript | Deno Announcing Hono on JSR | Deno How We Made the Deno Language Server Ten Times Faster | Deno How the Guardian uses Deno to audit accessibility and performance across their 2.7 million articles | Deno Introducing More Flexible Domain Association for Deno Subhosting | Deno The stabilization process of the Standard Library has begun | Deno Deno 1.44: Private npm registries, improved Node.js compat, and performance boosts | Deno How we built a secure, performant, multi-tenant cloud platform to run untrusted code | Deno The Deno Standard Library is now available on JSR | Deno How to document your JavaScript package | Deno Your Low Code Solution Needs an Escape Hatch | Deno Deno 1.43: Improved Language Server performance | Deno How Slack used Deno to save months of engineering effort in launching their new platform | Deno JSR Is Not Another Package Manager | Deno Announcing the Hookdeck SDK on JSR | Deno Announcing the Neon Serverless Driver on JSR | Deno An intro to TSConfig for JavaScript Developers | Deno How we built JSR | Deno How Netlify used Deno Subhosting to build a successful edge functions product | Deno Introducing Simpler Project Creation in Deno Deploy | Deno Deno 1.42: Better dependency management with JSR | Deno Introducing deployctl, the command line interface for Deno Deploy | Deno Introducing JSR - the JavaScript Registry | Deno How to add Monaco to a Next.js app and securely run untrusted user code | Deno Survey Results and Roadmap | Deno Deno 1.41: smaller deno compile binaries | Deno
Announcing native npm support on Deno Deploy | Deno
2023-09-06 · via Deno

Deno Deploy makes it easy build and host any JavaScript app, function, or API server. Programming is faster and easier with Deno’s simple and robust APIs — web standard APIs, Node.js built-ins, and essential cloud services turned into first class JavaScript APIs, such as Deno KV (now in open beta). Your applications are run close to your users across 35 regions in the world, ensuring minimal latency and high availability.

Today, we’re excited to announce that Deno Deploy now natively supports running npm modules via npm: specifiers. This means you can now host Node.js apps at the edge using the npm modules, all without the need for build steps.

Here’s an example of running an Express app on Deno Deploy:


import express from "npm:express@4";
const app = express();


app.get("/", (req, res) => {
  res.send("Hello World!");
});


app.listen(3000);

Try it yourself in a Playground →

Deno Deploy is the first isolate based serverless platform to natively support Node.js built-ins and npm modules. This opens the door to a whole new world of possibilities for JavaScript developers — now even your Node.js apps can be hosted globally with minimal latency, high availability, and instant deploys.

Importing and using over 2 million npm modules integrates seamlessly with the rest of Deno: first-class TypeScript support, built-in tooling like the formatter, linter, and test runner, and the Deno Language Server that provides a rich editor experience in your IDE.

No bundle step needed

NPM and Node support in Deno is native — there is no transpilation, bundle step, or polyfill injection taking place. Deno Deploy natively understands Node.js APIs, and intrinsically knows how to load and execute NPM modules.

This has two main benefits for you: better developer experience and better compatibility.

We pride ourselves on Deno Deploy’s short feedback loop and instant deploys. This extends to npm support as well. You can develop locally using npm: specifiers and deploy to Deno Deploy via our seamless GitHub integration, going from git push to a live site in mere seconds.

Because we don’t transpile, bundle, and polyfill your code or any npm modules you import, there are no steps like these to introduce issues. This means that code that works locally will work on Deno Deploy, and vice versa.

Since there’s no bundling or source mapping, if anything does go wrong, your Deno Deploy stack traces and logs show file names and line numbers that match up with what you see locally — no more digging through unintelligible minified and bundled code.

Examples and use cases

Here are a few examples of what you can build with npm packages on Deno Deploy.

Fastify

Fastify is a popular solution for building API servers and web applications in Node.js. With npm specifier support on Deno Deploy, it’s now usable in your web apps running on the edge as well.

Try it yourself in a Playground →


import Fastify from "npm:fastify@4";
const fastify = Fastify();


fastify.get("/", async function handler(request, reply) {
  return "Hello World!";
});


await fastify.listen({ hostname: "localhost", port: 3000 });

Deno.serve + OpenAI

NPM support is not limited to web frameworks. You can use it to power up any existing Deno app by importing packages from NPM. For example, you can use the OpenAI SDK to enhance your application with state-of-the-art AI completions.

Try it yourself in a Playground →

import OpenAI from "npm:openai@4";

const openai = new OpenAI({ apiKey: Deno.env.get("OPENAI_API_KEY") });

Deno.serve(async (req: Request) => {
  const completion = await openai.chat.completions.create({
    model: "gpt-3.5-turbo",
    messages: [{ role: "user", content: "Tell me a programmer joke" }],
  });
  const joke = completion.choices[0].message.content;
  return new Response(joke);
});

Crypto APIs

Encryption and decryption is one of that most popular categories of modules on npm. Here’s an example using crypto-js, one of the top packages on npm.

Try it yourself in a Playground →

import CryptoJS from "npm:crypto-js@4";

Deno.serve((_req: Request) => {
  
  const ciphertext = CryptoJS.AES.encrypt("my message", "secret key 123")
    .toString();

  
  const bytes = CryptoJS.AES.decrypt(ciphertext, "secret key 123");
  const originalText = bytes.toString(CryptoJS.enc.Utf8);

  return new Response(originalText);
});

Compatibility

Deno Deploy supports all 47 of Node.js built-in modules, such as fs, path, and http. You can import them directly via node: specifier, just like in Node.js.

Any npm package relying on these APIs will work on Deno Deploy. For example, the aws-sdk package, which uses http internally, just works:

Try it yourself in a Playground →



import { Hono } from "https://deno.land/x/hono@v3.5.8/mod.ts";
import { Fragment, jsx } from "https://deno.land/x/hono@v3.5.8/middleware.ts";
import { DynamoDBClient } from "npm:@aws-sdk/client-dynamodb@3";
import {
  DynamoDBDocumentClient,
  ExecuteStatementCommand,
} from "npm:@aws-sdk/lib-dynamodb";
import { fromEnv } from "npm:@aws-sdk/credential-providers@3";


const client = new DynamoDBClient({
  region: "us-east-2",
  credentials: fromEnv(),
});
const docClient = DynamoDBDocumentClient.from(client);


const app = new Hono();


app.get("/", async (c) => {
  const command = new ExecuteStatementCommand({
    Statement: "SELECT * FROM Todos WHERE complete = ?",
    Parameters: [false],
    ConsistentRead: true,
  });

  const response = await docClient.send(command);
  console.log(response);
  return c.html(
    <html>
      <body style={{ margin: "10px auto", maxWidth: "400px" }}>
        <h1>TODOs</h1>
        <form action="/" method="POST">
          <input type="text" name="text" />
          <button
            type="submit"
            style={{
              display: "inline-block",
              marginLeft: "5px",
            }}
          >
            Add Item
          </button>
        </form>
        {response.Items.map((item) => {
          return (
            <div style={{ margin: "5px 0" }}>
              {item.text}
            </div>
          );
        })}
      </body>
    </html>,
  );
});


app.post("/", async (c) => {
  const body = await c.req.parseBody();

  const command = new ExecuteStatementCommand({
    Statement: `INSERT INTO Todos value {'text':?, 'complete':?}`,
    Parameters: [body.text, false],
  });

  try {
    const response = await docClient.send(command);
    console.log(response);
  } catch (e) {
    console.error(e);
  }
  return c.redirect("/");
});

Deno.serve(app.fetch);

While our Node.js compatibility is very good at this point, there are still some Node.js APIs that are not supported, or are not yet entirely compatible with the Node.js implementation.

There are also some npm packages that will not work on Deno Deploy. Any packages relying on NodeAPI (the native plugin layer for Node), will not work with a serverless system like Deno Deploy due to sandboxing restrictions. The same security sandbox also prevents some Node.js APIs from working, such as child_process and vm.

If you run into any issues using a specific npm module on Deno Deploy, please open an issue here.

What’s next

With npm support and Deno KV in open beta, your JavaScript app can access over two million modules and unlock more functionality, provide a productive and intuitive development experience (like connecting to a globally distributed database in a single line of code), and offer a fast global deployment process that hooks right into your git workflow. All that while offering your end users minimal latency and high availability.

We’re working hard to add important useful features to further simplifiy building and hosting complex, production-ready apps. We have many exciting announcements coming up, so stay tuned!

Don’t miss any updates! Follow our Twitter, join our Discord, and subscribe to our YouTube channel.