3 ms·
I think there are two philosophies here: 1) JavaScript must stay in the box (aka in the browser). 2) JavaScript as a general purpose programming language. Wh
by shevy-java 8mo ago
I think there are two philosophies here:
1) JavaScript must stay in the box (aka in the browser).
2) JavaScript as a general purpose programming language.
While I can absolutely understand 1), I have had wanted to access
the filesystem via JavaScript, just as I do via ruby or python, for
local use only. After I googled for a while, they would say that
this is not possible unless one uses npm/node. I think this shows
that there are use cases here and the "default" JavaScript, aka 1),
does not cover these. I do not like JavaScript, but based on my
own use cases, I actually favour 2) far more than 1). So from that
point of view, being able to access UEFI can also be useful. So
why not.
- notpushkin 8mo ago> I have had wanted to access the filesystem via JavaScript, just as I do via ruby or python There are some (limited) ways to do so now: https://developer.mozilla.org/en-US/docs/Web/API/File_System_API https://developer.mozilla.org/en-US/docs/Web/API/File_System... As for (1) vs (2), it’s not really an issue of JavaScript at all. The main question is, do you want to build something that runs in a browser? If you’re building a web app, you’ll have to use the sandboxed APIs (and probably JavaScript). If you don’t care about the runtime, yeah, you can use Node or Bun or Deno (or use another language altogether).
- DJBunnies 8mo agoTry webkitdirectory file attribute for browser access to the file system.
- watermelon0 8mo agoYou are missing one option: 0) JavaScript must be abolished from the browser
- pwdisswordfishy 8mo ago> I googled for a while, they would say that this is not possible unless one uses npm/node Gnome Shell and Firefox/SeaMonkey/Mozilla Application Suite/Netscape 6+ (and Zotero[1]) are implemented on top of SpiderMonkey. 1. <https://news.ycombinator.com/item?id=46735616 https://news.ycombinator.com/item?id=46735616>
- tracker1 8mo agoI've been using Deno a LOT for general shell scripting... it's been pretty nice in general. FWIW, Node, Bun and Deno have FS interfaces in the box, so yes, you can do it without npm modules. Though Deno allows you to directly reference the modules/repos from the script without needing a separate install step, package.json or node_modules directory. It's also a single, self-updating executable and includes a lot in the box. Including SQLite3.