Socket
Socket
Sign inDemoInstall

node-watch

Package Overview
Dependencies
0
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-watch

fs.watch() wrapper of Nodejs


Version published
Weekly downloads
458K
increased by2.1%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

#Node-watch

This module will watch a directory recursively by default while trying to solve several problems caused by the native fs.watch():

  1. When modifying a file inside a watched directory, the callback function will be triggered multiple times;
  2. when modifying a watched file with an editor like vim, the callback function will only be triggered one time and then it is unwatched.

In current version it does not differentiate event like "rename" or "delete". Once there is a change, the callback function will be triggered.

Installation

npm install node-watch

Example

var watch = require('node-watch');

watch('somedir_or_somefile', function(filename) {
  console.log(filename, ' changed.');
});

Keywords

FAQs

Last updated on 26 Feb 2013

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc