4 ms·
Python writes to local files using native function open. Javascript has no native function. Because...? We can open a window, write arbitrary text to it, use t
by 8bitsrule 8y ago
Python writes to local files using native function open. Javascript has no native function. Because...?
We can open a window, write arbitrary text to it, use the browswer to 'Save as...'. Close but no cigar.
I'd like to use JS for a lot more than the web. MS Basic wrote user-entered text to a file 40 years ago.
- thomasfoster96 8y agoI’m not sure about you, but I consider JavaScript running in my browser not being able to write arbitrary text to files to be a good thing. Otherwise, Node.js can do exactly what you just said Python and MS Basic can do.
- 8bitsrule 8y agoWhoa hoss. Bit of overkill there. I can already write to file with 'window.(something).createObjectURL' ... which queries user. I simply suggest that 'future javascript' open() (or whatever) supports that with no-more-code needed.