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

推荐订阅源

T
Tenable Blog
Engineering at Meta
Engineering at Meta
The Register - Security
The Register - Security
N
Netflix TechBlog - Medium
D
Docker
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
DataBreaches.Net
IT之家
IT之家
V
V2EX
人人都是产品经理
人人都是产品经理
F
Fortinet All Blogs
J
Java Code Geeks
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
F
Full Disclosure
P
Proofpoint News Feed
B
Blog RSS Feed
T
Tor Project blog
T
The Blog of Author Tim Ferriss
B
Blog
Webroot Blog
Webroot Blog
腾讯CDC
T
Troy Hunt's Blog
T
Tailwind CSS Blog
H
Heimdal Security Blog
AWS News Blog
AWS News Blog
G
Google Developers Blog
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
A
About on SuperTechFans
SecWiki News
SecWiki News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
I
InfoQ
M
MIT News - Artificial intelligence
大猫的无限游戏
大猫的无限游戏
美团技术团队
L
LangChain Blog

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
Deno 1.36: More flexible security and expanded testing APIs | Deno
2023-08-04 · via Deno

At the core of Deno’s design goals is flexible and robust runtime security. With Deno 1.36, we’re expanding your security options even further with --deny-* flags. Along with our existing --allow-* flags, you can now configure both allow and deny lists for network communication, file system access, and other potentially sensitive APIs.

Along with these security features, you’ll find improved testing and benchmarking APIs, more robust Node.js and npm package support, language server improvements, and much more in 1.36.

If you have Deno installed, you can upgrade to version 1.36 in your terminal with:

Read on to learn more about the latest features and fixes available in Deno 1.36!

Deno 1.36 at a glance

  • 🔐 More flexible security options for Deno programs Secure your programs at runtime with --deny-* flags, which enable you to configure deny lists for domains, file paths, and other resources to which access should be restricted.
  • 🧪 Expanded options for testing and benchmarking New test result formatters, support for Node.js testing APIs, and more granular benchmarking.
  • Node.js compatibility improvements Run npm package scripts that aren’t configured as binaries, use all node:os APIs with our latest polyfill, call native code add-ons with process.dlopen, and more.
  • 🏝️ Quality of life improvements Small features and fixes like better error messages, language server improvements, and more forgiving WebSocket APIs.
  • 🙏 Open source community contributions We couldn’t build Deno without support from our community! These are the awesome folks outside the core team that have landed contributions to Deno 1.36.

More flexible security options for Deno programs

The Deno runtime offers security by default, empowering developers to opt in to letting their code and dependencies make network requests, access the filesystem, or use other potentially hazardous APIs with the --allow-* CLI flags.

These options are and remain useful, but they are a bit inflexible in certain scenarios. You can either give your program unfettered access to a given feature, or you would have to configure specific domains or directories the --allow-* options would enable. There’s no way to open up the sandbox with just some domains or file paths excluded. In Deno 1.36, we introduce the --deny-* family of runtime flags to enable more flexible permissions for your Deno programs.

For example, if you’d like your program to have access to any URL it would like, except for a few specific IP addresses and domains, you can use:

$ deno run --allow-net --deny-net=api.evil.com mod.ts

For instance, if you want to give your program access to the whole filesystem, except the /etc directory:

$ deno run --allow-read --deny-read=/etc --allow-write --deny-write=/etc mod.ts

Every CLI flag that previously had an --allow-* option will now have corresponding --deny-* options too. The deny flags have higher precedence than the allow flags, so if you use both on the same domains or a file path, the access will still be denied:

$ deno run --allow-read=foo.txt --deny-read=foo.txt mod.ts
error: PermissionDenied: Requires read access to "foo.txt"...

A special shoutout is called for here to Asher Gomez and Nayeem Rahman, who led the implementation of this new feature. Thanks a ton for your contributions!

We intend to further improve and expand the capabilities of the permission system in the future. One of the features we are looking to implement is the ability to use pre-defined permissions from a configuration file - follow this issue for updates.

We’d love to hear your feedback on the new --deny-* flags, and about any other needs you have related to the permission system. Let us know in Discord, during one of our live events (also found on the Discord), or by raising an issue in GitHub.

Expanded options for testing and benchmarking

Deno 1.36 also introduces improvements to testing and benchmarking in your applications. On the testing side, you can now output the results of deno test runs using new, custom formatters.

JUnit reporter

Having a machine-readable test report is crucial in automated QA of your tests and keeping large codebases maintainable. The JUnit XML format can be consumed natively by many services like GitLab, CircleCI, Jenkins or BuildPulse. Starting with Deno 1.36, you can pass the --reporter=junit flag to deno test to get structured report data:


$ deno test --reporter=junit


 deno test --junit-path=test_report.xml

Dot reporter

For folks who prefer short and sweet test reports we added a dot reporter that provides a concise output, removing a lot of noise.

node:test polyfill

If you are coming to Deno from recent releases of Node.js, you can now use the built-in test API from Node 20 in addition to Deno.test or describe/it API from the standard library.

Check it out for yourself in Deno with a simple test harness like the one below.

import assert from "node:assert";
import test from "node:test";

test("synchronous passing test", (t) => {
  
  assert.strictEqual(1, 1);
});

