Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-file

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-file

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

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20K
decreased by-1.58%
Maintainers
3
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 02 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc