frock-core-watcher

1.0.0 • Public • Published

frock-core-watcher

A file-watching reload core plugin for frock.

Build Status npm install js-standard-style

Quick-Start Example

The plugin can watch a list of files or directories, and reload frock when changes are detected in any of them. To get started, add it to your project's package.json:

{
  "name": "frock-reload-test-project",
  "version": "0.0.0",
  "dependencies": {
    "frock": "^2.0.0",
    "frock-core-watcher": "^1.0.0"
  },
  "frock": {
    "cores": [
      {
        "handler": "frock-core-watcher",
        "options": {
          "watch": ["./mocks/**/*.js"],
          "chokidarOptions": {
            "usePolling": true
          },
          "watchFrockfile": true
        }
      }
    ]
  }
}

Then use frock as normal. It will reload based on your list of watched files.

Reloading on Config File changes

You may wish to have frock reload its configuration when a file changes. This is accomplished in the above example; if you pass the option watchFrockfile the loaded frockfile will be added to the watchlist, and config will be reloaded when it changes.

Watch Options

frock-core-watcher uses chokidar for file watching; you may pass any options straight through to chokidar with the chokidarOptions key.

Testing

From the project directory:

$ npm test

License

Apache 2.0, see LICENSE for details.

Readme

Keywords

Package Sidebar

Install

npm i frock-core-watcher

Weekly Downloads

4

Version

1.0.0

License

Apache-2.0

Unpacked Size

7.05 kB

Total Files

7

Last publish

Collaborators

  • fardog