Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.
/ deno-watch Public archive
forked from jinjor/deno-watch

A pure deno file watcher.

License

Notifications You must be signed in to change notification settings

sdweiyu/deno-watch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A pure deno file watcher.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%