I'm using rhino from the JVM with the jaxax.script interfaces. I'm trying to evaluate JavaScript that contains 'require' calls. This does not work because there is no definition of 'require'. Is require just a v8 thing? Or maybe just a node.js thing? Are there ways around this on the JVM? Options I can think of are
- rewrite the js files by manually including the required code
- call out to a separate node.js process
(I'm not necessarily recommending the approaches.)