concat-with-sourcemaps
    Overview
    Documentation
    Insights
    Code
    Contributors
    Dependencies
    Alternatives

concat-with-sourcemaps

Concatenate file contents with a custom separator and generate a source map

1.1.0  •  Published 2 years ago  •  by Florian Reiterer  •  ISC License

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

How do you feel about the name Devstore for this site?

Popularity

Weekly Downloads
568.6K
Stars
51

Maintenance

Development

Last ver 2 years ago
Created 5 years ago
Last commit 2 years ago
2 months between commits

Technology

Node version: 10.0.0
8.2K unpacked

Compliance

ISC License
OSI Approved
0 vulnerabilities

Contributors

5 contributors
Florian Reiterer
Maintainer, 21 commits, 4 merges
Florian Reiterer
5 commits
Ryan Petrich
2 commits, 1 PRs
Scott Weinstein
1 commits, 1 PRs
Waldir Pimenta
1 commits, 1 PRs
Works at uphold
Jérémy Lal
1 commits, 1 PRs
Works at EDA SARL

Tags

concat
source map
Ready for the next level?
Join Devstore's founding team to help us build the ultimate open-source app store, work with the latest technologies, and enjoy great culture, impact and autonomy
© 2019 Devstore, Inc.
Devstore helps developers find and use open-source packages, so they can focus on building amazing things