You are reading a single comment by @Snerkle and its replies. Click here to read the full conversation.
  • The expr function isn't behaving as I'd expected:

    • when I require('espruino') in node and use expr then I get a lot of info on the console and there is no option to suppress this like there is with the cli -quiet option.
    • when I use the cli -e option then I never see the output that is returned from the esprino as there is no way to register a callback like there is with require('espruino').expr()

    I have a work-around for the first issue, see attached

    require('esp-console');
    esp = require('espruino');
    console.mute();
    esp.expr(port, 'getTime()', function(m) { console.info(m); });
    console.unmute();
    

    Note the use of console.info in the callback, as console.log is currently mute (by default).
    You can mute any version of console using for example console.mute('error');

    For the second issue, could you maybe set up a callback of function(m) { console.log(m) }; when espruino -e 'code...' is used, so the output can be seen?


    1 Attachment

About

Avatar for Snerkle @Snerkle started