With no experience in any of the file watching APIs, little experience in the Native Abstractions for Node (NAN) API, and no clear understanding of how to model the interactions Node makes with each file watching utility, the 0.x.x NSFW releases were, umm, troubled. (RECORD SCRATCH) That’s right, Windows has the best native support. Windows: supports all targeted needs out of the box.MacOS: FSEvents is known to produce inconsistent file events (the file event bitmask becomes corrupted if events occur too quickly), so NSFW stats and disambiguates file change events for you.Linux: The Inotify file watching system does not perform recursive directory watching, so NSFW builds and maintains a recursive watch tree for you.NSFW fills in the gaps for each API so they’re all consistently feature-complete: Since NSFW’s watch utility is targeted specifically at each of those APIs, it means the experience of using the module is consistent across all three OSs. Linux, MacOS and Windows each ship with their own file watching APIs. This means NSFW doesn’t slow down JavaScript applications, even when they’re under the load of large FS operations. That callback can be throttled internally to prevent spamming the JavaScript/C++ bridge. NSFW queues file events on a separate thread and batches file change dispatches into a single callback. ![]() NSFW does most of its work on a separate thread, giving it big performance gains over the built-in Node file system (FS) watcher API. NSFW solves the poor file watching experience on Node by utilizing 3 low-level file watching utilities written in C++ and targeted for the Linux, MacOS, and Windows operating systems.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |