php-wasm-zlib

0.0.9-h • Public • Published

php-wasm-zlib

zlib extenstion for php-wasm.

https://github.com/seanmorris/php-wasm

https://www.npmjs.com/package/php-wasm

Usage

php-wasm-zlib can be loaded via dynamic imports:

const php = new PhpWeb({sharedLibs: [
    await import('https://unpkg.com/php-wasm-zlib')
]});

The supporting library libz.so will automatically be pulled from the package.

You can rely on the default loading behavior if all .so files are served from the same directory as your .wasm files.

const php = new PhpWeb({sharedLibs: ['php8.3-zlib.so']});

You can provide a callback as the locateFile option to map library names to URLs:

const locateFile = (libName) => {
    return `https://my-example-server.site/path/to/libs/${libName}`;
};

const php = new PhpWeb({locateFile, sharedLibs: ['php8.3-zlib.so']});

Build options:

The following options may be set in .php-wasm-rc for custom builds of php-wasm & php-cgi-wasm.

  • WITH_ZLIB

WITH_ZLIB

0|static|shared

When compiled as a dynamic extension, this will produce the extension php-8.𝑥-zlib.so.

Readme

Keywords

none

Package Sidebar

Install

npm i php-wasm-zlib

Weekly Downloads

44

Version

0.0.9-h

License

none

Unpacked Size

210 kB

Total Files

11

Last publish

Collaborators

  • seanmorris