second-state / wasmedge-quickjs

A high-performance, secure, extensible, and OCI-complaint JavaScript runtime for WasmEdge.
Apache License 2.0
495 stars 61 forks source link

Consider mimicking the browser's `fetch` API for `http_module` #30

Open joepio opened 2 years ago

joepio commented 2 years ago

Hi there, I'm really impressed with this project! I'm looking for a WASM or JS runtime to create a plugin system for Atomic Server, and this looks very interesting.

I'd love to be able to use my existing JS / Node library in here, but that one currently depends on having some form of fetch - either from window or from node.

I was wondering whether it would be possible to mimick the browser's fetch API for the GET / POST part of the http_module, so it would be a drop-in replacement. That would allow users to run many existing libraries in this runtime.

Good luck with this project!

juntao commented 2 years ago

Hi @joepio

This is partially done. Please give it a try and let us know your thoughts.

https://wasmedge.org/book/en/dev/js/fetch.html

Would love to see applications you build with it!

joepio commented 2 years ago

That's great to hear! I'll definitely give it a try soon :)