
Security News
Frontier AI Is Now Critical Infrastructure
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.
A wasm module compiled from the zlib library can greatly improve the performance of js decompression and compression. For environments that do not support wasm, pako will be downgraded by default to ensure that the production environment is not blocked.
First of all, you need add zlib-wasm in project. run:
yarn add zlib-wasm --save
This module is a singleton with 2 simple api.It is recommended to export 2 functions for external use.
import { zlib } from 'zlib-wasm';
// false by default. There are some logs in console if `true` was setted;
zlib.setDebug(true);
export function ungzip<T>(gzipBase64Str: string): T {
return zlib.ungzip(gzipBase64Str)
}
export function gzip(data: string): string {
return zlib.gzip(data, 9/* gzip level */);
}
Wasm broke into the zlib-wasm chunk in the form of base64, but the loading process of the Webassembly Module was asynchronous.
You don't need to care whether the state is loaded. When Webassembly is not available, it will automatically downgrade to use pako.If you really depend on this state, you can judge by zlib.isReady(): boolean or zlib.loadedPromise.then((instance => { /* wasm is Ready */ })).
You can run a local service to debug zlib-wasm in the browser. By default, this is a performance page to test zlib-wasm and pako.
yarn start
Then visit http://localhost:9000 in your browser tab.
MIT & Zlib
FAQs
a wasm generator for zlib
The npm package zlib-wasm receives a total of 747 weekly downloads. As such, zlib-wasm popularity was classified as not popular.
We found that zlib-wasm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.