{"id":20226479,"url":"https://github.com/fiahfy/packbits","last_synced_at":"2025-04-10T17:07:50.867Z","repository":{"id":33052219,"uuid":"150429028","full_name":"fiahfy/packbits","owner":"fiahfy","description":"PackBits implementation in JavaScript.","archived":false,"fork":false,"pushed_at":"2023-01-06T01:58:36.000Z","size":1216,"stargazers_count":4,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-24T13:27:49.814Z","etag":null,"topics":["encoding","packbits"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/fiahfy.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}},"created_at":"2018-09-26T13:13:41.000Z","updated_at":"2022-05-04T15:32:22.000Z","dependencies_parsed_at":"2023-01-14T23:15:14.808Z","dependency_job_id":null,"html_url":"https://github.com/fiahfy/packbits","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiahfy%2Fpackbits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiahfy%2Fpackbits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiahfy%2Fpackbits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiahfy%2Fpackbits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fiahfy","download_url":"https://codeload.github.com/fiahfy/packbits/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248260737,"owners_count":21074215,"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":["encoding","packbits"],"created_at":"2024-11-14T07:18:32.408Z","updated_at":"2025-04-10T17:07:50.848Z","avatar_url":"https://github.com/fiahfy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD024 --\u003e\n\n# packbits\n\n![badge](https://github.com/fiahfy/packbits/workflows/Node.js%20Package/badge.svg)\n\n\u003e [PackBits](https://en.wikipedia.org/wiki/PackBits) implementation in JavaScript.\n\n## Installation\n\n```bash\nnpm install @fiahfy/packbits\n```\n\n## Usage\n\n### Default\n\n#### Encoding\n\n```js\nimport { encode } from '@fiahfy/packbits'\n\nconsole.log(buf) // \u003cBuffer aa bb bb cc cc cc dd dd dd dd\u003e\nconst encoded = encode(buf)\nconsole.log(encoded) // \u003cBuffer 00 aa ff bb fe cc fd dd\u003e\n```\n\n#### Decoding\n\n```js\nimport { decode } from '@fiahfy/packbits'\n\nconsole.log(buf) // \u003cBuffer 00 aa ff bb fe cc fd dd\u003e\nconst decoded = decode(buf)\nconsole.log(decoded) // \u003cBuffer aa bb bb cc cc cc dd dd dd dd\u003e\n```\n\n### ICNS format\n\nIn [Apple Icon Image format](https://en.wikipedia.org/wiki/Apple_Icon_Image_format), pixel data are often compressed (per channel) with a format similar to PackBits.\n\n#### Encoding\n\n```js\nimport { encode } from '@fiahfy/packbits'\n\nconsole.log(buf) // \u003cBuffer aa bb bb cc cc cc dd dd dd dd\u003e\nconst encoded = encode(buf, { format: 'icns' })\nconsole.log(encoded) // \u003cBuffer 02 aa bb bb 80 cc 81 dd\u003e\n```\n\n#### Decoding\n\n```js\nimport { decode } from '@fiahfy/packbits'\n\nconsole.log(buf) // \u003cBuffer 02 aa bb bb 80 cc 81 dd\u003e\nconst decoded = decode(buf, { format: 'icns' })\nconsole.log(decoded) // \u003cBuffer aa bb bb cc cc cc dd dd dd dd\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiahfy%2Fpackbits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiahfy%2Fpackbits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiahfy%2Fpackbits/lists"}