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

推荐订阅源

The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LangChain Blog
W
WeLiveSecurity
P
Proofpoint News Feed
月光博客
月光博客
NISL@THU
NISL@THU
L
LINUX DO - 最新话题
Webroot Blog
Webroot Blog
T
Threatpost
Y
Y Combinator Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Threat Research - Cisco Blogs
Vercel News
Vercel News
Jina AI
Jina AI
阮一峰的网络日志
阮一峰的网络日志
S
Schneier on Security
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
小众软件
小众软件
MyScale Blog
MyScale Blog
N
News and Events Feed by Topic
Stack Overflow Blog
Stack Overflow Blog
有赞技术团队
有赞技术团队
The Hacker News
The Hacker News
Schneier on Security
Schneier on Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
Recent Announcements
Recent Announcements
S
Security @ Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Securelist
T
The Exploit Database - CXSecurity.com
云风的 BLOG
云风的 BLOG
C
Cisco Blogs
雷峰网
雷峰网
量子位
Google DeepMind News
Google DeepMind News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Spread Privacy
Spread Privacy
L
Lohrmann on Cybersecurity
I
Intezer
T
The Blog of Author Tim Ferriss
G
GRAHAM CLULEY
D
DataBreaches.Net
V
Vulnerabilities – Threatpost
P
Privacy & Cybersecurity Law Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
罗磊的独立博客

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.16 Release Notes | Deno
2021-11-09 · via Deno

Deno 1.16 has been tagged and released with the following features and changes:

  • fetch now supports fetching file URLs
  • Support for new JSX transforms
  • New unstable signal listener API
  • Error.cause is now displayed in the console
  • Handshaking TLS connections can now be done explicitly
  • Improvements to Web Streams API
  • Deno.startTls stabilized
  • Per-test permissions are now stable
  • localStorage does not require --location anymore
  • Support for specifying a reason when aborting an AbortSignal
  • Deno to npm package build tool
  • WebAssembly Reference types now available in stable
  • findLast and findLastIndex array methods

If you already have Deno installed, you can upgrade to 1.16 by running

If you are installing Deno for the first time, you can use one of the methods listed below:


curl -fsSL https://deno.land/x/install/install.sh | sh


iwr https://deno.land/x/install/install.ps1 -useb | iex


brew install deno


scoop install deno


choco install deno

New features and changes

fetch now supports fetching file URLs

This release adds support for using fetch to read files from the local file system. This is useful for fetching files relative to the current module using import.meta.url, like is often done for WASM modules.

Here is an example of reading the /etc/hosts file:

const resp = await fetch("file:///etc/hosts");
const text = await resp.text();
console.log(text);

Note: the above example will not work on Windows, as the /etc/hosts file is located in a different location on Windows. Try the code below instead:

const resp = await fetch("file:///C:/Windows/System32/drivers/etc/hosts");

The --allow-read permission is required to use fetch to read files from the local file system.

The contents of the file are read in chunks, so this is a great way to stream a large file via HTTP without having to load the entire file into memory:

import { serve } from "https://deno.land/std/http/server.ts";

serve((_req) => {
  const resp = await fetch(new URL("./static/index.html", import.meta.url));
  return new Response(resp.body, {
    headers: { "content-type": "text/html; charset=utf-8" },
  });
});

The behaviour of file fetches is not specified in any web specification, but our implementation is based on the implementation for reading files from disk in Firefox:

  • If a file is not found, the promise returned from fetch rejects with a TypeError.
  • If the item at the specified path is a directory, the promise returned from fetch rejects with a TypeError.
  • No content-length header is set on the response. This is because the response body is a stream, so the exact length cannot be known ahead of time.
  • No content-type header is set on the response. If you want to derive a content type from the file extension, you can use the media_types module on https://deno.land/x.

Support for new JSX transforms

React 17 introduced a new JSX transform which makes improvements to the JSX transform API as well as allowing automatic importing of the JSX runtime library. Starting with this release, Deno supports these transforms.

It can be used two different ways. The first way is using the @jsxImportSource pragma in a .jsx or .tsx file. For example, to use Preact from esm.sh:



export Welcome({ name }) {
  return (
    <div>
      <h1>Welcome {name}</h1>
    </div>
  );
}

