Socket
Book a DemoInstallSign in
Socket

config-watcher

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

config-watcher

A simple file watcher mainly for use with remote configuration

latest
npmnpm
Version
0.0.2
Version published
Weekly downloads
1
-99.86%
Maintainers
1
Weekly downloads
 
Created
Source

filewatcher

A simple file watcher mainly used with remote configuration

Overview

Allows you to watch a certain configuration file for changes. An event (file:change) is emitted on change that returns the file content and allows you to act on those changes. This is a great tool to use for configuration changes read in one docker container and listened to in another via a shared volume.

Install

npm install -S config-watcher

Use

const Watcher = require('config-watcher');

const watcher = new Watcher({ filePath: '...' });

watcher.on('file:change', file => {
  // do something
});

API

Init

new Watcher({ filePath: filePath }) - Watcher object

  • filePath: The file path to watch

Events

.on('file:change') - The event emitted on file change

  • returns file the file changes

FAQs

Package last updated on 02 Feb 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