- 基于 Promise 的其它核心模块 API
 - 错误堆栈尾部增加 Node.js 版本信息
 - OpenSSL 3.0 支持
 - v8 JavaScript 引擎更新至 9.5
 
Node.js 的奇数版本不是稳定的版本
- 例如,当前的 Node.js v17 ,生命周期很短,不要用于生产环境
 
V8引擎9.5
- 8.1 版本开启了 Intl.DisplayNames API,支持四种类型
- 语言
 - 区域
 - 货币
 - 脚本
 
 - 9.5版本,新增
- calendar 返回不同的日历类型
 - dateTimeField 返回不同的日期时间字段的显示
 - 对于国际化应用很有用 ```jsx const esCalendarNames = new Intl.DisplayNames([‘zh’], { type: ‘calendar’ }); console.log(esCalendarNames.of(‘roc’)); // 民国纪年
 
 
const enCalendarNames = new Intl.DisplayNames([‘en’], { type: ‘calendar’ }); console.log(enCalendarNames.of(‘roc’)); // Minguo Calendar
function printDate(dateTimeField) { dateTimeField.of(‘year’) dateTimeField.of(‘month’) dateTimeField.of(‘day’)
printDate(new Intl.DisplayNames([‘zh’], { type: ‘dateTimeField’ })) // 年 月 日 // year month day printDate(new Intl.DisplayNames([‘en’], { type: ‘dateTimeField’ }))
printDate(new Intl.DisplayNames([‘KOR’], { type: ‘dateTimeField’ })) // 년 월 일 printDate(new Intl.DisplayNames([‘THA’], { type: ‘dateTimeField’ })) // ปี เดือน วัน
Intl.DateTimeFormat API 在 v8 9.5 版本中为 timeZoneName 选项新增加了四个值1. shortGeneric1. longGeneric1. shortOffset1. longOffset<a name="EeqL1"></a>## Promise API<a name="QJGFU"></a>### readlinereadline 从一个可读流对象逐行读取数据<br />process.stdin 可读取用户在终端输入的数据```jsximport * as readline from "node:readline/promises";import { stdin as input, stdout as output } from 'process';const rl = readline.createInterface({ input, output });const answer = await rl.question('“Nodejs技术栈” 的域名是什么:');console.log(`答案: ${answer}`);rl.close();
错误堆栈增加 Node.js 版本
如果因为一些致命的错误导致进程退出,在错误堆栈的尾部将包含 Node.js 的版本信息
忽略该信息,运行时在命令行指定 —no-extra-info-on-fatal-exception 标志
OpenSSL3.0
OpenSSL 3.0 对允许的算法和密钥大小增加了严格的限制,对生态系统的影响
- md4 这是 OpenSSL 3.0 默认不再允许的一个算法
 - 在 Node.js 17 之前的 Node 版本中,应用程序是可以正常运行的
 - Node.js v17 中将抛出一个 error code 为 ERR_OSSL_EVP_UNSUPPORTED 的错误信息
解决方法是运行时增加 —openssl-legacy-provider 标志,应用程序报错import crypto from 'crypto';console.log(crypto.createHash('md4').update('123', 'utf8').digest('hex'))
node --openssl-legacy-provider test.mjs
 
