I understand node.js is modular, and js scripts are supposed to be included via module.exports. But let's say I don't care about best practice and just want to make everything (data objects, functions, etc) in a pre-existing javascript file e.g. source.js
available to a node script serve.js
. Is there any way to achieve this?
This is a different to the question referenced above because that answer requires specifically formatted script using module.exports
.