@crossbind/port-zlib 2.0.0-beta.62 → 2.0.0-beta.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/mergeConfig.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
**Precompiled zlib library built with crossbind for seamless integration in JavaScript, WebAssembly and React Native projects.**
|
|
3
3
|
|
|
4
4
|
<a href="https://www.npmjs.com/package/@crossbind/port-zlib">
|
|
5
|
-
<img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/port-zlib?style=for-the-badge" />
|
|
5
|
+
<img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/port-zlib/beta?style=for-the-badge" />
|
|
6
6
|
</a>
|
|
7
7
|
<a href="https://zlib.net/">
|
|
8
|
-
<img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%
|
|
8
|
+
<img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.npmjs.org%2F%40crossbind%2Fport-zlib%2Fbeta&query=%24.nativeVersion&style=for-the-badge&label=zlib" />
|
|
9
9
|
</a>
|
|
10
10
|
<a href="https://zlib.net/zlib_license.html">
|
|
11
|
-
<img alt="License" src="https://img.shields.io/
|
|
11
|
+
<img alt="License" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.npmjs.org%2F%40crossbind%2Fport-zlib%2Fbeta&query=%24.license&style=for-the-badge&label=license" />
|
|
12
12
|
</a>
|
|
13
13
|
|
|
14
14
|
> Use it together with **[crossbind](https://crossbind.dev)** — the toolchain for using C++ libraries from JavaScript, TypeScript, WebAssembly, Node.js and React Native. Learn more at **[crossbind.dev](https://crossbind.dev)**.
|
|
@@ -26,7 +26,7 @@ Their C++ wrappers, and the self-check the site build runs against values comput
|
|
|
26
26
|
Install the main package together with the platform builds:
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
|
-
npm install @crossbind/port-zlib @crossbind/port-zlib-wasm @crossbind/port-zlib-android @crossbind/port-zlib-ios
|
|
29
|
+
npm install @crossbind/port-zlib@beta @crossbind/port-zlib-wasm@beta @crossbind/port-zlib-android@beta @crossbind/port-zlib-ios@beta
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Then import all three platforms in `crossbind.config.js` — crossbind compiles only the one matching each build target:
|
|
@@ -48,7 +48,7 @@ export default {
|
|
|
48
48
|
};
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
A native Node.js addon links the build of its platform:
|
|
51
|
+
A native Node.js addon (`crossbind build -e node`) links the build of its platform: `-p darwin`, `-p linux`, `-p linuxmusl` or `-p win32` takes `@crossbind/port-zlib-darwin`, `-linux`, `-linuxmusl` or `-win32`; `-linuxmusl` is the one for Alpine and other musl distributions. Install it and import its `crossbind.config.js` the same way.
|
|
52
52
|
|
|
53
53
|
## Usage
|
|
54
54
|
crossbind binds your C++ headers to JavaScript, so the usual pattern is a small wrapper around the library. This one compresses and decompresses in one call. Put it in your project's native folder (`src/native/` by default):
|
|
@@ -123,7 +123,7 @@ Each one runs in your browser on [crossbind.dev/ports/zlib](https://crossbind.de
|
|
|
123
123
|
- [Compress small messages with a preset dictionary](https://crossbind.dev/ports/zlib/#04-dictionary): raw deflate with `deflateSetDictionary` and `inflateSetDictionary`; a 59-byte message goes from 59 B to 11 B.
|
|
124
124
|
- [Checksum data in pieces](https://crossbind.dev/ports/zlib/#05-checksum): `crc32` and `adler32` as running values, and `crc32_combine` and `adler32_combine` to join pieces checksummed separately.
|
|
125
125
|
|
|
126
|
-
Setup and differences per platform: [WebAssembly](https://crossbind.dev/ports/zlib/wasm/) · [Android](https://crossbind.dev/ports/zlib/android/) · [iOS](https://crossbind.dev/ports/zlib/ios/) · [macOS](https://crossbind.dev/ports/zlib/darwin/) · [Linux](https://crossbind.dev/ports/zlib/linux/) · [Windows](https://crossbind.dev/ports/zlib/win32/) · [WASI](https://crossbind.dev/ports/zlib/wasi/), which also has a gzip command-line program built with `crossbind build -p wasi`.
|
|
126
|
+
Setup and differences per platform: [WebAssembly](https://crossbind.dev/ports/zlib/wasm/) · [Android](https://crossbind.dev/ports/zlib/android/) · [iOS](https://crossbind.dev/ports/zlib/ios/) · [macOS](https://crossbind.dev/ports/zlib/darwin/) · [Linux](https://crossbind.dev/ports/zlib/linux/) · [Windows](https://crossbind.dev/ports/zlib/win32/) · [WASI](https://crossbind.dev/ports/zlib/wasi/), which also has a gzip command-line program built with `crossbind build -p wasi -e wasi`.
|
|
127
127
|
|
|
128
128
|
## What this build includes
|
|
129
129
|
- zlib 1.3.2 from the release tarball, pinned by SHA-256, built with zlib's own CMake options at their defaults apart from `ZLIB_BUILD_TESTING=OFF` and the library type: static on every platform. On Android the archive is position-independent and goes into the libraries that use it, because the app process already holds the system's own `libz.so`, which would shadow a shared build. Its symbols are hidden there, so every library that links it keeps its copy private and calls its own.
|
|
@@ -141,8 +141,10 @@ This is the main package; the precompiled binaries are shipped per platform:
|
|
|
141
141
|
| iOS | [`@crossbind/port-zlib-ios`](https://www.npmjs.com/package/@crossbind/port-zlib-ios) | device (`arm64`), simulator (`arm64`) |
|
|
142
142
|
| macOS | [`@crossbind/port-zlib-darwin`](https://www.npmjs.com/package/@crossbind/port-zlib-darwin) | `arm64` (Apple silicon), `x64` (Intel) — native Node.js addons |
|
|
143
143
|
| Linux | [`@crossbind/port-zlib-linux`](https://www.npmjs.com/package/@crossbind/port-zlib-linux) | `x64`, `arm64` — glibc 2.28 or later, native Node.js addons |
|
|
144
|
+
| Linux (musl) | [`@crossbind/port-zlib-linuxmusl`](https://www.npmjs.com/package/@crossbind/port-zlib-linuxmusl) | `x64`, `arm64` — musl 1.2.5 or later (Alpine 3.21 and later), native Node.js addons |
|
|
144
145
|
| Windows | [`@crossbind/port-zlib-win32`](https://www.npmjs.com/package/@crossbind/port-zlib-win32) | `x64`, `arm64` — Windows 10 or later, native Node.js addons |
|
|
145
146
|
| WASI library | [`@crossbind/port-zlib-wasi`](https://www.npmjs.com/package/@crossbind/port-zlib-wasi) | `wasm32-wasip3` — single-threaded |
|
|
147
|
+
| Node.js, ready-made | [`@crossbind/port-zlib-standalone-napi`](https://www.npmjs.com/package/@crossbind/port-zlib-standalone-napi) | prebuilt addons for macOS, Linux (glibc and musl) and Windows, `arm64` and `x64`: nothing to build |
|
|
146
148
|
|
|
147
149
|
## License
|
|
148
150
|
This project includes the precompiled zlib library, which is distributed under the [zlib License](https://zlib.net/zlib_license.html).
|
package/mergeConfig.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossbind/port-zlib",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.63",
|
|
4
4
|
"nativeVersion": "1.3.2",
|
|
5
5
|
"description": "This package provides the precompiled zlib library, built using crossbind, for easy integration into JavaScript, WebAssembly and React Native projects. It offers compression and decompression functionalities through the zlib API, ensuring high performance and cross-platform compatibility. Ideal for use in web and mobile applications.",
|
|
6
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://crossbind.dev/ports/zlib/",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/crossbind/crossbind.git"
|