# asyncworkflow

> A workflow library that allows you to write async code in an sync manner. Forget the .then chains used in promises and simply yeild...

Latest version **1.2.10** (published 2016-08-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install asyncworkflow
pnpm add asyncworkflow
yarn add asyncworkflow
bun add asyncworkflow
```

## 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.2.10 |
| Published | 2016-08-14 |
| First published | 2016-08-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Russell Holmes |
| Maintainers | teamholmes |
| Keywords | async, promise, generator, yield, sync, es6, asynchronous, generators, pipe, tosync, async to sync, wrapper, await, yield, task, workflow |

## Links

- npm: https://www.npmjs.com/package/asyncworkflow
- Repository: https://github.com/russellholmes/asynctosync
- Homepage: https://github.com/russellholmes/asynctosync#readme
- Issues: https://github.com/russellholmes/asynctosync/issues
- npm.io page: https://npm.io/package/asyncworkflow

## 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.2.10 (latest) — 2016-08-14
- 1.2.9 — 2016-08-13
- 1.2.8 — 2016-08-12
- 1.2.7 — 2016-08-12
- 1.2.6 — 2016-08-12
- 1.2.5 — 2016-08-12
- 1.2.4 — 2016-08-12
- 1.2.3 — 2016-08-12
- 1.2.1 — 2016-08-12
- 1.2.0 — 2016-08-12
- 1.1.0 — 2016-08-12
- 1.0.0 — 2016-08-12

## README

# asyncworkflow
Simple library that allows you to run async promise based code as if you were writing synchronous code.

## How to use
If you are using es6 then simpoy import the library and call it.
```
import asyncLib from 'asyncworkflow'

asyncLib.runAsyncWorkflow( ## YOUR GENERATOR FUNCTION ## )();

```
Please note that your comsuming app will require [babel-polyfill](https://babeljs.io/docs/usage/polyfill/).


### Typical Scenarios ###
You can use this library when youu don't want to get caught up in the .then chain hell that can happen within promises.

### Example ###

Write your generator that has aync (promise based code) and sync code lines:
```
 	let myGenerator = function*() {
				let result1 = yield axios.get('some http call');
				let result2 = doSynchronousCall(result1);
				let result3 = yield callAnotherAsyncPromiseBasedThing(result2);
				return result3;
			};

  asyncLib.runAsyncWorkflow(myGenerator)();
```

### Notes ###
You can run my library directly within your ES6 project by lifting the file 'index_src.js' from within the 'src' folder.

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