0.1.0-alpha.7 • Published 4 years ago

@webscaffold/task-watcher v0.1.0-alpha.7

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

@web-scaffold/task-watcher

WEB Scaffold task for file changes watching.

Install

$ npm install --save-dev @webscaffold/task-watcher

Usage

const watcher = require('@webscaffold/task-watcher');

await watcher(filesGlob, options, taskFn);

This will run Webpack based on the config passed.

API

watcher(filesGlob, options, taskFn)

Returns a Promise with an istance of the watcher class.

filesGlob

Type: Array|string

Glob string or aray of globs of all files to watch.

options

Type: object

Options object that can be passed.

taskName

Type: string Default: watcher

Task name that will be used by the logger to namespace the logs.

taskColor

Type: string Default: #88d498

The color used by the logger to log to the console the task output.

label

Type: string Default: ''

The watcher label namespace used for logging purposes.

taskFn

Type: Function Default: undefined

Task function to call on changes.

Licensing

MIT © Radu Micu