We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd63d84 commit be7daa3Copy full SHA for be7daa3
minimon-2.mjs
@@ -0,0 +1,28 @@
1
+#!/usr/bin/env node
2
+
3
+import 'zx/globals'
4
+import chokidar from 'chokidar'
5
6
+let node
7
8
+chokidar
9
+ .watch(['**/*.mjs', '**/*.js'], {
10
+ ignoreInitial: true,
11
+ ignored: ['**/node_modules/**'],
12
+ })
13
+ .on('all', () => {
14
+ node.kill()
15
16
17
+while (true) {
18
+ node = getNode()
19
+ try {
20
+ await node
21
+ } catch {
22
+ console.log('Restarting')
23
+ }
24
+}
25
26
+function getNode () {
27
+ return $`node ${process.argv[2]}`
28
0 commit comments