The espruino command line now supports require() as per node . It implements the logic of node's require().resolve according to the rules set out at https://nodejs.org/dist/latest-v5.x/docs/api/modules.html#modules_all_together (with the exceptions of not supporting node binaries *.node and only looking in the modules folder in the current working directory, not recursively following back up to the path to the root)
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.
The
espruino
command line now supportsrequire()
as pernode
. It implements the logic of node'srequire().resolve
according to the rules set out at https://nodejs.org/dist/latest-v5.x/docs/api/modules.html#modules_all_together (with the exceptions of not supporting node binaries*.node
and only looking in themodules
folder in the current working directory, not recursively following back up to the path to the root)See this post
That includes files, folders, sub-folders, .json, index.js and package.json support.
This hasn't made its way to the WebIDE and I don't know if it ever will.