There is command line tool, look for Espruino Command-line tool in
http://www.espruino.com/Programming
https://www.npmjs.com/package/espruino
you could redirect the output to a file.
@MaBe 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.
There is command line tool, look for Espruino Command-line tool in
http://www.espruino.com/Programming
https://www.npmjs.com/package/espruino
you could redirect the output to a file.