@hiverra/fstrace
v1.0.0
Published
A lightweight file system watcher for files and folders.
Downloads
139
Readme
fstrace
A lightweight file system watcher for files and folders.
Installation
git clone https://github.com/Spectra010s/fstrace.git
cd fstrace
cargo build --releaseThen move the binary to your PATH:
cp target/release/fstrace $PREFIX/bin/fstraceUsage
fstrace <path> [options]Watch a file:
fstrace file.txtWatch a folder:
fstrace ./myprojectJSON output (for programmatic use):
fstrace ./myproject --jsonEvents
| Event | Description |
|------------|--------------------------|
| created | A file was created |
| modified | A file was modified |
| deleted | A file was deleted |
JSON Output
When using --json, each event is printed as a single line of JSON:
{"event":"modified","path":"/home/user/project/index.js","timestamp":1744392000}Useful for consuming events in other tools or scripts:
import { spawn } from "child_process";
const proc = spawn("fstrace", ["./project", "--json"]);
proc.stdout.on("data", (data) => {
const event = JSON.parse(data);
console.log(event.event, event.path);
});Options
| Flag | Description |
|------------------|-------------------|
| --json | Output as JSON |
| -v, --version | Show version |
| -h, --help | Show help |
License
MIT — see the LICENSE file for details.
Written by Spectra010s
