Concepts

Node SourceMap.findEntry()

Try the free JavaScript compiler

Queries a source map for a generated zero-based line and column. Returns mapping information when present. Node API, not a browser global.

Formal Syntax & Structure

javascript syntaxjavascript
map.findEntry(lineOffset, columnOffset)

Parameters & Attributes

NameTypeDescription
lineOffsetnumberZero-based generated line.
columnOffsetnumberZero-based generated column.

Return Value

object

Mapping entry or empty object.

Working Example

Example Snippetjavascript
(async () => {const {SourceMap}=require("node:module");const map=new SourceMap({version:3,sources:["original.js"],names:[],mappings:"AAAA"});const entry=map.findEntry(0,0);console.log(entry.originalLine,entry.originalColumn,entry.originalSource.endsWith("original.js"));})()
JavaScript Reference