lib: refactor NativeModule
Refactor the internal NativeModule class to a JS class and add more documentation about its properties.
Tip: https://github.com/nodejs/node/pull/30856/files?w=1 is easier to review
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines