1.1.8 • Published 6 years ago

cypper-gulp-watcher v1.1.8

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

cypper-gulp-watcher

Similar to gulp-watcher, but fixed some bugs.

Watcher for gulp with pause and pauseWhen functions (for streams). Based on gulp.watch.

Install

npm install cypper-gulp-watcher --save-dev

Example

const gulp = require('gulp');
const uglify = require('gulp-uglifyjs');
const watcher = require('cypper-gulp-watcher');

// use like that
gulp.task('uglify', function () {
  watcher.pause('uglify');

  gulp.src(['public/js/**/*.js'])
  .pipe(uglify())
  .on('end', function () {
    watcher.start('uglify');
  })
})

// or like that
gulp.task('uglify', function () {
  gulp.src(['public/js/main.js'])
  .pipe(uglify())
  .pipe(watcher.pauseWhen('global',gulp.dest("public/js")))
})

gulp.task('watch', function () {
    watcher
        .create('uglify', ['public/js/**/*.js'], ['uglify'])
        .start('uglify');
})

Api

.create(name, ...gulp.watch args)

Init a watcher (then you need to start it)

.start(name)

Start a watcher

.pause(name)

Set a pause

.stop(name)

Stop a watcher and clear them

.pauseWhen(name,streamTransform)

Pause a watcher on a stream

.pauseWhenIf(name,streamTransform,run)

Same as pauseWhen, but stream only executes when run is true

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago