🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

combine-source-map

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

combine-source-map

Add source maps of multiple files, offset them and then combine them into one source map

0.7.2
Source
npm
Version published
Weekly downloads
1.7M
-6.73%
Maintainers
2
Weekly downloads
 
Created

What is combine-source-map?

The combine-source-map npm package is used to create and modify source maps, which are files that map from the transformed source to the original source, allowing developers to debug their code more easily. This package is particularly useful when dealing with multiple source files that need to be combined into a single file, while still maintaining accurate source maps.

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

Create a new source map

This feature allows you to create a new source map for a given file. In this example, a new source map is created for 'bundle.js'.

const combine = require('combine-source-map');
const map = combine.create('bundle.js');
console.log(map);

Add a file to the source map

This feature allows you to add a file to the source map. In this example, 'file1.js' is added to the source map with its content and starting line number.

const combine = require('combine-source-map');
const map = combine.create('bundle.js');
map.addFile({ sourceFile: 'file1.js', source: 'console.log("file1");' }, { line: 0 });
console.log(map);

Generate the source map

This feature allows you to generate the source map in base64 format. In this example, after adding 'file1.js' to the source map, the source map is generated and logged in base64 format.

const combine = require('combine-source-map');
const map = combine.create('bundle.js');
map.addFile({ sourceFile: 'file1.js', source: 'console.log("file1");' }, { line: 0 });
const sourceMap = map.base64();
console.log(sourceMap);

Other packages similar to combine-source-map

Keywords

source

FAQs

Package last updated on 13 Apr 2016

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