79558053

Date: 2025-04-06 10:10:15
Score: 0.5
Natty:
Report link

If you need more customization, there is a guide here: https://bun.sh/guides/read-file/watch

For example:

import { watch } from "fs";

const watcher = watch(import.meta.dir, (event, filename) => {
  console.log(`Detected ${event} in ${filename}`);
});

process.on("SIGINT", () => {
  // close watcher when Ctrl-C is pressed
  console.log("Closing watcher...");
  watcher.close();

  process.exit(0);
});
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
Posted by: han4wluc