# stdio-test

> Console and outputs mocking library

Latest version **0.1.0** (published 2021-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install stdio-test
pnpm add stdio-test
yarn add stdio-test
bun add stdio-test
```

## 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.1.0 |
| Published | 2021-02-08 |
| First published | 2021-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chongyi Zheng |
| Maintainers | harryzcy |
| Keywords | stdio-test, test, testing, assertion |

## Links

- npm: https://www.npmjs.com/package/stdio-test
- Repository: https://github.com/harryzcy/stdio-test
- Homepage: https://github.com/harryzcy/stdio-test#readme
- Issues: https://github.com/harryzcy/stdio-test/issues
- npm.io page: https://npm.io/package/stdio-test

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2021-02-08

## README

# Standard IO Test

A Node.js library that mocks console and stdout for testing.

## Get Started

```
npm install --save-dev stdio-test
```

## Example Usage

Mock `console.log`
```javascript
const withConsoleLog = require("stdio-test").withConsoleLog;
const stream = withConsoleLog(() => {
    process.stdout.write("some data");
});
// use stream.buffers to get buffers
```

Mock `process.stdout.write`

```javascript
const withStdoutWrite = require("stdio-test").withStdoutWrite;
const stream = withStdoutWrite(() => {
    process.stdout.write("some data");
});
// use stream.lines to get buffers by line
```

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