Deno 1.13 稳定版发布

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

内容简介: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 密钥创建的签名

详情查看发布公告


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

查看所有标签

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

大数据之路

大数据之路

阿里巴巴数据技术及产品部 / 电子工业出版社 / 2017-7-1 / CNY 79.00

在阿里巴巴集团内,数据人员面临的现实情况是:集团数据存储已经达到EB级别,部分单张表每天的数据记录数高达几千亿条;在2016年“双11购物狂欢节”的24小时中,支付金额达到了1207亿元人民币,支付峰值高达12万笔/秒,下单峰值达17.5万笔/秒,媒体直播大屏处理的总数据量高达百亿级别且所有数据都需要做到实时、准确地对外披露……巨大的信息量给数据采集、存储和计算都带来了极大的挑战。 《大数据......一起来看看 《大数据之路》 这本书的介绍吧!

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

在线压缩/解压 JS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具