源映射 v3 支持
【Source map v3 support】
稳定性: 1 - 实验性
用于与源映射缓存交互的辅助工具。当启用源映射解析并且在模块的页脚中找到 源映射包含指令 时,此缓存会被填充。
【Helpers for interacting with the source map cache. This cache is populated when source map parsing is enabled and source map include directives are found in a modules' footer.】
要启用源映射解析,必须使用标志 --enable-source-maps 运行 Node.js,或者通过设置 NODE_V8_COVERAGE=dir 启用代码覆盖率。
【To enable source map parsing, Node.js must be run with the flag
--enable-source-maps, or with code coverage enabled by setting
NODE_V8_COVERAGE=dir.】
// module.mjs
// In an ECMAScript module
import { findSourceMap, SourceMap } from 'node:module';// module.cjs
// In a CommonJS module
const { findSourceMap, SourceMap } = require('node:module');