Re:Show HN: How to X with Y. Engineering questions, answered
by alex_portabella on Monday October 12, 2020 @09:42AM
(#24754235)
That's true. Definitely need a way to distinguish between the two (browser vs. server) sometimes
This is given as how to write to a file in Javascript.
const {fs} = require('fs')
fs.writeFileSync('/tmp/myfile.txt', Buffer.from('hello'));
But you can't just do this in plain old JS. It needs to be Node running ES6+
[0]: https://howtoxwithy.com/how-to/b35668da-7cbe-456f-8db5-0d645...