Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-async-function

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-async-function

Determine if a function is a native async function.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16M
increased by5.9%
Maintainers
2
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 12 Apr 2022

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