nodeca/pako là dự án mã nguồn mở trên GitHub với 6.1k sao, viết chủ yếu bằng JavaScript. high speed zlib port to javascript, works in browser & node.js
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Very fast zlib-compatible compression for JavaScript.
Why pako is cool
Binary-equivalent output. Pako can produce the same deflate/gzip bytes as
original zlib (1.3.2) and Node.js' patched zlib.
Tiny browser bundles. Full minified bundle is under 15K gzipped.
Deflate-only and inflate-only builds are smaller.
Very fast. Performance is comparable with native zlib in modern JavaScript
engines (see benchmarks).
Benchmarks
node v24, 1 MB input sample:
deflate-pako x 14.27 ops/sec ±3.41% (37 runs sampled)
deflate-pako-zlib-hash x 10.60 ops/sec ±0.50% (29 runs sampled)
deflate-zlib x 30.30 ops/sec ±0.61% (51 runs sampled)
gzip-pako x 13.48 ops/sec ±0.50% (36 runs sampled)
inflate-pako x 138 ops/sec ±1.26% (75 runs sampled)
inflate-zlib x 397 ops/sec ±1.37% (81 runs sampled)
ungzip-pako x 125 ops/sec ±1.46% (73 runs sampled)
Install
npm install pako
[!NOTE]
For a quick look at dist/ folder contents, see
https://unpkg.com/pako@latest/.
Examples / API
Full docs - http://nodeca.github.io/pako/
import { Deflate, Inflate, deflate, inflate } from 'pako';
// Deflate
//
const input = new Uint8Array();
//... fill input data here
const output = deflate(input);
// Inflate (simple wrapper can throw exception on broken stream)
//
const compressed = new Uint8Array();
//... fill data to uncompress here
try {
const result = inflate(compressed);
// ... continue processing
} catch (err) {
console.log(err);
}
//
// Alternate interface for chunking & without exceptions
//
const deflator = new Deflate();
deflator.push(chunk1, false);
deflator.push(chunk2); // second param is false by default.
...
deflator.push(chunk_last, true); // `true` says this chunk is last
if (deflator.err) {
console.log(deflator.msg);
}
const output = deflator.result;
const inflator = new Inflate();
inflator.push(chunk1);
inflator.push(chunk2);
...
inflator.push(chunk_last); // no second param because end is auto-detected
if (inflator.err) {
console.log(inflator.msg);
}
const output = inflator.result;
For CommonJS:
const { deflate, inflate } = require('pako');
If you need the whole API as an object, use namespace import:
import * as pako from 'pako';
Sometimes you may wish to work with strings — for example, to send
stringified objects to a server. Pako's deflate detects the input data type and
automatically recodes strings to utf-8 prior to compression. High-level inflate
helpers can decode utf-8 output back to JavaScript strings with toText: true.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/nodeca/pako là nguồn chính thức.
nodeca/pako có bao nhiêu sao?
nodeca/pako có 6.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/nodeca/pako. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
nodeca/pako có phải mã nguồn mở không?
Có — nodeca/pako phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/nodeca/pako.
nodeca/pako có trang demo không?
Dự án có trang chủ ở https://nodeca.github.io/pako/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
nodeca/pako là gì?
nodeca/pako (nodeca/pako) là dự án JavaScript trên GitHub. Theo mô tả gốc: high speed zlib port to javascript, works in browser & node.js
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về pako?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về pako.