Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including generate-source-map with all npm packages installed. Try it out:

var generateSourceMap = require("generate-source-map")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

generate-source-map v0.0.5

Generates an identity source-map from a javascript file

generate-source-map

Generates an identity source-map from a javascript file

Can be used with combine-source-map to generate source-maps with correct line and column information before bundling.

Installation

$ npm install generate-source-map

Usage

var generate = require('generate-source-map');
var fs = require('fs');

var file = {
  source: fs.readFileSync('test.js'),
  sourceFile: 'test.js'
};

var map = generate(file);

console.log(map.toString());

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free