# cypper-gulp-watcher

> Similar to gulp-watcher, but fixed some bugs. Watcher for gulp with a pause function. Based on gulp.watch

Latest version **1.1.8** (published 2018-04-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install cypper-gulp-watcher
pnpm add cypper-gulp-watcher
yarn add cypper-gulp-watcher
bun add cypper-gulp-watcher
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.8 |
| Published | 2018-04-03 |
| First published | 2018-03-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | cypper |
| Maintainers | cypper |
| Keywords | gulp, watcher, cypper, gulp-watcher |

## Links

- npm: https://www.npmjs.com/package/cypper-gulp-watcher
- Repository: https://github.com/cypper/cypper-gulp-watcher
- Homepage: https://github.com/cypper/cypper-gulp-watcher#readme
- Issues: https://github.com/cypper/cypper-gulp-watcher/issues
- npm.io page: https://npm.io/package/cypper-gulp-watcher

## Dependencies (3)

- [gulp](https://npm.io/package/gulp.md) ^3.9.1
- [through2](https://npm.io/package/through2.md) ^2.0.3
- [stream-combiner](https://npm.io/package/stream-combiner.md) ^0.2.2

## Recent versions

- 1.1.8 (latest) — 2018-04-03
- 1.1.7 — 2018-04-03
- 1.1.6 — 2018-03-21
- 1.1.5 — 2018-03-20
- 1.0.5 — 2018-03-20
- 1.0.4 — 2018-03-20
- 1.0.3 — 2018-03-20
- 1.0.2 — 2018-03-20
- 1.0.1 — 2018-03-20
- 1.0.0 — 2018-03-20
- 0.0.1 — 2018-03-20

## README

# 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
```js
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

---
_Source: https://npm.io/package/cypper-gulp-watcher · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
