0.1.2 • Published 9 years ago

@skivvy/skivvy-package-watch v0.1.2

Weekly downloads
2
License
ISC
Repository
-
Last release
9 years ago

Skivvy package: watch

npm version Stability Build Status

Watch files and folders for changes

Installation

skivvy install watch

Overview

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

Included tasks

watch

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

Usage:

skivvy run watch

Configuration settings:

NameTypeRequiredDefaultDescription
filesstring Array<string>YesN/AFiles and folders to watch (can contain globs)
taskstring object function Array<string,object,function>YesN/ASkivvy task(s) to run when files are changed
debouncenumberNo0Batch multiple changes that occur within debounce milliseconds of each other
eventsArray<string>No["add", "change", "unlink"]Chokidar events to listen for
optionsobjectNonullChokidar options

Notes:

  • 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:
    
    	```json
    	"my-local-task"
    	```
    
    	```json
    	"my-local-task:custom-target"
    	```
    
    	```json
    	"my-package::external-task"
    	```
    
    	```json
    	"my-package::external-task:custom-target"
    	```
    
    	```json
    	{ "task": "my-local-task", "config": { "foo": "bar" } }
    	```
    
    	```json
    	{ "task": "my-package::external-task", "config": { "foo": "bar" } }
    	```
    
    	```json
    	[
    		"my-local-task",
    		"my-package::external-task:custom-target",
    		{ "task": "my-local-task", "config": { "foo": "bar" } },
    		{ "task": "my-package::external-task", "config": { "foo": "bar" } }
    	]
    	```

Returns:

Watcher Chokidar instance, returned from chokidar.watch