0.4.0 • Published 6 years ago

gulp-file v0.4.0

Weekly downloads
35,356
License
BSD
Repository
github
Last release
6 years ago

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.

plugin(sourceArray, options)

Creates vinyl files for each entry in the array. Each entry is an object with a name and source property. A vinyl file is created with the given name and source and inserted into the returned transform stream.

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

@gulppress/setupbinary-mock-websocket@infinitebrahmanuniverse/nolb-gulp-f@everything-registry/sub-chunk-1806skylor.min-adminrgui-toolssrc-gensrpcdsrpcdcstream-render-pipelineedm-supergulpgulp-mocha-tddenigma-static-buildecma6_boilerplateelement-theme-jsem-project-builderem-project-devds-buildds-packflarum-gulpfengdie-clijson-previewlaravel-elixir-systemlaravel-elixir-bower-filesmango-climetalpipemarketplace-gulpmirotonegp-boilerplate-environmentgoldfish-compilergulp-build-bitrix-modulgulp-build-bitrix-modulegulp-banners-jsongulp-bitrix-module-buildgulp-changeloggulp-changelog-releasegulp-config-transformgulp-corelegacy-gulp-processgulp-slurpgulp-task-js-manifestgulp-web-buildgulp-object-file-nimedevgulp-shenanigansgulp-dnn-manifestgulpfile.jsgulpsigulp-lazy-minifygrommet-toolboxpancakes-syrupnoobgallerytosfind-gulp@gulppress/scriptscsstime-gulp-tasks@gilt-tech/swig-specdesign-system-framework@jspsych/configubt-gulpymb@justeat/gulp-build-fozzie@pointsource/blueoak-build@progress/kendo-vue-tasks@progress/kendo-react-tasks@mimamuh/gulp-tasks@kukjevov/gulp-git-version@panacea/holon-cli@salesforce-ux/design-system-compiler@salespreso/deck-gulp-tasks@srpc/cli@firma-de/gulp-packageangular-gulp-starter-api@everymatrix/ubo-project-dev@sunriseweb/symfony-gulpactlessK_Tasksastore-gulp@appirio/salesforcearabarcane-gulpblueoak-build@catalyst-elements/build-process@cobalt-engine/slush-cobalt@cobalt-engine/updaterbasis-buildbasebuild-componentchappechappe-espcb-gulp-tasks@digilabscz/digikit@digilabscz/digikit-schoolcreate-react-webcreate-react-web-test
0.4.0

6 years ago

0.3.0

8 years ago

0.2.0

9 years ago

0.1.0

10 years ago