JSPM

recursive-watch

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 36056
  • Score
    100M100P100Q141809F
  • License MIT

Minimal recursive file watcher

Package Exports

  • recursive-watch

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (recursive-watch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

recursive-watch

Minimal recursive file watcher.

Uses the native recursive fs.watch option on macOS/Windows and basic recursive dir watching on Linux

npm install recursive-watch

Usage

var watch = require('recursive-watch')

watch('./a-file-or-directory', function (filename) {
  console.log('something changed with', filename)
})

API

var unwatch = watch(path, onchange)

Watch a directory or filename. Calls the onchange function if the path changed in anyway. Call the unwatch function to stop watching the path.

License

MIT