Skip to content

altwine/fake-source-map

Repository files navigation

fake-source-map npm version

Generates fake source maps for real javascript code

Devtools screenshot with source map file opened

Installation

Get it straight from NPM:

npm i fake-source-map

Building from Source

Build it yourself:

$ git clone https://github.com/altwine/fake-source-map.git
$ cd fake-source-map
$ npm install
$ npm run format
$ npm run test
$ npm run build

API Usage

Basic Example

import { FakeSourceMapGenerator } from 'fake-source-map';
import path from 'node:path';

const file = './my-real-code.js';
const fakeCode = '\n   (its over...)\n (-_-)\n';

const filename = path.basename(file);
const fsmg = new FakeSourceMapGenerator({ filename });
fsmg.fromFile(file, fakeCode);
fsmg.appendToFile(file);

License

MIT. Check LICENSE file.

About

Generates fake source maps for real javascript code

Topics

Resources

License

Stars

Watchers

Forks

Contributors