What filename/module name did you use? I just tried the following and it worked fine:
In node_modules/foo.js
node_modules/foo.js
exports.foo = "Hello World";
And in Espruino's console:
>require("foo") ={ "foo":"Hello World" }
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
What filename/module name did you use? I just tried the following and it worked fine:
In
node_modules/foo.js
And in Espruino's console: