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

推荐订阅源

Forbes - Security
Forbes - Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Fortinet All Blogs
B
Blog
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
Y
Y Combinator Blog
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
Recent Announcements
Recent Announcements
U
Unit 42
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Register - Security
The Register - Security
Recorded Future
Recorded Future
C
Check Point Blog
V
V2EX
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
F
Full Disclosure
小众软件
小众软件
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
爱范儿
爱范儿
P
Proofpoint News Feed
罗磊的独立博客
量子位
D
Docker
博客园_首页
D
DataBreaches.Net
Project Zero
Project Zero
博客园 - 司徒正美
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - Franky
Security Latest
Security Latest
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
Netflix TechBlog - Medium
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
大猫的无限游戏
大猫的无限游戏

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.29: Custom npm registry support | Deno
2022-12-14 · via Deno

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

  • npm compatibility improvements
  • REPL changes
  • Quality of life improvements
  • Changes to Deno APIs
  • TypeScript 4.9
  • Changes to the standard modules

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

If you are installing Deno for the first time:


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


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

Click here for more installation options.

npm compatibility improvements

This release features several npm compatibility improvements and 30+ bug fixes since 1.28.0.

Custom registry support via environment variable

Deno now respects the NPM_CONFIG_REGISTRY environment variable, which allows for specifying a custom npm registry.

# change this to a custom registry
> NPM_CONFIG_REGISTRY=https://registry.npmjs.org deno run main.ts

In a future release, there will be support for using different registries per package scope and the ability to set credentials. Follow issue #16105 for updates.

deno install support

npm specifiers can now be used with deno install.

> deno install -A npm:cowsay@1.5.0
✅ Successfully installed cowsay
C:\Users\david\.deno\bin\cowsay.cmd
C:\Users\david\.deno\bin\cowsay (shell)
> cowsay Hello from deno!
 __________________
< Hello from deno! >
 ------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

This will additionally create a lockfile for the command on first run to ensure each subsequent run uses the same npm dependency versions.

REPL changes

REPLs are very valuable tools in a developer’s toolchain; allowing for quick experimentation. This release brings a plethora of updates to the REPL:

npm support

You can now use npm packages directly from the REPL. As for other Deno subcommands no prior installation step is required - just import a package and you’re good to go.

$ deno
> import cowsay from "npm:cowsay"
undefined
> console.log(cowsay.say({ text: "hello world" }))
 _____________
< hello world >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
undefined
>

deno repl runs with no permissions by default

Before this release both the deno and deno repl commands started the REPL with full permissions granted. While it’s useful for quick experimentation to not have to answer permission prompts, it’s somewhat conflicting with Deno’s “secure by default” story.

This release changes the deno repl subcommand to have no permissions granted by default. Permissions can be specified using --allow-* flags or you can defer to permission prompt when calling an API that requires a permission:

$ deno repl --allow-write
Deno 1.29.0
Run repl.help() to see help
exit using ctrl+d, ctrl+c, or close()
> Deno.writeTextFileSync("hello.txt", "hello world");
undefined
$ deno repl
Deno 1.29.0
Run repl.help() to see help
exit using ctrl+d, ctrl+c, or close()
> Deno.writeTextFileSync("hello.txt", "hello world");
⚠️  ┌ Deno requests write access to "hello.txt".
   ├ Requested by `Deno.writeFileSync()` API
   ├ Run again with --allow-write to bypass this prompt.
   └ Allow? [y/n] (y = yes, allow; n = no, deny) > y
✅ Granted write access to "hello.txt".
undefined

To make it clearer, running deno will show a banner informing that all permissions are allowed and suggesting to use deno repl subcommand if you want to limit permissions:

$ deno
Deno 1.29.0
Run repl.help() to see help
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
>

More reliable history handling

The REPL will now update history file on each executed statement, making history less spotty.

--quiet flag is now respected

If you use the REPL with --eval or --eval-file to build a custom REPL, it might be undesirable to see the default banner printed on startup. The REPL now respects the --quiet flag which will hide any auxiliary output from the REPL:

$ deno --quiet
>

Quality of life improvements

deno init improvements

The deno init subcommand was added in the v1.25 release to allow users to quickly scaffold a new project (though it’s completely optional). While this subcommand is very handy, it was also very minimalistic - generating only main.ts and main_test.ts files.

To make it more useful and allow IDEs to discover that we just initialized a new Deno project, deno init will also generate a deno.jsonc file as well as a main_bench.ts file.

The output of the subcommand was also refreshed.

deno init in Deno v1.28:

$ deno init ./my_deno_project
✅ Project initialized
Run these commands to get started
  cd ./my_deno_project
  deno run main.ts
  deno test

deno init in Deno v1.29:

$ deno init ./my_deno_project
✅ Project initialized

