Socket
Socket
Sign inDemoInstall

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


Version published
Maintainers
1
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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc