3 ms·
You can just opt to use synchronous variants of I/O functions such as fs.readFileSync(). Or you could use alternate Server-side JavaScript (SSJS) runtimes imple
by tannhaeuser 5y ago
You can just opt to use synchronous variants of I/O functions such as fs.readFileSync(). Or you could use alternate Server-side JavaScript (SSJS) runtimes implementing the sync parts of CommonJs (= the Node.js API) such as teajs/v8cgi, narwhal, Helma. Though I'm not sure those latter ones are still being maintained after Node.js became the dominant SSJS platform ten years ago, when those projects contributed to CommonJs, and made Node.js even possible through the CommonJs module convention. And I should add that JavaScript and v8 lack any mechanism for shared memory access/multithreading, like the JVM has.
- dools 5y agoSo the v8 runtime can be executed directly to run nodejs code instead of calling node on the command line? like if I had some node code I could execute with: node mynode.js can I do: v8cgi node.js also?