/gulp-filenames

Filename gathering plugin for gulp

Primary LanguageCoffeeScriptMIT LicenseMIT

gulp-filenames

NPM version Build Status Coverage Status Dependency Status

Filename gathering plugin for gulp

Usage

First, install gulp-filenames as a development dependency:

npm install --save-dev gulp-filenames

Then, add it to your gulpfile.js:

var filenames = require("gulp-filenames");

gulp.src("./src/*.coffee")
	.pipe(filenames("coffeescript"))
	.pipe(gulp.dest("./dist"));

gulp.src("./src/*.js")
  .pipe(filenames("javascript"))
  .pipe(gulp.dest("./dist"));

filenames.get("coffeescript") // ["a.coffee","b.coffee"]
                              // Do Something With it

API

filenames([name], [options])

name

Namespace the filenames. Do not use the name "all" which is reserved by gulp-filenames to retrieve all namespaces.

options

overrideMode (default: false)

override previous files when a new one passes through

filenames.get([name], [what])

name

Get only these filenames ("all" to get everything)

what

"relative" or "full" or "base" for an array of filenames

"all" for an array of objects

filenames.forget(name)

name

Forget the filenames stored in namespace "name" ("all" to forget all files). gulp-filenames does not clear a namespace between runs by design.

License

MIT License