simple-watcher
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -54,3 +54,3 @@ 'use strict' | ||
options.ledger.add(dir) | ||
watchDir(dir, { shallow: true }, (entityPath) => { | ||
watchDir(dir, { shallow: true, tolerance: options.tolerance }, (entityPath) => { | ||
fs.stat(entityPath, (err, stat) => { | ||
@@ -79,3 +79,3 @@ if (err) { // Entity was deleted. | ||
const callback = arg2 || arg1 | ||
const options = arg2 ? arg1 : { toleance: TOLERANCE } | ||
const options = arg2 ? arg1 : { tolerance: TOLERANCE } | ||
options.tolerance = process.platform === 'win32' ? (options.tolerance || TOLERANCE) : 0 // Disable tolerance if not on Windows. | ||
@@ -82,0 +82,0 @@ options.fallback = options.fallback || !PLATFORMS.includes(process.platform) |
{ | ||
"name": "simple-watcher", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "\"A simple directory watcher.\"", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,3 @@ # Simple Watcher | ||
// No frills deep watching over a directory. | ||
// Watch over file or directory: | ||
watch('/path/to/foo', filePath => { | ||
@@ -35,6 +35,11 @@ console.log(`Changed: ${filePath}`) | ||
// Shallow watching over multiple directories. | ||
watch(['/path/to/foo', '/path/to/bar'], {shallow: true}, filePath => { | ||
// Watch over multiple paths: | ||
watch(['/path/to/foo', '/path/to/bar'], filePath => { | ||
console.log(`Changed: ${filePath}`) | ||
}) | ||
// Shallow watch: | ||
watch(['/path/to/foo', '/path/to/bar'], { shallow: true }, filePath => { | ||
console.log(`Changed: ${filePath}`) | ||
}) | ||
``` | ||
@@ -41,0 +46,0 @@ |
7182
48