Run these commands to get started

  cd ./my_deno_project

  // Run the program
  deno run main.ts

  // Run the program and watch for file changes
  deno task dev

  // Run the tests
  deno test

  // Run the benchmarks
  deno bench

Thanks to sigmaSd for contributing these improvements.

Config file improvements

Starting with this release you can specify file inclusions and exclusions for deno bench, as well as the lockfile inside your configuration file.

Configure deno bench:

{
  "bench": {
    "files": {
      "include": ["./benches/"],
      "exclude": ["./benches/testdata/"]
    }
  }
}

If you want to use a non-default filename for the lockfile, you can do it like so…

{
  "lock": "./lock.file"
}

…or you can disable using lockfile altogether:

{
  "lock": false
}

Your IDE should be able to suggest these new options automatically.

Thanks to Geert-Jan Zwiers and @roj1512 for contributing these improvements.

Warning when --allow-* flags used incorrectly

Deno allows you to opt-in into the sandbox by providing various --allow-* flags. When executing deno run, these flags need to come before the script name, otherwise they are passed to the script itself in Deno.args.


console.log("cli args", Deno.args);
await Deno.writeTextFile("./hello.txt", "hello world");

Before Deno v1.29 you would get such output:

$ deno run example.js --allow-write
cli args [ "--allow-write" ]
⚠️  ┌ Deno requests write access to "./hello.txt".
   ├ Requested by `Deno.writeFile()` API
   ├ Run again with --allow-write to bypass this prompt.
   └ Allow? [y/n] (y = yes, allow; n = no, deny) >

We found that it’s a common mistake to place permission flags after the script name, so starting with this release, Deno will warn you that this might have been unintentional and suggest how to run the program properly:

$ deno run example.js --allow-write
Permission flags have likely been incorrectly set after the script argument.
To grant permissions, set them before the script argument. For example:
    deno run --allow-read=. main.js
cli args [ "--allow-write" ]
⚠️  ┌ Deno requests write access to "./hello.txt".
   ├ Requested by `Deno.writeFile()` API
   ├ Run again with --allow-write to bypass this prompt.
   └ Allow? [y/n] (y = yes, allow; n = no, deny) >

Thanks to Asher Gomez for contributing this improvement.

Show unresolved promise in top-level await

Deno supports top-level await which allows you to use the await keyword without having to wrap your code in an async IIFE. This is very useful and ergonomic, but in some situations the awaited promise never resolves - most often than not, due to a bug in the code:


await new Promise((resolve) => {}); 
console.log("hello world");

In such cases, an error was returned and program terminated execution:

deno run example.js
error: Module evaluation is still pending but there are no pending ops or dynamic imports. This situation is often caused by unresolved promises.

While the error suggests what might be the problem, it was up to the user to read through the code and try to spot where the problem lies. Thanks to a new v8 API a much nicer error is now shown along with stack trace of the unresolved promise:

