Skip to content

Instantly share code, notes, and snippets.

@ghaiklor
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghaiklor/aade1f6bfd3b598bc051 to your computer and use it in GitHub Desktop.
Save ghaiklor/aade1f6bfd3b598bc051 to your computer and use it in GitHub Desktop.
NodeJS method that get builtin native module
struct node_module* get_builtin_module(const char* name) {
struct node_module* mp;
for (mp = modlist_builtin; mp != nullptr; mp = mp->nm_link) {
if (strcmp(mp->nm_modname, name) == 0)
break;
}
CHECK(mp == nullptr || (mp->nm_flags & NM_F_BUILTIN) != 0);
return (mp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment