closeAsync

external fun closeAsync(): Promise<Void>(source)

The SerialPort.close() method of the SerialPort interface returns a Promise that resolves when the port closes.

MDN Reference