Socket
Socket
Sign inDemoInstall

concat-with-sourcemaps

Package Overview
Dependencies
1
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

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
Weekly downloads
1,271,600
decreased by-2.13%
Install size
798 kB

Weekly downloads

Readme

Source

Concat with source maps NPM version build status Test coverage

NPM module for concatenating files and generating source maps.

Usage example

var concat = new Concat(true, 'all.js', '\n');
concat.add(null, "// (c) John Doe");
concat.add('file1.js', file1Content);
concat.add('file2.js', file2Content, file2SourceMap);

var concatenatedContent = concat.content;
var sourceMapForContent = concat.sourceMap;

API

new Concat(generateSourceMap, outFileName, separator)

Initialize a new concat object.

Parameters:

  • generateSourceMap: whether or not to generate a source map (default: false)
  • outFileName: the file name/path of the output file (for the source map)
  • separator: the string that should separate files (default: no separator)
concat.add(fileName, content, sourceMap)

Add a file to the output file.

Parameters:

  • fileName: file name of the input file (can be null for content without a file reference, e.g. a license comment)
  • content: content (Buffer or string) of the input file
  • sourceMap: optional source map of the input file (string). Will be merged into the output source map.
concat.content

The resulting concatenated file content (Buffer).

concat.sourceMap

The resulting source map of the concatenated files (string).

Keywords

FAQs

Last updated on 02 May 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc