Filename gathering plugin for gulp
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
Namespace the filenames. Do not use the name "all" which is reserved by gulp-filenames to retrieve all namespaces.
override previous files when a new one passes through
Get only these filenames ("all" to get everything)
"relative" or "full" or "base" for an array of filenames
"all" for an array of objects
Forget the filenames stored in namespace "name" ("all" to forget all files). gulp-filenames does not clear a namespace between runs by design.