# async-chainable-flush

> Wait for streams to flush before continuing

Latest version **1.0.0** (published 2016-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install async-chainable-flush
pnpm add async-chainable-flush
yarn add async-chainable-flush
bun add async-chainable-flush
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-09-03 |
| First published | 2016-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matt Carter |
| Maintainers | hash-bang |
| Keywords | async, async-chainable, cli, flush, stream |

## Links

- npm: https://www.npmjs.com/package/async-chainable-flush
- Repository: https://github.com/hash-bang/async-chainable-flush
- Issues: https://github.com/hash-bang/async-chainable-flush/issues
- npm.io page: https://npm.io/package/async-chainable-flush

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-09-03

## README

async-chainable-flush
=====================
Plugin for [async-chainable](https://github.com/hash-bang/async-chainable) that flushes various output streams before continuing.

This is mainly useful for CLI based scripts which need to ensure `process.stdout` + `process.stderr` have output their contents before exiting.


```javascript
var asyncChainable = require('async-chainable');
var asyncChainableFlush = require('async-chainable-flush');

asyncChainable()
	.use(asyncChainableFlush)

	.then(function(next) {
		for (var i = 0; i < 1000; i++) {
			console.log('I =', i);
		}
		next();
	})
	.flush() // Assumes process.stdout + process.stderr if nothing is specified
	.end();
```


API
===
The async-chainable-flush API exposes a single API call `flush()` which can take any number of streams to wait for before continuing. If no streams are specified `process.stdout` and `process.stderr` are assumed.


```javascript
asyncChainable()
	.use(asyncChainableFlush)

	.then(function(next) {
		for (var i = 0; i < 1000; i++) {
			console.log('I =', i);
		}
		next();
	})
	.flush(process.stdout) // Only wait for process.stdout to flush before continuing
	.end();

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