concat-with-sourcemaps

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

important fix in v1.0.6
Last updated 10 years ago by floridoo .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install concat-with-sourcemaps 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.1.0                                ...           latest (7 years ago)

16 Versions

  • 1.1.0                                ...           7 years ago
  • 1.0.7                                ...           7 years ago
  • 1.0.6                                ...           7 years ago
  • 1.0.5 [deprecated]           ...           7 years ago
  • 1.0.4 [deprecated]           ...           9 years ago
  • 1.0.3 [deprecated]           ...           9 years ago
  • 1.0.2 [deprecated]           ...           10 years ago
  • 1.0.1 [deprecated]           ...           10 years ago
  • 1.0.0 [deprecated]           ...           10 years ago
  • 0.1.6 [deprecated]           ...           10 years ago
  • 0.1.5 [deprecated]           ...           10 years ago
  • 0.1.4 [deprecated]           ...           10 years ago
  • 0.1.3 [deprecated]           ...           10 years ago
  • 0.1.2 [deprecated]           ...           10 years ago
  • 0.1.1 [deprecated]           ...           10 years ago
  • 0.1.0 [deprecated]           ...           10 years ago
Maintainers (1)
Downloads
Total 11
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (6)

© 2010 - cnpmjs.org x YWFE | Home | YWFE