3.0.4 • Published 4 years ago

gulp-sane-watch v3.0.4

Weekly downloads
671
License
MIT
Repository
github
Last release
4 years ago

gulp-sane-watch NPM version Build Status Dependency Status

Version: 3.0.4

Installation

Run npm install gulp-sane-watch

Usage

const gulp = require('gulp');
const saneWatch = require('gulp-sane-watch');

gulp.task('watch', () => {
    saneWatch('css/**/*.css', () => {
        gulp.start('styles');
    });
});
const gulp = require('gulp');
const saneWatch = require('gulp-sane-watch');

gulp.task('watch', () => {
    saneWatch('css/**/*.css', { debounce: 300 }, () => {
        gulp.start('styles');
    });
});
const gulp = require('gulp');
const saneWatch = require('gulp-sane-watch');

gulp.task('watch', () => {
    saneWatch('css/**/*.css', {
        events: ['onChange', 'onAdd']
    }, () => {
        gulp.start('styles');
    });
});
const gulp = require('gulp');
const saneWatch = require('gulp-sane-watch');

gulp.task('watch', () => {
    saneWatch('css/**/*.css', {
        debounce: 300,
        onChange: () => {
            gulp.start('change');
        },
        onAdd: () => {
            gulp.start('add');
        },
        onDelete: () => {
            gulp.start('delete');
        }
    });
});
const gulp = require('gulp');
const saneWatch = require('gulp-sane-watch');

gulp.task('watch', () => {
    saneWatch('css/**/*.css', {
        saneOptions: {
            poll: true
        }
    }, () => {
        gulp.start('styles');
    });
});

API

saneWatch(glob, options, callback)

glob

  • Type: String | Array

Creates watcher that will spy on files that were matched by glob which can be a node-glob string or array of strings.

options

saneOptions

This object is passed to sane options directly (refer to sane documentation).

debounce
  • Type: Integer
  • Unit: milliseconds
  • Default: 0
verbose
  • Type: Boolean
  • Default: true
onChange, onAdd, onDelete, onReady
  • Type: function(filename, path, stat)

This function is called, when some group of events is happens on file-system.

onDelete function parameter list does not include stat parameter.

onReady function parameter list does not include any parameter.

events
  • Type: Array
  • Default: ['onChange', 'onAdd', 'onDelete']

List of events, that should be watched by gulp-sane-watch. Contains event names from sane.

callback

  • Type: function(filename, path, stat)

This function is called, when some group of events is happens on file-system.

License

MIT © 2021 Gergely Kovács (gg.kovacs@gmail.com)

3.0.4

4 years ago

3.0.3

5 years ago

3.0.2

6 years ago

3.0.0

6 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago