Socket
Socket
Sign inDemoInstall

is-async-function

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-async-function

Is function really asynchronous function? Trying to guess that based on check if [common-callback-names][] exists as function arguments names or you can pass your custom.


Version published
Weekly downloads
12M
decreased by-0.89%
Maintainers
1
Weekly downloads
 
Created

What is is-async-function?

The is-async-function npm package is designed to help developers determine if a given function is an asynchronous function. This can be particularly useful in scenarios where the behavior of code needs to be altered based on whether a function is asynchronous or not, such as in dynamic function execution, middleware handling, or in libraries that need to support both synchronous and asynchronous operations.

What are is-async-function's main functionalities?

Checking if a function is asynchronous

This feature allows you to check if a given function is an async function. The package exports a single function that takes one argument (the function to check) and returns a boolean indicating whether the function is asynchronous. This is useful for dynamically handling functions based on their nature.

const isAsyncFunction = require('is-async-function');

async function foo() {};
console.log(isAsyncFunction(foo)); // true

function bar() {};
console.log(isAsyncFunction(bar)); // false

Other packages similar to is-async-function

Keywords

FAQs

Package last updated on 27 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc