Skip to content

Create vinyl files from a string or buffer and insert into the Gulp pipeline.

Notifications You must be signed in to change notification settings

geminiyellow/gulp-file

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-file

Build Status NPM version

Create vinyl files from a string or buffer and insert into the Gulp pipeline.

Installation

npm install gulp-file

API

plugin(name, source, options)

Creates a vinyl file with the given name from source string or buffer and returns a transform stream for use in your gulp pipeline.

Example

Primus outputs the client library as a string. Using gulp-file we can create a vinyl file from the string and insert it into the gulp pipeline:

var gulp = require('gulp')
  , file = require('gulp-file');

gulp.task('js', function() {
  var str = primus.library();

  return gulp.src('scripts/**.js')
    .pipe(file('primus.js', str))
    .pipe(gulp.dest('dist'));
});

Use it at the beginning of your pipeline by setting src: true:

var gulp = require('gulp')
  , file = require('gulp-file');

gulp.task('js', function() {
  var str = primus.library();

  return file('primus.js', str, { src: true }).pipe(gulp.dest('dist'));
});

Options

src

Calls stream.end() to be used at the beginning of your pipeline in place of gulp.src(). Default: false.

BSD Licensed

About

Create vinyl files from a string or buffer and insert into the Gulp pipeline.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%