Watch files and folders for changes

Usage no npm install needed!

<script type="module">
  import skivvySkivvyPackageWatch from 'https://cdn.skypack.dev/@skivvy/skivvy-package-watch';


Skivvy package: watch

npm version Stability Build Status

Watch files and folders for changes


skivvy install watch


This package allows you to watch files and folders for changes from within the Skivvy task runner.

Included tasks


Watch files and folders using chokidar, and run Skivvy tasks when files are changed.


skivvy run watch

Configuration settings:

Name Type Required Default Description
files string Array<string> Yes N/A Files and folders to watch (can contain globs)
task string object function Array<string,object,function> Yes N/A Skivvy task(s) to run when files are changed
debounce number No 0 Batch multiple changes that occur within debounce milliseconds of each other
events Array<string> No ["add", "change", "unlink"] Chokidar events to listen for
options object No null Chokidar options


  • The task configuration setting will be passed directly as the task option to Skivvy's api.run() method.

    This means that the following examples are all valid values for the task configuration setting:

    { "task": "my-local-task", "config": { "foo": "bar" } }
    { "task": "my-package::external-task", "config": { "foo": "bar" } }
        { "task": "my-local-task", "config": { "foo": "bar" } },
        { "task": "my-package::external-task", "config": { "foo": "bar" } }


Watcher Chokidar instance, returned from chokidar.watch