# load-source-map

> Reads a source file and extracts a sourcemap for consumption (inline or external)

Latest version **3.0.1** (published 2022-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install load-source-map
pnpm add load-source-map
yarn add load-source-map
bun add load-source-map
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2022-03-07 |
| First published | 2017-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12 |
| Dependencies | 1 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Espen Hovlandsdal |
| Maintainers | rexxars |
| Keywords | sourcemap, stacktrace |

## Links

- npm: https://www.npmjs.com/package/load-source-map
- Repository: https://github.com/rexxars/load-source-map
- Homepage: https://github.com/rexxars/load-source-map#readme
- Issues: https://github.com/rexxars/load-source-map/issues
- npm.io page: https://npm.io/package/load-source-map

## Dependencies (1)

- [source-map](https://npm.io/package/source-map.md) ^0.8.0-beta.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2022-03-07
- 3.0.0 — 2022-03-07
- 2.0.0 — 2020-07-13
- 1.0.0 — 2017-03-30
- 0.0.1 — 2017-03-29

## README

# load-source-map

[![Version npm](http://img.shields.io/npm/v/load-source-map.svg?style=flat-square)](http://browsenpm.org/package/load-source-map)[![Build Status](http://img.shields.io/travis/rexxars/load-source-map/main.svg?style=flat-square)](https://travis-ci.org/rexxars/load-source-map)

Given a source file location, will load any referenced (or inline) source map.  
Result is a [SourceMapConsumer](https://github.com/mozilla/source-map#sourcemapconsumer).

## Installation

```bash
$ npm install --save load-source-map
```

## Usage

```js
var loadSourceMap = require('load-source-map')

loadSourceMap(__filename, function (err, sourcemap) {
  if (err) {
    throw err
  }

  if (!sourcemap) {
    // No source map found
    return
  }

  console.log(sourcemap.originalPositionFor({
    line: 3,
    column: 10,
  }))

  // { source: 'some-file.js',
  //   line: 2,
  //   column: 2,
  //   name: null }
})
```

## License

MIT-licensed. See LICENSE.

---
_Source: https://npm.io/package/load-source-map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