test("asynchronous passing test", async (t) => {
  
  
  assert.strictEqual(1, 1);
});

Not all API surface area has been covered yet, so if you hit a problem we would greatly appreciate a bug report.

deno bench improvements

The granularity and precision of benchmarking in Deno have been improved with the addition of new functionality to Deno.bench.

In previous releases of Deno, the Deno.bench function gave surprising results for the first bench case run due to a phenomenon called “JIT bias” - the V8 engine was over-optimizing benchmarked function and then bailing out of the optimization on the subsequent functions, leading to non-representative results. This has now been fixed, by running a “warmup” function before user defined bench cases.

Additionally, you can now use Deno.BenchContext.start and Deno.BenchContext.end to tell the benchmarking tool about the critical section you want to measure. Everything outside of the section between these two calls will be excluded from the measurement.

import { readAll } from "https://deno.land/std@0.197.0/streams/mod.ts";

Deno.bench("foo", async (b) => {
  
  const file = await Deno.open("a_big_data_file.txt");

  
  
  b.start();

  
  await readAll(file);

  
  b.end();

  
  
  file.close();
});

We also updated deno bench output to include information about iterations per second:

Output from deno bench showing iter/s column

Node.js compatibility improvements

Run scripts from npm that aren’t configured as binaries

You can now run scripts from npm packages that are not configured in a package’s bin property in package.json. Example:

deno run -A npm:somepackage@0.0.1/foo/cli.mjs

process.dlopen is available

You can now use process.dlopen API to load native addons for Node.js.

AsyncLocalStorage up to 3.5x faster

We optimized the implementation of AsyncLocalStorage from node:async_hooks module. Our benchmarks show that it’s up to 3.5x faster than in Deno v1.35.3.

node:os is fully polyfilled

The getPriority, setPriority, and userInfo functions of the Node.js os module are now available, making node:os module fully pollyfilled.

Learn more about using Node.js built-ins in the Deno Manual.

Example:

import { getPriority } from "node:os";

console.log(getPriority());

Quality of life improvements

Below, we’ve included a few other features and bug fixes that made their way into the release that we think will make a meaningful impact in your day-to-day work.

deno compile --no-terminal

A new --no-terminal flag can now be used with deno compile. If the compiled binary is run on Windows, this flag will prevent the terminal window from being opened.

Deno.createHttpClient.allowHost

The unstable Deno.createHttpClient now supports the allowHost option, making it possible to specify a Host header for a fetch request.

const client = Deno.createHttpClient({
  allowHost: true,
});
const res = await fetch("http://example.com", {
  headers: {
    "host": "myhost.com",
  },
  client,
});

Allow HTTP(S) URLs in WebSocket API

You can now use http: and https: URLs in the WebSocket Web API, Deno will automatically adjust the protocol to use ws: or wss: respectively:

const url = new URL("https://example.com");
const ws = new WebSocket(url);
console.log(ws.url);

Retry failed module downloads

Deno is now more resilient when downloading dependencies. Connecting to remote hosts can always fail due to intermittent connection problems or spurious errors on the remote server.

On such occasions, Deno will wait a short amount of time and retry the download, making CI pipelines more reliable and reducing the need to re-run commands.

More helpful errors in Deno.Command API

Before 1.36, if you tried to spawn a subprocess for a binary that was non-existent with Deno.Command, you were presented with an unhelpful error message:

$ deno
> new Deno.Command("this-binary-does-not-exist").spawn();
Uncaught NotFound: No such file or directory (os error 2)
    at spawnChildInner (ext:runtime/40_process.js:162:17)
    at spawnChild (ext:runtime/40_process.js:182:10)
    at Command.spawn (ext:runtime/40_process.js:440:12)
    at <anonymous>:2:48

With Deno 1.36, the error message will include the name of the binary that was not found:

$ deno
> new Deno.Command("this-binary-does-not-exist").spawn();
Uncaught NotFound: Failed to spawn: this-binary-does-not-exist: No such file or directory (os error 2)
    at spawnChildInner (ext:runtime/40_process.js:162:17)
    at spawnChild (ext:runtime/40_process.js:182:10)
    at Command.spawn (ext:runtime/40_process.js:440:12)
    at <anonymous>:2:48

LSP improvements

Deno 1.36 contains a plethora of fixes and improvements to the LSP. This should make using Deno with an editor that supports an LSP (like Visual Studio Code) significantly more pleasant. Here are a few of the changes:

Still want to learn more?

Believe it or not, the changes listed above still don’t tell you everything that got better in 1.36. You can view the full list of pull requests merged in Deno 1.36 on GitHub here.

We couldn’t build Deno without the help of our community! Whether by answering questions in our community Discord server or reporting bugs, we are incredibly grateful for your support. In particular, we’d like to thank the following people for their contributions to Deno 1.36.

Would you like to join the ranks of Deno community contributors? Check out our contribution docs here, and we’ll see you on the list next time.

Thank you for catching up with our 1.36 release, and we hope you love building with Deno!

🍋 Did you know? Fresh just got fresher.

Be sure to check out the release notes for Fresh 1.3, the latest iteration of the next-gen web framework for Deno.