Skip to content

Commit

Permalink
add missing close()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Dahan committed Oct 1, 2023
1 parent 3870803 commit 2d5c5a1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ebb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ export class EBB {
}
}

public close(): Promise<void> {
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}`)
Expand Down

0 comments on commit 2d5c5a1

Please sign in to comment.