# is-async-fn

> Check if something is an ES7 async function

Latest version **1.1.0** (published 2015-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-async-fn
pnpm add is-async-fn
yarn add is-async-fn
bun add is-async-fn
```

## 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.0 |
| Published | 2015-11-29 |
| First published | 2015-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | JP Richardson |
| Maintainers | jprichardson |
| Keywords | function, fn, func, async, await, es7, is, check |

## Links

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

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2015-11-29
- 1.0.1 — 2015-11-29
- 1.0.0 — 2015-11-29

## README

is-async-fn
===========

[![build status](https://api.travis-ci.org/jprichardson/is-async-fn.svg)](http://travis-ci.org/jprichardson/is-async-fn)

Check if something is an [ES7/ES2016 async/await](http://pouchdb.com/2015/03/05/taming-the-async-beast-with-es7.html) function.
i.e. It checks if the function was defined with the `async` keyword. It **does NOT** attempt to detect if the function is a traditional asynchronous function, one with a callback.

Compatible with code transformed with Babel 5 and Babel 6.


Install
-------

    npm i --save is-async-fn


Usage
-----

### isAsyncFn

**Signature:** `isAsyncFn(function)`

**Parameters:**
- `function`: The function to check.

**Returns:** Type `boolean`. Returns `true` if the `function` was defined with the
`async` keyword.

**Example:**

```js
import isAsyncFn from 'is-async-fn'

console.log(isAsyncFn(function () {})) // => false
console.log(isAsyncFn(async function () {})) // => true
```

License
-------

MIT

Copyright (c) [JP Richardson](https://github.com/jprichardson)

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