mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-12 14:00:01 -04:00
update docs to include needed deps
This commit is contained in:
parent
717331bfc1
commit
23d1651383
3 changed files with 11 additions and 2 deletions
|
@ -18,12 +18,16 @@ git clone https://github.com/ading2210/libcurl.js --recursive
|
||||||
cd libcurl.js/client
|
cd libcurl.js/client
|
||||||
./build.sh
|
./build.sh
|
||||||
```
|
```
|
||||||
Make sure you have emscripten, git, and the various C build tools installed. The build script will generate `client/out/libcurl.js` as well as `client/out/libcurl_module.mjs`, which is an ES6 module.
|
Make sure you have emscripten, git, and the various C build tools installed. The only OS supported for building libcurl.js is Linux. On Debian-based systems, you can run the following command to install all the dependencies:
|
||||||
|
```
|
||||||
|
sudo apt install make cmake emscripten autoconf automake libtool pkg-config wget xxd
|
||||||
|
```
|
||||||
|
|
||||||
You can supply the following arguments to the build script to control the build:
|
The build script will generate `client/out/libcurl.js` as well as `client/out/libcurl_module.mjs`, which is an ES6 module. You can supply the following arguments to the build script to control the build:
|
||||||
- `release` - Use all optimizations.
|
- `release` - Use all optimizations.
|
||||||
- `single_file` - Include the WASM binary in the outputted JS using base64.
|
- `single_file` - Include the WASM binary in the outputted JS using base64.
|
||||||
|
|
||||||
|
|
||||||
## Javascript API:
|
## Javascript API:
|
||||||
|
|
||||||
### Importing the Library:
|
### Importing the Library:
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
//everything is wrapped in a function to prevent emscripten from polluting the global scope
|
//everything is wrapped in a function to prevent emscripten from polluting the global scope
|
||||||
window.libcurl = (function() {
|
window.libcurl = (function() {
|
||||||
|
|
||||||
|
if (typeof window === "undefined") {
|
||||||
|
throw new Error("NodeJS is not supported. This only works inside the browser.");
|
||||||
|
}
|
||||||
|
|
||||||
//emscripten compiled code is inserted here
|
//emscripten compiled code is inserted here
|
||||||
/* __emscripten_output__ */
|
/* __emscripten_output__ */
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#build all deps
|
#build all deps
|
||||||
|
|
||||||
|
set -e
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
|
|
||||||
OPENSSL_PREFIX=$(realpath build/openssl-wasm)
|
OPENSSL_PREFIX=$(realpath build/openssl-wasm)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue