Skip to content

Watch Directory

Watch a directory for changes

ts
import { Fs } from '@vaguevoid/tools'

const unwatch = Fs.watchDirectory('src', (event, path) => {
  console.log(event, path)
})

// unwatch the directory and garbage collect the watcher
// unwatch()