For nodejs what are best design practices for native modules which share dependencies?
- by Mark Essel
Hypothetical situation, I have 3 node modules all native, A, B, and C.
A is a utilities module which exposes several functions to javascript through the node interface, in addition it declares/defines a rich set of native structures and functions
B is a module which is dependent on data structures and source in A, it exposes some functions to javascript, in addition it declares/defines native structures and functions
C is a module which is dependent on data structures and source in A & B, it exploses some functions to javascript, in addition it declares/defines native structures and functions
So far when setting up these modules I have a preinstall script to install other dependent includes, but in order to access all of another modules source what is the best way to link to it's share library object (*.node) ?
Is there an alternative best practice for native modules (such as installing all source from other modules before building that single module)?
Reply