Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce3a42a4d7 | ||
|
|
155a02665a | ||
|
|
0441456068 |
@@ -4,7 +4,7 @@ This program reloads a deno program automatically when a file in the current wor
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
the following code runs `deno --allow-net example.ts` which is located in `/some/work/dir/example.ts` on start an whenever a file in the folder `/some/work/dir` changes.
|
the following code runs `deno --allow-net example.ts` which is located in `/some/work/dir/example.ts` on start and whenever a file in the folder `/some/work/dir` changes.
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -13,4 +13,4 @@ the following code runs `deno --allow-net example.ts` which is located in `/some
|
|||||||
|
|
||||||
## Thanks to
|
## Thanks to
|
||||||
|
|
||||||
Thanks to [samuelgozi](https://github.com/samuelgozi) who posted the base for this code in [this GitHub issue](https://github.com/denoland/deno/issues/4830).
|
Thanks to [samuelgozi](https://github.com/samuelgozi) who posted the base for this code in [this GitHub issue](https://github.com/denoland/deno/issues/4830).
|
||||||
|
|||||||
2
mod.ts
2
mod.ts
@@ -15,7 +15,7 @@ function runApp() {
|
|||||||
|
|
||||||
runApp();
|
runApp();
|
||||||
|
|
||||||
for await (const event of Deno.fsEvents('.')) {
|
for await (const event of Deno.watchFs('.')) {
|
||||||
if (event.kind !== "access") {
|
if (event.kind !== "access") {
|
||||||
if (timeout) clearTimeout(timeout);
|
if (timeout) clearTimeout(timeout);
|
||||||
timeout = setTimeout(runApp, throttle);
|
timeout = setTimeout(runApp, throttle);
|
||||||
|
|||||||
Reference in New Issue
Block a user