Should be, yes. I believe it looks in a 'modules' directory for any modules.
eg.
$ cat modules/bar.js exports = 42; $ cat foo.js var a = require("bar"); print(a); $ espruino -d Pixl foo.js # writes it to RAM $ espruino -d Pixl --minify foo.js # writes it to RAM with minification $ espruino -d Pixl --minify --config MODULE_AS_FUNCTION=true --config SAVE_ON_SEND=1 foo.js # writes to flash with minified code
You may also have some success with --config PRETOKENISE=true, which will pretokenise code before upload, saving a bit of flash
--config PRETOKENISE=true
@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.
Should be, yes. I believe it looks in a 'modules' directory for any modules.
eg.
You may also have some success with
--config PRETOKENISE=true
, which will pretokenise code before upload, saving a bit of flash