Deno 1.13 稳定版发布

栏目: 软件资讯 · 发布时间: 3年前

内容简介:Deno 1.13 稳定版已发布,主要包含以下新特性和变更: 原生 HTTP server API 到达稳定状态 支持 self.structuredClone() 针对 TLS 使用系统证书存储 (system certificate store) 支持禁用 TLS 验证以进行测试 升级...

Deno 1.13 稳定版已发布,主要包含以下新特性和变更:

原生 HTTP server API

原生 HTTP server API 在此版本中已进入稳定阶段,可有效地为 HTTP/1.1 和 HTTP/2 流量提供服务:

for await (const conn of Deno.listen({ port: 4500 })) {
  (async () => {
    for await (const { respondWith } of Deno.serveHttp(conn)) {
      respondWith(new Response("Hello World"));
    }
  })();
}

支持self.structuredClone()

self.structuredClone()以简单、常用且同步的 API 公开了用于在 Web Worker 和 MessagePort 之间传递消息的结构化克隆算法。

import { assert } from "https://deno.land/std@0.104.0/testing/asserts.ts";

// Create an object with a value and a circular reference to itself.
const foo = { bar: "baz" };
foo.foo = foo;

// Clone it
const clone = self.structuredClone(foo);

assert(clone !== foo); // assert they are not the same object
assert(clone.bar === "baz"); // assert they  do have the same value though
assert(clone.foo === clone); // assert that the circular reference is preserved

console.log("All assertions passed!");

尝试使用:

deno run https://deno.com/v1.13/structured_clone.js

升级 WebCrypto APIs

此版本为WebCrypto APIs 增加了部分功能:

  • crypto.subtle.importKey()crypto.subtle.exportKey()支持导入和导出原始 HMAC 密钥
  • crypto.subtle.verify()支持验证从 HMAC 密钥创建的签名

详情查看发布公告


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

HotSpot实战

HotSpot实战

陈涛 / 人民邮电出版社 / 2014-3 / 69

《HotSpot实战》深入浅出地讲解了HotSpot虚拟机的工作原理,将隐藏在它内部的本质内容逐一呈现在读者面前,包括OpenJDK与HotSpot项目、编译和调试HotSpot的方法、HotSpot内核结构、Launcher、OOP-Klass对象表示系统、链接、运行时数据区、方法区、常量池和常量池Cache、Perf Data、Crash分析方法、转储分析方法、垃圾收集器的设计演进、CMS和G......一起来看看 《HotSpot实战》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具