concat-with-sourcemaps

WebJar for concat-with-sourcemaps

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

concat-with-sourcemaps
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

concat-with-sourcemaps
WebJar for concat-with-sourcemaps
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/floridoo/concat-with-sourcemaps

Download concat-with-sourcemaps

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/concat-with-sourcemaps/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>concat-with-sourcemaps</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/concat-with-sourcemaps/
implementation 'org.webjars.npm:concat-with-sourcemaps:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/concat-with-sourcemaps/
implementation ("org.webjars.npm:concat-with-sourcemaps:1.1.0")
'org.webjars.npm:concat-with-sourcemaps:jar:1.1.0'
<dependency org="org.webjars.npm" name="concat-with-sourcemaps" rev="1.1.0">
  <artifact name="concat-with-sourcemaps" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='concat-with-sourcemaps', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "concat-with-sourcemaps" % "1.1.0"
[org.webjars.npm/concat-with-sourcemaps "1.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : source-map jar [0.6.1,0.7)

Project Modules

There are no modules declared in this project.

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).

Versions

Version
1.1.0
1.0.5