The other option is using a configuration file and setting the compiler options project wide:

{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "https://esm.sh/preact"
  }
}

And then passing the --config file on the command line (or setting the deno.config option in your editor).

For more details, refer to the manual section on configuring JSX.

New unstable signal listener API

This release adds a new unstable API for listening to operating system signals. The new API is currently experimental and may change in the future. It supersedes the existing Deno.signals API (which was also unstable).

const listener = () => {
  console.log("SIGTERM!");
};


Deno.addSignalListener("SIGTERM", listener);


Deno.removeSignalListener("SIGTERM", listener);

We are interested in community feedback. If you have any suggestions, please open an issue.

Error.cause is now displayed in the console

Since Deno 1.13, the Error.cause property has been supported as a way to attach a cause to an error. This is useful for debugging errors that occur deep inside of an application, allowing developers to wrap these errors in useful information to help debug issues.

Starting in this release we will display the Error.cause property in the console when an error is thrown or logged via console.log:

> throw new Error("main error", { cause: new TypeError("caused by this") })
Uncaught Error: main error
    at <anonymous>:2:7
Caused by TypeError: caused by this
    at <anonymous>:3:12

This matches the behaviour of Node.js 17.

Thanks to Kenta Moriuchi for implementing this feature.

Handshaking TLS connections can now be done explicitly

When establishing a connection over TLS before data can be read or written on the encrypted connection, a TLS handshake needs to be performed. Most users do not need to care about the specifics of handshaking, which is why we do it automatically when a user first tries to read or write data on the connection.

This release adds a handshake() method to Deno.TlsConn that can be called to explicitly trigger a handshake. This method returns a promise that resolves once the handshake is complete. If the method is called after the handshake is already complete, the promise will resolve immediately. If the method is called while a handshake is in progress, but not yet complete, the returned promise will resolve once the handshake is completed.

Improvements to Web Streams API

This release introduces multiple new features from the Web Streams API:

  • ReadableStreamBYOBReader is now supported. These “bring-your-own-buffer” (also known as BYOB) ReadableStream readers allow reading into a developer-supplied buffer, thus minimizing copies in comparison to the regular ReadableStreamDefaultReader. You can read more about this API on MDN.
  • WritableStreamDefaultController.signal is now supported. See the explainer for more information.
  • ReadableStream.getIterator has been removed. This method has been deprecated since Deno 1.7, and was never implemented in any browser. The ReadableStream itself has always implemented the AsyncIterable protocol, so use that instead when iterating over a stream.

Thanks to @crowlKats for the work on the Web Streams implementation.

Deno.startTls stabilized

In Deno there are two ways to connect to a server via TLS: Deno.connectTls and Deno.startTls. The first is used when you want open a TCP connection and then immediately start talking TLS over it. The latter is used when you need to create a plain text TCP connection first, exchange some data, and then start talking TLS over it.

Deno 1.16 stabilizes the Deno.startTls API. This makes it possible to write an SMTP driver for stable Deno. It also allows Postgres and MySQL drivers written for stable Deno. The https://deno.land/x/postgres driver for Deno now works fully in Deno stable:

import { Client } from "https://deno.land/x/postgres@v0.14.0/mod.ts";

const client = new Client({
  user: "user",
  database: "test",
  hostname: "psql.example.com",
  port: 5432,
  tls: {
    enforce: true,
    caCertificates: [await Deno.readTextFile("/path/to/ca.crt")],
  },
});
await client.connect();

const result = await client.queryObject("SELECT id, name FROM people");
console.log(result.rows); 

Per-test permissions are now stable

Back in Deno 1.10 we introduced a feature that allows you to set per test permissions. This makes it super easy to test how your program behaves with different permissions set. This feature is now stable: it does not require --unstable anymore. For an example, check out the 1.10 blog post linked above.

Keep in mind, permissions requested by a test case cannot exceed permissions granted to the process using --allow-* flags. If a key is omitted in permissions object then it inherits its value from the respective --allow-* flag.

localStorage does not require --location anymore

