# @joegesualdo/capture-output-node

> Capture console.log output. Useful for testing cli modules.

Latest version **0.0.2** (published 2016-06-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @joegesualdo/capture-output-node
pnpm add @joegesualdo/capture-output-node
yarn add @joegesualdo/capture-output-node
bun add @joegesualdo/capture-output-node
```

## 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.2 |
| Published | 2016-06-26 |
| First published | 2016-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joe Gesualdo |
| Maintainers | joegesualdo |
| Keywords | capture, output, test, log, stdout, stderr |

## Links

- npm: https://www.npmjs.com/package/@joegesualdo/capture-output-node
- Repository: https://github.com/joegesualdo/capture-output-node
- Homepage: https://github.com/joegesualdo/capture-output-node#readme
- Issues: https://github.com/joegesualdo/capture-output-node/issues
- npm.io page: https://npm.io/package/@joegesualdo/capture-output-node

## 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
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2016-06-26
- 0.0.1 — 2016-06-26

## README

## capture-output [![Build Status](https://travis-ci.org/joegesualdo/capture-output-node.svg?branch=master)](https://travis-ci.org/joegesualdo/capture-output-node)
> Capture console.log output. Useful for testing cli modules.

## Install
```
$ npm install --save @joegesualdo/capture-output-node 
```

## Usage
```javascript
import CaptureOutput from '@joegesualdo/capture-output-node';

var capturedOutput = new CaptureOutput();

console.log('Woowee')

capturedOutput.get()
.then((output) => {
  // output === 'Woowee'
})
```

## Test
```
$ npm test
```
## API

### `constructor()`
> Creates an intance of CaptureOutput 

Returns: `CapturedOutput`, instance of CaptureOutput 

```javascript
import CaptureOutput from '@joegesualdo/capture-output-node';

var capturedOutput = new CaptureOutput();
```

### `get()`
> Gets the output that was captured from the time you created the CaptureOutput instance. 

Returns: `Promise`, The promise passes a string (utf8) that represent everything that was printed to the output since the instance of CatpureOuput was initialized.

```javascript
import CaptureOutput from '@joegesualdo/capture-output-node';

var capturedOutput = new CaptureOutput();

console.log('Woowee')

capturedOutput.get()
.then((output) => {
  // output === 'Woowee'
})
```
## Build
```
$ npm run build
```

## License
MIT © [Joe Gesualdo]()

---
_Source: https://npm.io/package/@joegesualdo/capture-output-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
