Node.js COM interop
Creates runtime proxy classes for a type library.
npm install cominterop
Only compatible with Windows (which goes to most typelibs too anyway).
- Pointer return values won't work maintain identity:
obj.Member !== obj.Member, when
- Support for several data types missing.
SAFE_ARRAYthe biggest one.
- Only getters supported for indexed properties:
arr[ 0 ].
IDispatchfor method invocation.
- My current test libraries are limited to M-Files API. Other libraries may be completely incompatible without me knowing about it.
- Track pointers and return same references for equal pointer values.
- Add compatibility option to
load()for mangling the member names for lower case. The upper case method names will confuse linters that expect these to be constructors.
Preprocessing the type library should help a bit with the major performance issues of going with raw IDispatch.
However there are still a lot of dynamic lookups happening - especially in parameter resolution. And the method invocations are done over IDispatch (with all the VARIANTing) instead of using direct COM vtables and other internals.