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
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?
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
expr
function isn't behaving as I'd expected:require('espruino')
in node and useexpr
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.-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 withrequire('espruino').expr()
I have a work-around for the first issue, see attached
Note the use of
console.info
in the callback, asconsole.log
is currently mute (by default).You can mute any version of
console
using for exampleconsole.mute('error');
For the second issue, could you maybe set up a callback of
function(m) { console.log(m) };
whenespruino -e 'code...'
is used, so the output can be seen?1 Attachment