VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-util-types-isasyncfunction-method/

⇱ Node.js util.types.isAsyncFunction() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js util.types.isAsyncFunction() Method

Last Updated : 28 Apr, 2025

The util.types.isAsyncFunction() method is an inbuilt application programming interface of the util module which is used to type check for asynchronous functions in the node.js.

Syntax: 

util.types.isAsyncFunction( value )

Parameters: This method accepts a single parameter as mentioned above and described below: 

  • value: It is a required parameter that holds any data type.

Return Value: It returns a boolean value, TRUE if the value is an async function from the perspective of the JavaScript engine, FALSE otherwise.

The below examples illustrate the use of util.types.isAsyncFunction() method in Node.js:

Example 1: 

Output: 

true
false

Example 2: 

Output: 

The passed value is an Async function.
The passed value is not an Async function

Note: The above program will compile and run by using the node filename.js command.

Reference: https://nodejs.org/api/util.html#util_util_types_isasyncfunction_value

Comment

Explore