MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / RegisterModule

Function RegisterModule

napi-inl.h:553–560  ·  view source on GitHub ↗

Adapt the NAPI_MODULE registration function: - Wrap the arguments in NAPI wrappers. - Catch any NAPI errors and rethrow as JS exceptions.

Source from the content-addressed store, hash-verified

551// - Wrap the arguments in NAPI wrappers.
552// - Catch any NAPI errors and rethrow as JS exceptions.
553inline napi_value RegisterModule(napi_env env,
554 napi_value exports,
555 ModuleRegisterCallback registerCallback) {
556 return details::WrapCallback(env, [&] {
557 return napi_value(
558 registerCallback(Napi::Env(env), Napi::Object(env, exports)));
559 });
560}
561
562////////////////////////////////////////////////////////////////////////////////
563// Maybe class

Callers

nothing calls this directly

Calls 4

WrapCallbackFunction · 0.85
napi_valueFunction · 0.85
EnvClass · 0.85
ObjectClass · 0.85

Tested by

no test coverage detected