node-watch
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -143,10 +143,9 @@ /** | ||
// Due to the unstalbe fs.watch(), swtiches to watch its parent | ||
// directory when watching a single file, instead of watch it | ||
// directly. And then triggers the callback function whenever the | ||
// logged filename matches it. | ||
// Due to the unstalbe fs.watch(), if the `fpath` is a file then | ||
// switch to watch its parent directory instead of watch it directly. | ||
// Once the logged filename matches it then triggers the callback function. | ||
if (is.File(fpath)) { | ||
var parent = path.resolve(fpath, '..'); | ||
fs.watch(parent, function(err, fname) { | ||
if (path.basename(fpath) == fname) { | ||
if (path.basename(fpath) === fname) { | ||
normalizeCall(fpath, cb); | ||
@@ -170,2 +169,2 @@ } | ||
module.exports = watch; | ||
{ | ||
"name": "node-watch" | ||
, "version": "0.2.3" | ||
, "description": "NodeJS file.watch wrapper" | ||
, "version": "0.2.4" | ||
, "description": "fs.watch() wrapper of Nodejs " | ||
, "url": "https://github.com/yuanchuan/node-watch" | ||
@@ -6,0 +6,0 @@ , "author": "yuanchuan <yuanchuan23@gmail.com> (http://yuanchuan.name)" |
#Node-watch | ||
This program is part of Markab(an instant mockup tool, still under development). | ||
There are 3 problems when using the native fs.watch() function of Nodejs: | ||
The difference bewteen other nodewatch tools is that it does not differentiate event like "rename" or "delete". Once there is a change, the callback function will be triggered. | ||
1. It won't watch a directory recursively. | ||
2. When modifying a file inside a watched directory, the callback function will be triggered multiple times. | ||
3. when modifying a watched file with an editor like vim, the callback function will only be triggered one time and then it is unwatched. | ||
##Feature | ||
And this module is trying to solve those problems. | ||
*Recursively watch a directory* | ||
(In current version it does not differentiate event like "rename" or "delete". Once there is a change, the callback function will be triggered.) | ||
##Installation | ||
## Installation | ||
@@ -13,0 +15,0 @@ npm install node-watch |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6034
25
146