Skip to content

Repository files navigation

base-watch NPM versionBuild Status

Watch plugin for base applications.

Install

Install with npm:

$ npm install base-watch --save

Heads up this plugin requires the [base-tasks][] plugin to be registered first.

Usage

varwatch=require('base-watch');varBase=require('base');varbase=newBase();base.use(watch());

If you're using assemble or assemble-core you can add the plugin like this:

assemble

varwatch=require('base-watch');varassemble=require('assemble');varapp=assemble();app.use(watch());

assemble-core

varwatch=require('base-watch');varassemble=require('assemble-core');varapp=assemble();app.use(watch());

API

If no task(s) or function is specified, only the instance of FSWatcher is returned and can be used directly. See chokidar.watch for more information.

  • returns{Function}: Returns the plugin function to be used in a [base][] application.

Example

app.use(watch());

Watch a file, directory, or glob pattern for changes and build a task or list of tasks when changes are made. Watch is powered by [chokidar][] so arguments can be anything supported by chokidar.watch.

Params

  • glob{String|Array}: Filename, Directory name, or glob pattern to watch
  • options{Object}: Additional options to be passed to [chokidar][]
  • tasks{String|Array|Function}: Tasks that are passed to .build when files in the glob are changed.
  • returns{Object}: Returns an instance of FSWatcher from [chokidar][]

Example

varwatcher=app.watch('templates/pages/*.hbs',['site']);

Related projects

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with [verb][]:

$ npm install verb && npm run docs

Or, if [verb][] is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Brian Woodward

License

verb © 2016, Brian Woodward. Released under the MIT license.


This file was generated by verb, v0.9.0, on April 06, 2016.

About

Watch plugin for base applications.

Resources

Stars

12 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages