From d627fc2b51d236e814f7f0aabd279857ce967e8d Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Thu, 27 Oct 2016 20:49:21 +0300 Subject: [PATCH 1/4] docs: clarify eventType in fs.watch 'rename' is confusing, and it's not clear what "they" refers to. Fixes: https://github.com/nodejs/node/issues/9082 --- doc/api/fs.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index a9e1e3fd4bd1a6..6d15d5a9b98c94 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1702,8 +1702,11 @@ The listener callback gets two arguments `(eventType, filename)`. `eventType` i `'rename'` or `'change'`, and `filename` is the name of the file which triggered the event. -Please note the listener callback is attached to the `'change'` event -fired by [`fs.FSWatcher`][], but they are not the same thing. +Note that `'rename'` is also emitted when a file is deleted or added - in other words, +it's emitted whenever a filename appears or disappears in the directory. + +Also note the listener callback is attached to the `'change'` event fired by +[`fs.FSWatcher`][], but it's not the same thing as the `'change'` value of `eventType`. ### Caveats From 7591c5737781da5cbe54e367c8545d04472d9ebb Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Fri, 28 Oct 2016 15:26:36 +0300 Subject: [PATCH 2/4] nits --- doc/api/fs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 6d15d5a9b98c94..94ebae770994af 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1702,11 +1702,11 @@ The listener callback gets two arguments `(eventType, filename)`. `eventType` i `'rename'` or `'change'`, and `filename` is the name of the file which triggered the event. -Note that `'rename'` is also emitted when a file is deleted or added - in other words, -it's emitted whenever a filename appears or disappears in the directory. +Note that on most platforms, `'rename'` is also emitted when a file is deleted or added. +In other words, it is emitted whenever a filename appears or disappears in the directory. Also note the listener callback is attached to the `'change'` event fired by -[`fs.FSWatcher`][], but it's not the same thing as the `'change'` value of `eventType`. +[`fs.FSWatcher`][], but it is not the same thing as the `'change'` value of `eventType`. ### Caveats From 54cd5ec9e4521063e37c16e07fce9b5e893804d3 Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Sat, 29 Oct 2016 18:18:11 +0300 Subject: [PATCH 3/4] more nits --- doc/api/fs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 94ebae770994af..b135633e960952 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1702,8 +1702,8 @@ The listener callback gets two arguments `(eventType, filename)`. `eventType` i `'rename'` or `'change'`, and `filename` is the name of the file which triggered the event. -Note that on most platforms, `'rename'` is also emitted when a file is deleted or added. -In other words, it is emitted whenever a filename appears or disappears in the directory. +Note that on most platforms, `'rename'` is emitted whenever a filename appears +or disappears in the directory. Also note the listener callback is attached to the `'change'` event fired by [`fs.FSWatcher`][], but it is not the same thing as the `'change'` value of `eventType`. From 6a88f95733a1ffa400f9d56d10b9d1cd13bd0ce8 Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Mon, 31 Oct 2016 21:32:13 +0200 Subject: [PATCH 4/4] hopefully last nit --- doc/api/fs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index b135633e960952..c2c6e9c02c6ea4 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1706,7 +1706,8 @@ Note that on most platforms, `'rename'` is emitted whenever a filename appears or disappears in the directory. Also note the listener callback is attached to the `'change'` event fired by -[`fs.FSWatcher`][], but it is not the same thing as the `'change'` value of `eventType`. +[`fs.FSWatcher`][], but it is not the same thing as the `'change'` value of +`eventType`. ### Caveats