# mock-serialport

> a mock serial port i can use when i don't have a real serial port

Latest version **0.0.1** (published 2016-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install mock-serialport
pnpm add mock-serialport
yarn add mock-serialport
bun add mock-serialport
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-06-02 |
| First published | 2016-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Scott Preston |
| Maintainers | prestonresearch |

## Links

- npm: https://www.npmjs.com/package/mock-serialport
- Repository: https://github.com/scottpreston/mock-serialport
- Homepage: https://github.com/scottpreston/mock-serialport#readme
- Issues: https://github.com/scottpreston/mock-serialport/issues
- npm.io page: https://npm.io/package/mock-serialport

## Recent versions

- 0.0.1 (latest) — 2016-06-02

## README

I created this to mock out my serial port so I could test code depending on it while on a machine without a 'serial port'.

## Install

```bash
npm install mock-serialport
```

## Usage

This is how I use this in some of my non-serial ported tests. Like serialservo.

```bash
var fileExists = require('file-exists');
var SerialPort = require('serialport');
var serialPort;
if (fileExists(portName)) {
    serialPort = new SerialPort("/dev/ttyUSB0", {baudRate:9600});
} else {
    serialPort = new MockSerialPort();
}
```

---
_Source: https://npm.io/package/mock-serialport · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