In previous versions of Deno, the localStorage API could only be used if the user started a Deno process with a --location flag. This release adds an implicit opaque key for the storage bucket used by localStorage when you start Deno without a --location flag. This is derived as follows:

  • When using the --location flag, the origin for the location is used to uniquely store the data. That means a location of http://example.com/a.ts and http://example.com/b.ts and http://example.com:80/ would all share the same storage, but https://example.com/ would be different.
  • If there is no location specifier, but there is a --config configuration file specified, the absolute path to that configuration file is used. That means deno run --config deno.jsonc a.ts and deno run --config deno.jsonc b.ts would share the same storage, but deno run --config tsconfig.json a.ts would be different.
  • If there is no configuration or location specifier, Deno uses the absolute path to the main module to determine what storage is shared. The Deno REPL generates a “synthetic” main module that is based off the current working directory where deno is started from. This means that multiple invocations of the REPL from the same path will share the persisted localStorage data.

Some examples to help clarify this behaviour:


$ cat one.js
console.log(localStorage.getItem("file"));
localStorage.setItem("file", Deno.mainModule);
$ deno run one.js
null
$ deno run one.js
file:///tmp/one.js



$ cat two.js
console.log(localStorage.getItem("file"));
localStorage.setItem("file", Deno.mainModule);
$ deno run two.js
null
$ deno run two.js
file:///tmp/two.js



$ cat three.js
import "./two.js";
$ deno run three.js
null
$ deno run three.js
file:///tmp/three.js


$ deno run --config=deno.jsonc one.js
null
$ deno run --config=deno.jsonc one.js
file:///tmp/one.js
$ deno run --config=deno.jsonc two.js
file:///tmp/one.js
$ deno run --config=deno.jsonc one.js
file:///tmp/two.js




$ deno run --location=https://example.com one.js
null
$ deno run --location=https://example.com one.js
file:///tmp/one.js
$ deno run --location=https://example.com two.js
file:///tmp/one.js
$ deno run --location=https://example.com one.js
file:///tmp/two.js

More information is available in the manual: https://docs.deno.com/runtime/manual/runtime/web_storage_api

Support for specifying a reason when aborting an AbortSignal

WHATWG has recently specified support for specifying a reason when aborting an AbortSignal. Deno is the first platform to implement this new feature:

const abortController = new AbortController();
abortController.abort();
console.log(abortController.signal.reason); 

const abortController = new AbortController();
const reason = new DOMException("The request timed out", "TimeoutError");
abortController.abort(reason);
console.log(abortController.signal.reason); 

Thanks to @crowlKats for implementing this feature.

We continue to make improvements to our Node compatibility mode (--compat) but nothing concrete to announce in this release. However, we have released a new system called dnt for publishing modules written in Deno as npm packages.

By default, dnt will transform your Deno module to canonical TypeScript, type check, build an ESM & CommonJS hybrid package with TypeScript declaration files, and finally run your Deno test code in Node.js against the output. Once done, you only have to npm publish the output directory.

An example project that is already using dnt is deno_license_checker which is now published as an npm package: https://www.npmjs.com/package/@kt3k/license-checker

Try it out with:

npm install -g @kt3k/license-checker

This allows you to use Deno-first code in Node environments.

It’s still early days, but we would appreciate if you try it out, thoroughly test and inspect its output, and see what problems or challenges arise so we can prioritize and fix them.

V8 updated to version 9.7

This release ships with V8 9.7. Deno 1.15 shipped with V8 9.5, so this time you are getting two V8 versions worth of new JS goodies 😀

As usual, the V8 release also brings with it a bunch of performance improvements and bug fixes.

See V8’s release notes for more details: https://v8.dev/blog/v8-release-97.

WebAssembly Reference Types now supported

The Reference Types proposal, allows using external references from JavaScript opaquely in WebAssembly modules. The externref (formerly known as anyref) data type provides a secure way of holding a reference to a JavaScript object and is fully integrated with V8’s garbage collector.

This feature was introduce in V8 9.6. See https://v8.dev/blog/v8-release-96.

findLast and findLastIndex array methods

The findLast and findLastIndex methods on Arrays and TypedArrays find elements that match a predicate from the end of an array.

For example:

[1, 2, 3, 4].findLast((el) => el % 2 === 0);

For more info, see the feature explainer.

HN Comments