The node-ffi module provides a managed wrapper around native DLLs.
All you need to do is to define types of functions, and then you don't have to deal with errors in calculating string sizes for malloc and what not.
All of that is taken care for you by node-ffi, a more battle-tested library.
There is also the non-maintained but already existing registry module windows-registry that does exactly this.
The node-ffi module provides a managed wrapper around native DLLs.
All you need to do is to define types of functions, and then you don't have to deal with errors in calculating string sizes for malloc and what not.
All of that is taken care for you by node-ffi, a more battle-tested library.
There is also the non-maintained but already existing registry module windows-registry that does exactly this.