toip.tools

function · Node only

mockSerialPort

The same wrapper over serialport's mock binding, for trying adapters without hardware.

@toip-tools/mesh-transport/nodeView source
TypeScriptImport
import { mockSerialPort } from "@toip-tools/mesh-transport/node";

Declaration

TypeScriptSignature
mockSerialPort(path: string, opts?: {
    echo?: boolean;
}): SerialPortLike;

Parameters

pathrequired
string
optsoptional
{ echo?: boolean; }

Default: {}

Fields of opts
echooptional
boolean | undefined

Returns