Skip to content

Simple gulp plugin that creates a JSON file containing the relative filenames of all piped files as an array.

License

Notifications You must be signed in to change notification settings

tiernan/gulp-filenames-to-json

 
 

Repository files navigation

gulp-filenames-to-json Build Status

Simple gulp plugin that creates a JSON file containing the relative filenames of all piped files as an array.

Install

$ npm install --save-dev gulp-filenames-to-json

Usage

var gulp = require('gulp');
var filenamesToJson = require('gulp-filenames-to-json');

gulp.task('default', function () {
	return gulp.src('./js/**/*.js')
		.pipe(filenamesToJson())
		.pipe(gulp.dest('.'));
    
    // --> 
    // creates a file "./files.json" with the following contents:
    // ["js/fileA.js","js/fileB.js"]
});

For a full sample see gulp-filenames-to-json-sample.

API

filenamesToJson(options)

options

fileName

Type: string
Default: files.json

The file name of the generated JSON document.

base

Type: string
Default: ``

String to remove from left side of filename. e.g. providing dist to a match of dist/file would return /file.

ignore

Type: string or Array
Default: ``

Filter regex string or array of regex strings. If a filename matches, it will be ignored.

License

MIT © Oliver Lohmann

About

Simple gulp plugin that creates a JSON file containing the relative filenames of all piped files as an array.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%