concat-with-sourcemaps

1.1.0last stable release 7 years ago
Complexity Score
Low
Open Issues
8
Dependent Projects
229
Weekly Downloadsglobal
1,433,575

License

  • ISC
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

Concat with source maps

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

Dependencies

CVE IssuesActive
0
Scorecards Score
3.20
Test Coverage
99.00%
Follows Semver
Yes
Github Stars
67
Dependenciestotal
6
DependenciesOutdated
3
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute concat-with-sourcemaps in your own private NPM registry

npm config set registry  https://npm.cloudsmith.com/owner/repo
Processing...
Done
npm install concat-with-sourcemaps
Processing...
Done

16 Releases

NPM on Cloudsmith

Getting started with NPM on Cloudsmith is fast and easy.