New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

gulp-wait2

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-wait2

A gulp task that inserts a delay (time or callback-based) before calling the next function in a chain. (Forked from bpartridge/gulp-wait)

latest
Source
npmnpm
Version
0.0.5
Version published
Weekly downloads
120
-16.08%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-wait

A gulp task that inserts a delay before calling the next function in a chain.

Example

Time based delay

Waits a specified number of milliseconds before executing the next item in the chain.


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

  gulp.task('wait', function() {
    gulp.src('yourfile.js')
        .pipe(wait(1500))
        .pipe(gulp.dest('destfile.js'));
  });

Callback based delay

Waits for a callback to be truthy before executing the next item in the chain.


  var wait = require('gulp-wait');
  var fs = require('fs');

  function doesFileExist(filePath) {
    try {
      fs.accessSync(filePath);
      return true;
    } catch () {
      return false;
    }
  }

  gulp.task('wait', function() {
    gulp.src('yourfile.js')
        .pipe(wait(doesFileExist('../path/to/some/file.js')))
        .pipe(gulp.dest('destfile.js'));
  });

Using an options object

You can pass in an options object as well.


const options = {
  time: 100, // same as wait(100)
  callback: () => true, // same as wait(() => true) - defaults to callback if both time and callback are passed
  before: () => {},
  after: () => {}
};

gulp.task('wait', function() {
  gulp.src('yourfile.js')
      .pipe(wait(options))
      .pipe(gulp.dest('destfile.js'));
});

Keywords

gulp

FAQs

Package last updated on 17 Jun 2016

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