function · Node only

# mockSerialPort

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

`@toip-tools/mesh-transport/node` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/mesh-transport/src/node.ts#L60)

Import:

```ts
import { mockSerialPort } from "@toip-tools/mesh-transport/node";
```

## Declaration

Signature:

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

### Parameters

**`path` (required)**

`string`

**`opts` (optional)**

`{ echo?: boolean; }`

Default: `{}`

**Fields of `opts`**

- **`echo` (optional)**: `boolean | undefined`

### Returns

`SerialPortLike`

[Usage guide](https://toip.tools/toolkit/mesh-transport/#usage) · [Error handling](https://toip.tools/toolkit/mesh-transport/#errors) · [All exports](https://toip.tools/toolkit/mesh-transport/api/node/)

---

This is the Markdown version of https://toip.tools/toolkit/mesh-transport/api/node/mockSerialPort/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
