Socket
Socket
Sign inDemoInstall

source-list-map

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

source-list-map

Fast line to line SourceMap generator.


Version published
Weekly downloads
7.2M
decreased by-21.5%
Maintainers
1
Weekly downloads
 
Created

What is source-list-map?

The source-list-map npm package is a utility designed to manage source maps and source content. It allows for efficient manipulation of source maps and the integration of different pieces of source content, making it a valuable tool for developers working with complex JavaScript projects where tracking and combining source maps is necessary.

What are source-list-map's main functionalities?

Add a source to the map

This feature allows you to add a new source, including its code, filename, and original source code, to the source list map. It's useful for building a source map from scratch or adding new sources to an existing map.

var SourceListMap = require('source-list-map').SourceListMap;
var map = new SourceListMap();
map.add('source code', 'source-file.js', 'source code');

Generate source map

After adding sources to the source list map, you can generate a source map. This feature outputs the source map as a string, which can be used in a JavaScript file or saved as a separate source map file. It's essential for debugging purposes, allowing you to trace back minified code to its original source.

var map = new SourceListMap();
map.add('source code', 'source-file.js', 'source code');
var sourceMap = map.toStringWithSourceMap({file: 'output-file.js'});

Combine source maps

This feature demonstrates how to combine two source maps into one. It's particularly useful when you're working with multiple JavaScript files or libraries and need to create a single source map that references all the original source files.

var SourceListMap = require('source-list-map').SourceListMap;
var map1 = new SourceListMap();
var map2 = new SourceListMap();
map1.add('source code 1', 'source-file1.js', 'source code 1');
map2.add('source code 2', 'source-file2.js', 'source code 2');
map1.add(map2);
var combinedMap = map1.toStringWithSourceMap({file: 'combined-output.js'});

Other packages similar to source-list-map

Keywords

FAQs

Package last updated on 04 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc