A pure deno file watcher.
Branch: master
Clone or download
Latest commit c96add8 Jan 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test fix path's url Jan 15, 2019
.travis.yml move test files Jan 8, 2019
LICENSE Create LICENSE Jan 3, 2019
README.md add appveyor badge Jan 11, 2019
appveyor.yml add appveyor.yml Jan 11, 2019
mod.ts define Detector class to enable incremental detection Jan 11, 2019
tsconfig.json migrate from playground Jan 3, 2019

README.md

Watch

Build Status Build status

A pure deno file watcher.

Example

import watch from "https://deno.land/x/watch@1.1.0/mod.ts";

for await (const changes of watch("src")) {
  console.log(changes.added);
  console.log(changes.modified);
  console.log(changes.deleted);
}
const end = watch("src").start(changes => {
  console.log(changes);
});

Options

Written in the source code.

Benchmark

test Benchmark
generated 10930 files.
[Add]
took 183ms to traverse 11232 files
took 147ms to traverse 11542 files
took 142ms to traverse 11845 files
[Modify]
took 139ms to traverse 11891 files
took 136ms to traverse 11891 files
took 154ms to traverse 11891 files
[Delete]
took 138ms to traverse 11608 files
took 134ms to traverse 11274 files
took 145ms to traverse 10960 files
... ok

Try yourself:

deno https://deno.land/x/watch/test.ts --allow-write

Limitations

  • Changes within 1s cannot be detected.
  • Symlink may not work on Windows.

License

MIT