# as-async

> run or wrap a function as an async function

Latest version **1.0.0** (published 2018-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install as-async
pnpm add as-async
yarn add as-async
bun add as-async
```

## 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 | 2018-11-16 |
| First published | 2018-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zhaoyao91@gmail.com |
| Maintainers | zhaoyao91 |
| Keywords | run, wrap, async |

## Links

- npm: https://www.npmjs.com/package/as-async
- Repository: https://github.com/zhaoyao91/as-async
- Homepage: https://github.com/zhaoyao91/as-async#readme
- Issues: https://github.com/zhaoyao91/as-async/issues
- npm.io page: https://npm.io/package/as-async

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-11-16

## README

# As Async

## Description

Sometimes we want to run a function uniformly in async/await manner no matter if it is a sync or async function. 
This package help you do this.

## Install

`npm install --save as-async`

## Usage

```
const {run, wrap} = require('as-async')

// original sync or async function
const fn = ... 

// you can wrap it into an async function
const asyncFn = wrap(fn)
const result = await asyncFn(...args)

// or run it directly as an async function
const result = run(fn, ...args)
```

## License

MIT

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