3 ms·
I'm asking this here because I don't really know where else to do so: I'm trying to compile a binary from a js source that uses the standard modules (they are l
by wheresvic1 7y ago
I'm asking this here because I don't really know where else to do so: I'm trying to compile a binary from a js source that uses the standard modules (they are loaded by default if you run the interpreter) so the following works:
std.printf("%d\n", 1);
std.printf("%s\n", os.platform);
However it does not compile to a binary and doing something like:
import std from "std";
import os from "os";
std.printf("%d\n", 1);
std.printf("%s\n", os.platform);
compiles via `./qjsc -m -o default_modules examples/default_modules.js` however does not execute:
$ ./default_modules
SyntaxError: export 'default' in module 'std' is ambiguous
Source: https://github.com/smalldatatech/quickjs/blob/master/examples/default_modules.js https://github.com/smalldatatech/quickjs/blob/master/example...
- swuecho 7y agoimport * as std from "std"; import * as os from "os"; std.printf("%d\n", 1); std.printf("%s\n", os.platform)
- wheresvic1 7y agoAwesome thanks!