I think it might be because g.buffer is a ArrayBuffer, not a Uint8Array.
g.buffer
What about:
fs = require("fs"); (new Uint8Array(gr.buffer)).set(fs.readFile("myFile.bin"));
@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.
I think it might be because
g.buffer
is a ArrayBuffer, not a Uint8Array.What about: