Projects/Modules with Esprunio CLI

Posted on
  • I've got my project setup with a number of separate modules, is it possible to write this to the pixl using the command line tool?

  • 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

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Projects/Modules with Esprunio CLI

Posted by Avatar for sammachin @sammachin

Actions