# is-async-function

> Determine if a function is a native async function.

Latest version **2.1.1** (published 2025-01-23) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2025-01-23 |
| First published | 2015-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 0.4 |
| Dependencies | 5 |
| Unpacked size | 22.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Jordan Harband |
| Maintainers | ljharb, tunnckocore |
| Keywords | async, async function, es6, es2015, yield, function, function* |

## Links

- npm: https://www.npmjs.com/package/is-async-function
- Repository: https://github.com/inspect-js/is-async-function
- Homepage: https://github.com/inspect-js/is-async-function#readme
- Issues: https://github.com/inspect-js/is-async-function/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/is-async-function

## Dependencies (5)

- [get-proto](https://npm.io/package/get-proto.md) ^1.0.1
- [call-bound](https://npm.io/package/call-bound.md) ^1.0.3
- [async-function](https://npm.io/package/async-function.md) ^1.0.0
- [has-tostringtag](https://npm.io/package/has-tostringtag.md) ^1.0.2
- [safe-regex-test](https://npm.io/package/safe-regex-test.md) ^1.1.0

## 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

- 2.1.1 (latest) — 2025-01-23
- 2.1.0 — 2025-01-02
- 2.0.0 — 2022-04-12
- 1.3.0 — 2020-01-15
- 1.2.4 — 2020-01-15
- 1.2.3 — 2017-03-11
- 1.2.2 — 2016-10-29
- 1.2.1 — 2016-10-27
- 1.2.0 — 2016-10-27
- 1.1.5 — 2016-09-21
- 1.1.4 — 2016-09-21
- 1.1.3 — 2016-04-21
- 1.1.2 — 2016-03-18
- 1.1.1 — 2016-03-18
- 1.1.0 — 2015-06-24
- … 2 more at https://npm.io/package/is-async-function/versions

## README

# is-async-function <sup>[![Version Badge][2]][1]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][11]][1]

Is this a native `async function`?

## Example

```js
var isAsyncFunction = require('is-async-function');
assert(!isAsyncFunction(function () {}));
assert(!isAsyncFunction(null));
assert(!isAsyncFunction(function* () { yield 42; return Infinity; }));
assert(isAsyncFunction(async function () {}));
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[1]: https://npmjs.org/package/is-async-function
[2]: https://versionbadg.es/inspect-js/is-async-function.svg
[5]: https://david-dm.org/inspect-js/is-async-function.svg
[6]: https://david-dm.org/inspect-js/is-async-function
[7]: https://david-dm.org/inspect-js/is-async-function/dev-status.svg
[8]: https://david-dm.org/inspect-js/is-async-function#info=devDependencies
[11]: https://nodei.co/npm/is-async-function.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/is-async-function.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/is-async-function.svg
[downloads-url]: https://npm-stat.com/charts.html?package=is-async-function
[codecov-image]: https://codecov.io/gh/inspect-js/is-async-function/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-async-function/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-async-function
[actions-url]: https://github.com/inspect-js/is-async-function/actions

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