Skip to content

alexandremasy/gulp-output

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-output NPM version Build Status Dependency Status

The gulp plugin which output filenames.

This gulp plugins discover the files in the given path, and output them in the way you define.

Installation

npm install gulp-output --save-dev

Usage

var output = require('gulp-output');

gulp.src( 'httpdocs/libs/**/*.js' )
    .pipe( output({
    	destination: 'template/libs.html',
    	root:__dirname+'/httpdocs/'
   	}) );

You also have the possibility to provile multiple path at one:

var output = require('gulp-output');

gulp.src( ['httpdocs/libs/**/*.js', 'httpdocs/otherlibs/*.js'] )
    .pipe( output({
    	destination: 'template/libs.html',
    	root:__dirname+'/httpdocs/'
   	}) );

Usage

<stream> output(<options>);

Options

destination String

Where to output the result of the process

formator Function

This function will be called for each file found in the stream. The default formator will output the path of each file on a separate line. If you want to provide a custom output, define your own formator. The function will be called with the following parameters:

  • path String Path to the file
  • filename String Filename
  • extension String Extension of the file

Example to ouput for jade

function jadeFormator( path, filename, extension )
{
	return 'script(src="'+path+'")\n';
}

root String

All the retrieved file will have the full os path, this is often not convenient. By defining the root parameter, this root will be removed automatically from all the path. By default the root is equal to the directory of the gulpfile.js.

About

Gulp output

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published