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

推荐订阅源

NISL@THU
NISL@THU
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
IT之家
IT之家
Cyberwarzone
Cyberwarzone
博客园_首页
博客园 - 聂微东
V
Visual Studio Blog
Cisco Talos Blog
Cisco Talos Blog
V
Vulnerabilities – Threatpost
Google DeepMind News
Google DeepMind News
Schneier on Security
Schneier on Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Hacker News
The Hacker News
雷峰网
雷峰网
Last Week in AI
Last Week in AI
Spread Privacy
Spread Privacy
L
Lohrmann on Cybersecurity
O
OpenAI News
人人都是产品经理
人人都是产品经理
AWS News Blog
AWS News Blog
小众软件
小众软件
T
Tailwind CSS Blog
The Cloudflare Blog
L
LINUX DO - 最新话题
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
The GitHub Blog
The GitHub Blog
L
LINUX DO - 热门话题
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
B
Blog
MyScale Blog
MyScale Blog
S
SegmentFault 最新的问题
S
Schneier on Security
The Last Watchdog
The Last Watchdog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
大猫的无限游戏
大猫的无限游戏
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
博客园 - Franky
I
InfoQ
P
Proofpoint News Feed
量子位
S
Security @ Cisco Blogs

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 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 Webhooks suck, but here are alternatives | Deno
Node just added TypeScript support. What does that mean for Deno? | Deno
2025-03-07 · via Deno

Node.js recently added native TypeScript support in version 22.6 (stabilized in 23.6), a welcome enhancement simplifying setups for TypeScript users. This has sparked questions within the community about how Node’s new capabilities compare with Deno’s existing TypeScript integration.

In this post, we’ll explore Node’s TypeScript support and offer a clear comparison with Deno’s approach.

  • TypeScript in Node
  • TypeScript in Deno
    • What about tsconfig?
    • Typechecking in CI with deno check
    • Type-aware tooltips, errors, and more with LSP
    • TypeScript in deno repl and deno jupyter
    • Distributing TypeScript without transpilation
    • TypeScript and npm
    • TypeScript support across Deno’s toolchain
  • What’s next

TypeScript in Node

TypeScript adds types to JavaScript, helping structure your code as projects grow. It primarily handles two tasks:

  1. Type checking: Ensuring your variables match declared types.
  2. Type stripping: Transpiling TypeScript into plain JavaScript, executable by browsers and runtimes.

Node 22.6.0 introduced built-in TypeScript support, allowing automatic type stripping via the --experimental-strip-types flag. This feature was stabilized in Node 23.6, enabling direct execution (node foo.ts) without extra flags.

Node’s TypeScript support replaces type annotations with whitespace, resulting in valid JavaScript:


function sum(a: number, b: number): number {
  return a + b;
}
sum(5, 10);


function sum(a        , b        )         {
  return a + b;
}
sum(5, 10);

This essentially integrates functionality previously provided by ts-node directly into Node, simplifying TypeScript execution.

However, there are some limitations:

  • No built-in type checking: External tools like tsc are still required.
  • No JSX or TSX support: Node handles .ts, .mts, and .cts, but React (.tsx) and JSX projects still require external transpilers or bundlers such as esbuild, Babel, or tsc.
  • Manual management of tsconfig.json: Type checking still relies on external configuration via tsconfig.json.

That’s the overview of TypeScript in Node—let’s look at how Deno handles these aspects.

TypeScript in Deno

Deno simplifies web programming by providing a single executable with a fully integrated TypeScript toolchain. This approach offers TypeScript’s benefits with minimal configuration, streamlining testing, formatting, and compilation workflows.

Deno’s TypeScript integration comprises three main parts:

  1. Execution: Google’s V8 engine, which executes JavaScript but not TypeScript directly.
  2. Type checking: Microsoft’s TypeScript compiler (implemented in JavaScript) is internally bundled.
  3. Type stripping: SWC, a high-performance parser built in Rust by Kang Dong Yoon (강동윤), efficiently strips types without running JavaScript.

What about tsconfig.json?

Deno emphasizes zero-config development to avoid config overload. It provides sensible defaults (details here) suitable for most scenarios. If custom options are needed, you can easily use compilerOptions in deno.json or specify your own tsconfig.json:

deno -c tsconfig.json main.ts

Type checking in CI with deno check

Running deno check quickly identifies type errors, working locally or remotely:

deno check                 
deno check main.ts         
deno check jsr:@std/http/file-server 
deno check --all           
deno check --doc           
deno check --doc-only      

Type-aware tooltips, errors, and more with LSP

When using Deno’s language server (LSP), especially with editors like VSCode, you get immediate type-aware feedback and linting.

Type checking in VSCode from a JSR dependency

Real-time type checking of a JSR dependency in VSCode. No config needed.

Hover tooltip displaying documentation

Hover tooltip showing documentation.

TypeScript in deno repl and deno jupyter

You can run TypeScript directly within Deno’s REPL or Jupyter Notebooks:

$ deno
Deno 2.2.2
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
> const sum = function(a: number, b: number): number { return a + b };
undefined
> sum(5, 10)
15

(Note: REPL treats types as comments; no live checking.)

Distributing TypeScript without transpilation

Deno supports distributing TypeScript modules directly, removing the need for transpilation steps and separate .d.ts files.

The JSR registry leverages this, facilitating seamless TypeScript distribution without losing clarity or readability:

import { encodeBase64 } from "jsr:@std/encoding@1";

With JSR, debugging remains clear and straightforward—stack traces and source navigation link directly to original TypeScript code.

TypeScript and npm

Deno imports npm modules via package.json or npm: specifiers, providing full type checking support through .d.ts files. For packages without types, use the @ts-types pragma:


import express from "npm:express";

TypeScript support across Deno’s toolchain

Deno integrates TypeScript extensively throughout its tooling:

  • deno fmt: formats TypeScript.
  • deno compile: compiles TypeScript to executables.
  • deno doc: generates documentation directly from TypeScript.
  • deno lint: built-in TypeScript linting rules.

Additionally, .tsx and .jsx support makes React or Preact seamless.

What’s next?

TypeScript continues growing as the preferred language for maintainable JavaScript. Deno remains committed to simplifying TypeScript workflows by reducing boilerplate and configurations.

We’ll keep enhancing Deno’s TypeScript integration so you can focus more on building great software and less on setup.

🚨️ Deno 2.2 released! 🚨️

and more!