Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6792813ffe | ||
|
|
83373b6c7b | ||
|
|
ff02c8a5a4 | ||
|
|
a1f1822c64 | ||
|
|
20957dcda8 | ||
|
|
9ac5f17b1c | ||
|
|
2789b6b2e7 | ||
|
|
6219528dcb |
@@ -8,7 +8,7 @@ the following code runs `deno --allow-net example.ts` which is located in `/some
|
||||
|
||||
|
||||
```bash
|
||||
/some/work/dir$ deno --allow-run --allow-read https://raw.githubusercontent.com/Caesar2011/rhinoder/master/mod.ts --allow-net example.ts
|
||||
/some/work/dir$ deno run --allow-run --allow-read https://deno.land/x/rhinoder@v1.2.0/mod.ts --allow-net example.ts
|
||||
```
|
||||
|
||||
## Thanks to
|
||||
|
||||
6
mod.ts
6
mod.ts
@@ -1,20 +1,16 @@
|
||||
function startProcess(args: string[] = []): Deno.Process {
|
||||
return Deno.run({ cmd: ['deno', ...args] });
|
||||
return Deno.run({ cmd: ['deno', 'run', ...args] });
|
||||
}
|
||||
|
||||
const throttle = 500;
|
||||
let app: Deno.Process = startProcess(Deno.args);
|
||||
let appInitTime: number = Date.now();
|
||||
let timeout: number|null = null;
|
||||
|
||||
function runApp() {
|
||||
appInitTime = Date.now();
|
||||
app && app.close();
|
||||
app = startProcess(Deno.args);
|
||||
}
|
||||
|
||||
runApp();
|
||||
|
||||
for await (const event of Deno.watchFs('.')) {
|
||||
if (event.kind !== "access") {
|
||||
if (timeout) clearTimeout(timeout);
|
||||
|
||||
Reference in New Issue
Block a user