loupedeck-commander 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/test.mjs CHANGED
@@ -1,23 +1,27 @@
1
- import { BaseLoupeDeckHandler } from './common/BaseLoupeDeckHandler.mjs'
2
- //import { BaseLoupeDeckHandler } from 'loupedeck-commander'
3
-
4
- const handler = new BaseLoupeDeckHandler('config.json')
5
-
6
- /**
7
- * Stop the handlers when a signal like SIGINT or SIGTERM arrive
8
- * @param {*} signal
9
- */
10
- const stopHandler = async(signal) => {
11
- console.log(`Receiving ${signal} => Stopping processes.`)
12
- await handler.stop()
13
- }
14
-
15
- // Initiating the signal handlers:
16
- // see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
17
- process.on('SIGINT', async (signal) => { stopHandler(signal) })
18
- process.on('SIGTERM', async (signal) => { stopHandler(signal) })
19
-
20
-
21
- await handler.start()
22
-
1
+ import { BaseLoupeDeckHandler } from './common/BaseLoupeDeckHandler.mjs'
2
+
3
+ var config='config.json'
4
+
5
+ /**
6
+ * Initialize the Handler using a default config-File
7
+ */
8
+ const handler = new BaseLoupeDeckHandler(config)
9
+
10
+ /**
11
+ * Stop the handlers when a signal like SIGINT or SIGTERM arrive
12
+ * @param {*} signal
13
+ */
14
+ const stopHandler = async(signal) => {
15
+ console.log(`Receiving ${signal} => Stopping processes.`)
16
+ await handler.stop()
17
+ }
18
+
19
+ // Initiating the signal handlers:
20
+ // see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
21
+ process.on('SIGINT', async (signal) => { stopHandler(signal) })
22
+ process.on('SIGTERM', async (signal) => { stopHandler(signal) })
23
+
24
+
25
+ await handler.start()
26
+
23
27
  await new Promise((resolve) => process.once("SIGINT", resolve));