Skip to content

Commit 5c31bd2

Browse files
author
Dane Springmeyer
committed
Use NODE_GYP_MODULE_NAME
- This is from the docs at https://nodejs.org/api/addons.html - It avoid needing to hardcode the "module" keyword here. This helps users that write code based on node-pre-gyp avoid having to update the module name in two places.
1 parent 2883650 commit 5c31bd2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/module.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ static void init(v8::Local<v8::Object> target) {
4343
// We mark this NOLINT to avoid the clang-tidy checks
4444
// warning about code inside nodejs that we don't control and can't
4545
// directly change to avoid the warning.
46-
NODE_MODULE(module, init) // NOLINT
46+
// NODE_GYP_MODULE_NAME is the name of our module as defined in 'target_name'
47+
// variable in the 'binding.gyp', which is passed along as a compiler define
48+
NODE_MODULE(NODE_GYP_MODULE_NAME, init) // NOLINT

0 commit comments

Comments
 (0)