{"id":15762274,"url":"https://github.com/williamvenner/node-bzip2","last_synced_at":"2025-04-21T03:32:30.130Z","repository":{"id":242631894,"uuid":"810047494","full_name":"WilliamVenner/node-bzip2","owner":"WilliamVenner","description":"NodeJS bindings for BZip2 (libbz2)","archived":false,"fork":false,"pushed_at":"2025-02-07T16:02:43.000Z","size":64,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T11:55:51.307Z","etag":null,"topics":["bun","bz2","bzip","bzip2","bzip2-js","deno","javascript","js","libbz","libbz2","libbzip","libbzip2","node","nodejs","ts","typescript"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/node-bzip2","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WilliamVenner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-04T00:19:21.000Z","updated_at":"2025-02-07T16:02:32.000Z","dependencies_parsed_at":"2024-06-04T05:24:34.672Z","dependency_job_id":"a0df9ac7-3335-442b-87c4-ab3c921e2f9c","html_url":"https://github.com/WilliamVenner/node-bzip2","commit_stats":{"total_commits":32,"total_committers":1,"mean_commits":32.0,"dds":0.0,"last_synced_commit":"ede27e3f781ef189441dbcc46f5c6afea6ed66ff"},"previous_names":["williamvenner/node-bzip2"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fnode-bzip2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fnode-bzip2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fnode-bzip2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fnode-bzip2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilliamVenner","download_url":"https://codeload.github.com/WilliamVenner/node-bzip2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249991158,"owners_count":21357213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","bz2","bzip","bzip2","bzip2-js","deno","javascript","js","libbz","libbz2","libbzip","libbzip2","node","nodejs","ts","typescript"],"created_at":"2024-10-04T11:08:20.093Z","updated_at":"2025-04-21T03:32:29.872Z","avatar_url":"https://github.com/WilliamVenner.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM](https://img.shields.io/npm/v/node-bzip2.svg)](https://www.npmjs.com/package/node-bzip2)\n\n# node-bzip2\n\nNodeJS bindings for BZip2 (libbz2).\n\nThis package will compile the BZip2 library from source and link against it, exposing functions for compressing and decompressing data using the BZip2 algorithm in NodeJS.\n\n**This package does not work on the web and is designed for use in NodeJS only.**\n\n## Installation\n\n```bash\nnpm install node-bzip2 --save\n```\n\n## Usage\n\nThe package exposes two functions: `compress` and `decompress` (and their respective async versions `compressAsync` and `decompressAsync`).\n\nBoth functions can take a `string`, [`Buffer`](https://nodejs.org/api/buffer.html), or [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays) as input and return a [`Buffer`](https://nodejs.org/api/buffer.html) containing the compressed or decompressed data.\n\nAdditional options such as compression level and buffering behavior can be passed as an optional second argument, explained in the respective functions' JSDocs.\n\n```javascript\nconst bzip2 = require('node-bzip2');\n\n// Compress some data\nconst compressedBytes = bzip2.compress('Hello, world!', { level: 9, buffering: 'auto' });\n\n// Decompress the data\nconst decompressedBytes = bzip2.decompress(compressedBytes, { small: false });\n\n// Decode the decompressed data as a UTF-8 string\nconst decompressed = (new TextDecoder('utf8')).decode(decompressedBytes);\n\nconsole.log(decompressed); // Hello, world!\n```\n\nYou can also use the async functions to compress and decompress data asynchronously:\n\n```javascript\nconst bzip2 = require('node-bzip2');\n\n// Compress some data\nconst compressedBytes = await bzip2.compressAsync('Hello, world!', { level: 9, buffering: 'auto' });\n\n// Decompress the data\nconst decompressedBytes = await bzip2.decompressAsync(compressedBytes, { small: false });\n\n// Decode the decompressed data as a UTF-8 string\nconst decompressed = (new TextDecoder('utf8')).decode(decompressedBytes);\n\nconsole.log(decompressed); // Hello, world!\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fnode-bzip2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamvenner%2Fnode-bzip2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fnode-bzip2/lists"}