How to create async function using NAPI that return Promises
问题 i am trying to create node module using NAPI .I have to create async function that returns promises. I don't want that testasynfunction will block NodeJS event loop. do_something_asynchronous is a synchronous function. napi_deferred do_something_synchronous(napi_env env,napi_deferred deferred){ printf("\n3) Function called"); //napi_deferred deferred; napi_value undefined; napi_status status; // Create a value with which to conclude the deferred. status = napi_get_undefined(env, &undefined);