Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 6, 2024 via pnpm

source-map 0.6.1

Generates and consumes source maps
Package summary
Share
0
issues
1
license
1
BSD-3-Clause
Package created
30 Aug 2011
Version published
29 Sep 2017
Maintainers
19
Total deps
1
Direct deps
0
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
source-map@0.6.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of source-map 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does source-map do?

Source-map is a JavaScript library used for generating and consuming the source map format. It was developed by Mozilla as part of their Rust and WebAssembly compilation pipeline. Source maps help improve the debugging process by offering a way to map a combined or minified file back to its original source.

How do you use source-map?

Using Source Map in your JavaScript project is straightforward. You can install the package via npm by using the npm install command: npm install source-map. Once installed, you can include it in your project with the require syntax: var sourceMap = require('source-map');.

As an example, the following code demonstrates generating a source map:

var SourceMapGenerator = require('source-map').SourceMapGenerator;
var generator = new SourceMapGenerator({ file: 'source-mapped.js' });

generator.addMapping({
  source: 'foo.js',
  generated: { line: 10, column: 35 },
  original: { line: 33, column: 2 },
  name: 'christopher'
});

console.log(generator.toString());

The SourceMapConsumer class can be used to read and query data from your existing source map:

var SourceMapConsumer = require('source-map').SourceMapConsumer;
var rawSourceMap = {...}; // Your existing source map
var consumer = new SourceMapConsumer(rawSourceMap);

var pos = consumer.originalPositionFor({ line: 2, column: 28 });
console.log(pos);

For browser use, you can include it using a script tag. Initialization is required before constructing any SourceMapConsumers:

<script src="https://unpkg.com/source-map@0.7.3/dist/source-map.js"></script>
<script>
    sourceMap.SourceMapConsumer.initialize({
        "lib/mappings.wasm": "https://unpkg.com/source-map@0.7.3/lib/mappings.wasm"
    });
    /* Your code here */
</script>

Where are the source-map docs?

The documentation for the source-map npm package is available in the README file of the project's GitHub repository. The repository can be found at git+ssh://git@github.com/mozilla/source-map.git. The README contains detailed instructions and examples on how to use the package, its API, and abundant information on source maps. Make sure to have a look at the Examples and API sections. These describe how to consume a source map, generate a new one, and use the high-level and low-level APIs.