Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Wait, wait, how's it different from fs.watch
? Unlike fs.watch
, fsmonitor:
fs.watch
only monitors a single folder)Here's what happens when you call fsmonitor.watch(path)
:
fs.watch
is called to start monitoring every subfolder encountered.fs.watch
is called for the new subfolders, and the watchers are shut down for the removed ones.Alpha stage. Seems to work, waiting for feedback, shipping as part of LiveReload 0.5 for Windows.
Planned features:
npm install fsmonitor
or, to use fsmonitor command-line tool (see below):
npm install -g fsmonitor
fsmonitor = require('fsmonitor');
fsmonitor.watch('/some/folder', ['*.js'], function(change) {
console.log("Change detected:\n" + change); # has a nice toString
console.log("Added files: %j", change.addedFiles);
console.log("Modified files: %j", change.modifiedFiles);
console.log("Removed files: %j", change.removedFiles);
console.log("Added folders: %j", change.addedFolders);
console.log("Modified folders: %j", change.modifiedFolders);
console.log("Removed folders: %j", change.removedFolders);
});
Includes a command-line tool that can report changes and/or run a specified command on every change.
For example, to invoke npm test
when any JavaScript file is modified:
fsmonitor -s -p '+*.js' npm test
Usage:
Usage: fsmonitor [-d <folder>] [-p] [-s] [-q] [<mask>]... [<command> <arg>...]
Options:
-d <folder> Specify the folder to monitor (defaults to the current folder)
-p Print changes to console (default if no command specified)
-s Run the provided command once on start up
-q Quiet mode (don't print the initial banner)
Masks:
+<mask> Include only the files matching the given mask
!<mask> Exclude files matching the given mask
If no inclusion masks are provided, all files not explicitly excluded will be included.
General options:
--help Display this message
--version Display fsmonitor version number
FAQs
Fine-grained cross-platform file system monitoring for Node.js
We found that fsmonitor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.