From 2d5c5a1738b95cd286b47e3ee4586f0f9b37d340 Mon Sep 17 00:00:00 2001 From: Jonathan Dahan Date: Sun, 1 Oct 2023 14:04:18 -0400 Subject: [PATCH] add missing close() --- src/ebb.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ebb.ts b/src/ebb.ts index 4f6a0c0..9e9cb56 100644 --- a/src/ebb.ts +++ b/src/ebb.ts @@ -61,6 +61,14 @@ export class EBB { } } + public close(): Promise { + return new Promise((resolve, reject) => { + this.port.close((error) => { + if (error) { reject(error) } else { resolve() } + }) + }) + } + private async write (data: string) { if (process.env.DEBUG_SAXI_COMMANDS) { console.log(`writing: ${data}`)