什么是“node:fs”、“node:path”等模块?

Sid*_*rth 17 require node.js node-modules

最近,在使用 linter 时,我发现一些内置包的名称前面带有node:. 我搜索了很多,但没有得到任何有用的信息。node:module这个语法是什么?

mar*_*lin 19

核心模块也可以使用 node: 前缀来标识,在这种情况下它会绕过 require 缓存。例如, require('node:http') 将始终返回内置的 HTTP 模块,即使存在该名称的 require.cache 条目。

https://nodejs.org/api/modules.html

  • 而这有什么用呢? (8认同)