# asynchronous-flow

> Manage asynchronous function in form of Express route(next).

Latest version **1.1.4** (published 2019-08-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install asynchronous-flow
pnpm add asynchronous-flow
yarn add asynchronous-flow
bun add asynchronous-flow
```

## 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.1.4 |
| Published | 2019-08-10 |
| First published | 2019-08-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | tragicDilemma |
| Maintainers | tragic_dilemma |
| Keywords | javascript, asynchronous |

## Links

- npm: https://www.npmjs.com/package/asynchronous-flow
- Repository: https://github.com/lspss9950101/flow
- Homepage: https://github.com/lspss9950101/flow#readme
- Issues: https://github.com/lspss9950101/flow/issues
- npm.io page: https://npm.io/package/asynchronous-flow

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.1.4 (latest) — 2019-08-10
- 1.1.3 — 2019-08-10
- 1.1.2 — 2019-08-10
- 1.1.1 — 2019-08-08
- 1.1.0 — 2019-08-08
- 1.0.0 — 2019-08-08

## README

# Installation #
```
npm install asynchronous-flow
```
# Usage #
## Import ##
```
var flow = require('asynchronous-flow');
```
## Instantiate ##
```
var asyncSeries = new flow();
```
## Additional Config ##
```
asyncSeries.setArgs(/*args*/)
	.setErrorHandler(/*handler function*/);
```
### setArgs ###
Set the arguments passed through every function.
Can passed multiple arguments.
### setErrorHandler ###
Set the handler function to handle error thrown by next(err).
## Asynchronous Function ##
The last argument of target function must be a function next.(Similar to Express)
## Example ##
```
var flow = require('asynchronous-flow');

function func1(arg, next){
	console.log(arg.val++);
	next();
}

function func2(arg, next){
	console.log(arg.val++);
	next('error test');
}

var args = {val: 0};

var tmp = new flow();
tmp.setArgs(args)
	.setErrorHandler((err) => {console.log('Error : ', err)})
	.flow(func1, func2, (arg) => {
		console.log(arg.val);
	});
```

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