Skip to content
This repository has been archived by the owner on Apr 14, 2018. It is now read-only.

leipert/node-pathwatcher-without-runas

 
 

Repository files navigation

Path Watcher Node Module t a w

This package is a fork of pathwatcher. Some of our users experienced trouble installing pathwatcher because of runas (compare runas/#9, runas/#11 or markdown-preview-plus/#43).

Runas is just needed in a rather small edge case on macosx, if write files and the file is not accessible (compare here). We didn't write files with pathwatcher, so we removed the usage of runas in this package.

If you do not use pathwatcher with writing capabilities, feel free to use this package.

Installing

npm install pathwatcher-without-runas

Building

  • Clone the repository
  • Run npm install to install the dependencies
  • Run npm test to run the specs

Using

PathWatcher = require 'pathwatcher'

PathWatcher.watch(filename, [listener])

Watch for changes on filename, where filename is either a file or a directory. The returned object is a PathWatcher.

The listener callback gets two arguments (event, path). event is 'rename', 'delete' or 'change', and path is the path of the file which triggered the event.

For directories, the 'change' event is emitted when a file or directory under the watched directory got created or deleted. And the PathWatcher.watch is not recursive, so changes of subdirectories under the watched directory would not be detected.

PathWatcher.close()

Stop watching for changes on the given PathWatcher.

Packages

No packages published

Languages

  • CoffeeScript 71.1%
  • C++ 24.9%
  • Objective-C++ 2.2%
  • Python 1.5%
  • Shell 0.3%