I've got a question that might sound strange. We are using node.js, but the way we are writing javascript code is in a functional style. We have a lint tool that reports illegal use of the assignment expression. We can eleminate them all except for the 'module.exports = xxx' statement.
Is there an other way to load modules in node.js?
for example; the following statement would be fine as a solution as it is not an assignment expression but a variable declaration: var exports = xxx; if there is a way that nodejs would pick up this 'exports' variable, then we're done.
gr,
Coen
the following did the trick for me:
vm.runInThisContext
Looks like changing lint tool is the best way. :)
However you can use different module loader (there are some AMD implementations for node.js out there) that's pure functional.