JSPM

is-async-fn

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1084
  • Score
    100M100P100Q100623F
  • License MIT

Check if something is an ES7 async function

Package Exports

  • is-async-fn

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-async-fn) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-async-fn

build status

Check if something is an ES7/ES2016 async/await 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:

import isAsyncFn from 'is-async-fn'

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

License

MIT

Copyright (c) JP Richardson