10 ms·
It has a very small standard library: https://bellard.org/quickjs/quickjs.html#std-module https://bellard.org/quickjs/quickjs.html#std-module It would be enou
by untog 6y ago
It has a very small standard library:
https://bellard.org/quickjs/quickjs.html#std-module https://bellard.org/quickjs/quickjs.html#std-module
It would be enough for a good number of CLI tools, I'd think. But one big issue is going to be that every library on NPM is hardcoded to use Node's modules (e.g. fs) so you're not going to be able to use any external modules at all.
- tomjakubowski 6y agoThis is untrue. There are plenty of modules published to npm which don't use node APIs, often specifically so they can be used in many runtimes. Here's one example: https://www.npmjs.com/package/squat https://www.npmjs.com/package/squat
- untog 6y agoOK, to be clearer: almost all the libraries published to NPM that would use the functions in QuickJS’s std module instead use Node modules and there is no compatibility layer. So yes, there are plenty of pure JS modules. But if you want to read a file from a disk you’re going to end up with a library that assumes you’re using Node.