When command-node is used in another library to create a specialized commands module to be imported by a third application, the order of the dependencies in the package.json file for this third application determines whether the console applications will work or fail. If the command-node dependency appears first, the command-line applications will fail when invoking the prompt() function, as the rl internal object will be undefined.
The reason seems to be the instantiation of multiple copies of the command-node library (instead of a single shared one, as expected with a Node.js module). This could be an error or an obscure npm behavior, but either way it can be addressed with a refactor of the library's code. This doesn't seem to be urgent, but may give some headaches in the near future.
When
command-nodeis used in another library to create a specialized commands module to be imported by a third application, the order of the dependencies in the package.json file for this third application determines whether the console applications will work or fail. If thecommand-nodedependency appears first, the command-line applications will fail when invoking theprompt()function, as therlinternal object will beundefined.The reason seems to be the instantiation of multiple copies of the
command-nodelibrary (instead of a single shared one, as expected with a Node.js module). This could be an error or an obscure npm behavior, but either way it can be addressed with a refactor of the library's code. This doesn't seem to be urgent, but may give some headaches in the near future.