gulp-concat-filenames

WebJar for gulp-concat-filenames

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

gulp-concat-filenames
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

gulp-concat-filenames
WebJar for gulp-concat-filenames
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/the-simian/gulp-concat-filenames

Download gulp-concat-filenames

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : gulp-util jar [3,4)
org.webjars.npm : through jar [2,3)

Project Modules

There are no modules declared in this project.

Information

Package gulp-concat-filenames
Description Similar to concat, but creates a list of names in the output file, rather than contents being merged.
Node Version >= 0.10

Build Status Coverage Status Code Climate Codeship Status for the-simian/gulp-concat-filenames Dependency Status Reference Status


gulp-concat-filenames

Usage

Basic Usage, No options.

var concatFilenames = require('gulp-concat-filenames');

var concatFilenamesOptions = {

};

function fileManifest(){
  gulp
      .src('./lib/**/*.*')
      .pipe(concatFilenames('manifest.txt', concatFilenamesOptions))
      .pipe(gulp.dest('./output/'));
}


gulp.task('file-manifest', fileManifest);

###Arguments

Gulp concat-filenames takes 2 arguments: filename and options

####Filename [Required]

This first argument is the name of the output file the list of filenames will be put into.

#####Options [Optional]

The second argument is optional (pun intended), and is an object with the following properties:

  • newline - The character to use in place of \n for a newline. The default value will be \n
  • prepend - Some text to prepend to every entry in the list of filenames
  • append - Some text to append to every intry in the list of filenames
  • template - a function that takes one parameter (the file name) and returns the string after some formatting. Can be used in addition to, or instead of, append and prepend
  • root - the root folder. Including this argument will return a list of relative paths instead of absolute paths.

###Examples

Given the file structure:

.
+-- somefile.txt
+-- lib
|   +-- one.txt
|   +-- two.txt
+-- gulpfile.js

var concatFilenames = require('gulp-concat-filenames');

var concatFilenamesOptions = {
    root: '/lib',
    prepend: '==> ',
    append: ' <=='
};

function fileManifest(){
  gulp
      .src('./lib/**/*.*')
      .pipe(concatFilenames('manifest.txt', concatFilenamesOptions))
      .pipe(gulp.dest('./output/'));
}


gulp.task('file-manifest', fileManifest);

running gulp file-manifest now produces a file called manifest.txt with the contents

==> one.txt <==
==> two.txt <==

Or you can use the template property, to format the output as well.

function fileNameFormatter(filename) {
   return 'XXX--' + filename.toUpperCase() + '--YYY';
}

var concatFilenames = require('gulp-concat-filenames');

var concatFilenamesOptions = {
    root: '/lib',
    template: fileNameFormatter // Pass in a function
};

function fileManifest(){
  gulp
      .src('./lib/**/*.*')
      .pipe(concatFilenames('manifest.txt', concatFilenamesOptions))
      .pipe(gulp.dest('./output/'));
}


gulp.task('file-manifest', fileManifest);

running gulp file-manifest now produces a file called manifest.txt with the contents

XXX--ONE.TXT--YYY
XXX--TWO.TXT--YYY

###Contribution If you write tests, follow semver and have something to add, I love accepting pull requests!! Any questions? Make an issue on github! <3

Versions

Version
1.2.0