$ deno run example.js
error: Top-level await promise never resolved
await new Promise((_resolve) => {});
^
    at <anonymous> (file:///Users/ib/dev/deno/example.js:1:1)

Ignore node_modules and .git folders by default

Starting with this release, all built-in Deno tooling will skip node_modules/ and .git/ directories by default. You can run tools like formatter (deno fmt) or linter (deno lint) without having to worry that they will start crawling through these big directories. You can still opt-in to search through these directories by specifying them explicitly (eg. deno fmt node_modules/).

deno check --remote flag renamed to --all

There was a discrepancy between the deno run and deno check commands where type checking all the code for deno run required doing deno run --check=all main.ts, but doing the same with deno check required using the --remote flag—deno check --remote main.ts.

This has now been resolved with --remote in deno check being renamed to --all, which also includes npm packages. The previous command will still work fine, but the new one is recommended.

New --inspect-wait CLI flag

Deno has an ability to connect to debuggers like Chrome DevTools, VSCode and others. You can do that if you specify either a --inspect or --inspect-brk flag. The former will enable the debugger and immediately run your code, while the latter will enable the debugger, wait for it to connect and stop execution on the first line of your code.

We received reports that there are situations, where it’s useful to wait for debugger to connect, but not necessarily break on the first line of user code. We’re happy to announce that we added a new --inspect-wait flag, which fills this requirement - it will wait for debugger session to be established before running user code, but it will not place a breakpoint on the first line of the code.

The --inspect-wait flag, similarly to --inspect and --inspect-brk allows you to provide an optional value with the network address for the debugger to connect to, like so: --inspect-wait=127.0.0.1:3000.

Inlay hints are enabled by default in VSCode extension

We added support for inlay hints in Deno v1.27. They were off by default, as we wanted to make sure that everything works fine. We are now confident that this feature is working as expected and we’re happy to announce that the latest release of VSCode extension for Deno now uses inlay hints by default (following default VSCode settings).

If you wish to disable them, you may do so by setting the following settings in your VSCode user settings:

{
  "deno.inlayHints.parameterNames.enabled": "none",
  "deno.inlayHints.parameterTypes.enabled": false,
  "deno.inlayHints.variableTypes.enabled": false,
  "deno.inlayHints.propertyDeclarationTypes.enabled": false,
  "deno.inlayHints.functionLikeReturnTypes.enabled": false,
  "deno.inlayHints.enumMemberValues.enabled": false
}

Alternatively, you could just disable inlay hints everywhere in VSCode by setting:

{
  "editor.inlayHints.enabled": "off"
}

Changes to Deno APIs

Stabilizations:

The following APIs have been stabilized in this release and no longer require the --unstable flag to be used:

  • Deno.TcpConn.setNoDelay()
  • Deno.TcpConn.setKeepAlive()

Removal of unstable Deno.spawn

The big change in this release is the removal of the unstable Deno.spawn(), Deno.spawnSync() and Deno.spawnChild() APIs. All of them have been replaced by a unified Deno.Command API. Subprocess APIs are hard to design to be both ergonomic for common tasks and flexible enough when you need low-level control of the subprocess you are spawning.

Let’s see examples on how to migrate your code:

const { stdout, stderr } = await Deno.spawn("echo", { args: ["foo"] });



const { stdout, stderr } = await new Deno.Command("echo", { args: ["foo"] })
  .output();
const { stdout, stderr } = Deno.spawnSync("echo", { args: ["foo"] });



const { stdout, stderr } = new Deno.Command("echo", { args: ["foo"] })
  .outputSync();
const child = Deno.spawnChild("cat", { stdin: "piped" });



const child = new Deno.Command("cat", { stdin: "piped" }).spawn();

Deno.Command#.spawn() is “inherit” by default for stdout and stderr

The unstable Deno.Command is now “inherit” by default for stdout and stderr when calling .spawn(). It remains as “piped” by default when calling .output() and .outputSync().


new Deno.Command("deno", {
  args: ["eval", "console.log(1); console.error(2);"],
}).spawn();

createNew option for Deno.writeFile and Deno.writeTextFile

This release adds a createNew option to Deno.writeFile, Deno.writeTextFile, and the corresponding synchronous APIs.


await Deno.writeTextFile("file.txt", "some text", { createNew: true });

await Deno.writeTextFile("file.txt", "some text", { createNew: true });

Previously, you would have needed to use the Deno.open API to get this functionality, which was overly verbose.

TypeScript 4.9

Deno v1.29 ships with the latest stable version of TypeScript. For more information on new features in TypeScript see TypeScript’s 4.9 blog post

Changes to the standard modules

Addition of testing/types module

In this release the testing/types module was added. It is a testing utility for checking the behaviors of complex types. The module is inspired by and ported from Conditional Type Checks by David Sherret.

import {
  assertType,
  IsExact,
  IsNullable,
} from "https://deno.land/std@0.167.0/testing/types.ts";

const result = "some result" as string | number;


assertType<IsExact<typeof result, string | number>>(true);


assertType<IsNullable<string>>(true); 

Thanks Lino Le Van for contributing this feature.

Structure changes towards single-export pattern

In the standard modules, multiple APIs are implemented in a single file in some places. The examples of such modules are bytes, datetime, io, etc. On the other hand, some modules have the pattern that each exported item is implemented in a single file (We call this pattern single-export pattern here). The examples of such modules are collections, fs, etc. There wasn’t explicit policy about which pattern to use for organizing modules so far, but we decided to move to the latter (single-export) pattern wherever it’s appropriate.

In this release the following 4 modules, archive, bytes, io, and stream, are restructured into single-export pattern. As a result, the following paths are deprecated, and will be removed in later releases (See the deprecation messages in IDEs for the exact versions of removals). Please update your import paths if you import from these paths.

  • std/streams/buffer.ts
  • std/streams/conversion.ts
  • std/streams/delimiter.ts
  • std/io/buffer.ts (except Buffer class)
  • std/io/files.ts
  • std/io/readers.ts
  • std/io/util.ts
  • std/io/writers.ts
  • std/archive/tar.ts (Untar export is deprecated.)

You can find the updated paths in the search dialog of the homepage.

Thanks Asher Gomez for suggesting and contributing this change.

API renames

The following APIs are renamed in this release. Please update them if you use these APIs directly in your code.

  • std/dotenv/mod.ts
    • config -> load
    • configSync -> loadSync
    • Note: the parameters also renamed. Please see the type definition for details.
  • std/fmt/bytes.ts
    • prettyBytes -> format
  • std/fmt/duration.ts
    • prettyDuration -> format

Thanks Tim Reichen for suggesting and contributing these changes.

If you could see helping ship something in a future release, check out our job postings.