Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

frock-core-watcher

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frock-core-watcher

A file-watching reload core plugin for frock.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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.

Keywords

frock

FAQs

Package last updated on 28 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts