Replies: 7 comments 1 reply
-
There is no way to do this today. I agree that this would be much more ergonomic way do doing things.. however even if we expose Can I ask you can't do |
Beta Was this translation helpful? Give feedback.
-
BTW, we used to have an option call |
Beta Was this translation helpful? Give feedback.
-
Thanks for your prompt answer.
It's only for convenience. Technically, it would be fine to await it.
So would it be possible to build with var Module = (() => {
// ...
})();
Module = Module(); // <--------- ADDED
if (typeof exports === 'object' && typeof module === 'object')
module.exports = Module;
else if (typeof define === 'function' && define['amd'])
define([], function() { return Module; });
else if (typeof exports === 'object')
exports["Module"] = Module; I only target Node.js |
Beta Was this translation helpful? Give feedback.
-
There's a way with post.js |
Beta Was this translation helpful? Give feedback.
-
I think we used to have an option call MODULARIZE_INSTANCE that did something like that. See #11037. We should look into finding a way to restore this functionality perhaps? |
Beta Was this translation helpful? Give feedback.
-
Right now, it can be implemented with about 10-20 lines of code, within the current framework. I actually tried to do that, and was close to success. For me it didn't work out, because I'm using Emscripten in browser main thread. And P.S. @sbc100 , could you take a look into #emscripten on discord for a quick FS question, please? |
Beta Was this translation helpful? Give feedback.
-
Actually, there may be a need for such option... With the current framework with E.g. I need to call Guess, need to use the custom |
Beta Was this translation helpful? Give feedback.
-
Hi,
the default way of loading a module is using a factory that returns a
Promise
, e.g.Is it possible to load a module synchronously and without factory in Node.js?
The only thing I found is
WASM_ASYNC_COMPILATION=0
.However, I still have to call the factory first.
Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions