Ahh. I don't know for sure, but you may be able to get a callback when the piping is finished, and then send the final bit of text on that.
Otherwise you can use the steam IO to manually send the file (rather than piping).
Or... Did you consider working around it? You could use ajax to load the log from the html file, rather than including it directly.
@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.
Ahh. I don't know for sure, but you may be able to get a callback when the piping is finished, and then send the final bit of text on that.
Otherwise you can use the steam IO to manually send the file (rather than piping).
Or... Did you consider working around it? You could use ajax to load the log from the html file, rather than including it directly.