mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 22:40:01 -04:00
add nodejs support
This commit is contained in:
parent
3a2ab40e75
commit
87b887a4b7
13 changed files with 78 additions and 18 deletions
|
@ -5,7 +5,7 @@ Licensed under the GNU LGPL v3. See https://github.com/ading2210/libcurl.js
|
|||
*/
|
||||
|
||||
//everything is wrapped in a function to prevent emscripten from polluting the global scope
|
||||
const libcurl = (function() {
|
||||
export const libcurl = (function() {
|
||||
|
||||
//emscripten compiled code is inserted here
|
||||
/* __emscripten_output__ */
|
||||
|
@ -21,6 +21,8 @@ var main_session = null;
|
|||
const libcurl_version = "__library_version__";
|
||||
const wisp_version = "__wisp_version__";
|
||||
|
||||
const WSImpl = (typeof process !== "undefined" && typeof WebSocket === "undefined") ? require("ws").WebSocket : WebSocket;
|
||||
|
||||
function check_loaded(check_websocket) {
|
||||
if (!wasm_ready) {
|
||||
throw new Error("wasm not loaded yet, please call libcurl.load_wasm first");
|
||||
|
@ -149,4 +151,6 @@ api = {
|
|||
|
||||
return api;
|
||||
|
||||
})()
|
||||
})()
|
||||
|
||||
export default libcurl;
|
Loading…
Add table
Add a link
Reference in a new issue