node.js - Test if a function is asynchronous or not? -


i want test whether function in node.js asynchronous or not?

the author of module says asynchronous want sure. hoping there way find out if asynchronous or not. how can check whether asynchronous or not?

here's simple way test if code async: modify variable in callback , check if has changed after function call:

var async_check = 0;  maybe_async(function(){     async_check = 1; });  if(async_check){     console.log("maybe_async synchronous"); } else {     console.log("maybe_async asynchronous"); } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -