You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

concat-with-sourcemaps

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

concat-with-sourcemaps

Concatenate file contents with a custom separator and generate a source map

1.1.0
latest
Source
npm
Version published
Weekly downloads
1.3M
-14.03%
Maintainers
1
Weekly downloads
 
Created

What is concat-with-sourcemaps?

The concat-with-sourcemaps npm package allows you to concatenate multiple files and generate source maps for the concatenated output. This is particularly useful in build processes where you need to combine multiple JavaScript or CSS files into a single file while maintaining the ability to debug the original source files.

What are concat-with-sourcemaps's main functionalities?

Concatenate files

This feature allows you to concatenate multiple files into a single file. The example code demonstrates how to concatenate two JavaScript files, 'file1.js' and 'file2.js', into a single file 'all.js'.

const Concat = require('concat-with-sourcemaps');
const concat = new Concat(true, 'all.js', '\n');

concat.add('file1.js', 'console.log("file1");\n');
concat.add('file2.js', 'console.log("file2");\n');

console.log(concat.content.toString());
console.log(concat.sourceMap);

Generate source maps

This feature allows you to generate source maps for the concatenated output. The example code demonstrates how to add source maps for 'file1.js' and 'file2.js' with a specified source root.

const Concat = require('concat-with-sourcemaps');
const concat = new Concat(true, 'all.js', '\n');

concat.add('file1.js', 'console.log("file1");\n', { sourceRoot: 'src' });
concat.add('file2.js', 'console.log("file2");\n', { sourceRoot: 'src' });

console.log(concat.content.toString());
console.log(concat.sourceMap);

Other packages similar to concat-with-sourcemaps

Keywords

concat

FAQs

Package last updated on 02 May 2018

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