Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

fast-sourcemap-concat

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-sourcemap-concat

Concatenate files while generating or propagating sourcemaps.


Version published
Weekly downloads
163K
increased by1.32%
Maintainers
4
Weekly downloads
 
Created

What is fast-sourcemap-concat?

The fast-sourcemap-concat npm package is designed to concatenate multiple JavaScript files and generate source maps for them. This is particularly useful in build processes where you need to combine several files into one while maintaining the ability to debug the original source code.

What are fast-sourcemap-concat's main functionalities?

Concatenate JavaScript files

This feature allows you to concatenate multiple JavaScript files into a single output file. The code sample demonstrates how to create a new Concat instance, add files to it, and then finalize the concatenation process.

const Concat = require('fast-sourcemap-concat');
const concat = new Concat({ outputFile: 'output.js' });

concat.addFile('file1.js');
concat.addFile('file2.js');

concat.end();

Generate source maps

This feature enables the generation of source maps while concatenating files. The code sample shows how to enable source map generation by setting the `sourceMap` option to true.

const Concat = require('fast-sourcemap-concat');
const concat = new Concat({ outputFile: 'output.js', sourceMap: true });

concat.addFile('file1.js');
concat.addFile('file2.js');

concat.end();

Add raw content

This feature allows you to add raw content directly to the concatenated output. The code sample demonstrates how to add a raw JavaScript snippet using the `addSpace` method.

const Concat = require('fast-sourcemap-concat');
const concat = new Concat({ outputFile: 'output.js' });

concat.addFile('file1.js');
concat.addFile('file2.js');
concat.addSpace('console.log("Hello World");');

concat.end();

Other packages similar to fast-sourcemap-concat

FAQs

Package last updated on 18 Jul 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