# generate-sourcemap

> Generates a source map for files that were packed into a bundle.

Latest version **0.0.2** (published 2022-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install generate-sourcemap
pnpm add generate-sourcemap
yarn add generate-sourcemap
bun add generate-sourcemap
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-06-01 |
| First published | 2013-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Thorsten Lorenz |
| Maintainers | thlorenz |
| Keywords | generate, sourcemap, bundle, browser, generate, browserify |

## Links

- npm: https://www.npmjs.com/package/generate-sourcemap
- Repository: https://github.com/thlorenz/generate-sourcemap
- Issues: https://github.com/thlorenz/generate-sourcemap/issues
- npm.io page: https://npm.io/package/generate-sourcemap

## Dependencies (1)

- [source-map](https://npm.io/package/source-map.md) ~0.1.9

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2022-06-01
- 0.1.0 — 2013-03-12

## README

# generate sourcemap [![build status](https://secure.travis-ci.org/thlorenz/generate-sourcemap.png)](http://travis-ci.org/thlorenz/generate-sourcemap)

Generates a source map for files that were packed into a bundle.

```js
var create = require('generate-sourcemap');
var gen = create('bundle.js');
var ranges = [
    { sourceFile: 'foo.js', start: 3, end: 5 }
  , { sourceFile: 'bar.js', start: 6, end: 15 }
];

gen.addRanges(ranges);

console.log('source map for ranges:\n', ranges);
console.log('is: \n', gen.getMap());
```

Output:
```
source map for ranges:
 [ { sourceFile: 'foo.js', start: 3, end: 5 },
  { sourceFile: 'bar.js', start: 6, end: 15 } ]
is: 
 {"version":3,"file":"bundle.js","sources":["foo.js","bar.js"],"names":[],"mappings":";;;AAAA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
```

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