{"id":16500839,"url":"https://github.com/manzt/numcodecs.js","last_synced_at":"2025-10-28T12:31:00.439Z","repository":{"id":47667180,"uuid":"244734373","full_name":"manzt/numcodecs.js","owner":"manzt","description":"Buffer compression and transformation codecs","archived":false,"fork":false,"pushed_at":"2024-08-14T15:16:20.000Z","size":1970,"stargazers_count":29,"open_issues_count":5,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-18T17:15:10.675Z","etag":null,"topics":["compression","javascript","wasm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/manzt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-03-03T20:25:11.000Z","updated_at":"2024-09-30T07:52:34.000Z","dependencies_parsed_at":"2023-12-18T03:27:50.340Z","dependency_job_id":"6f350e1e-fa7c-45c6-b5aa-ae3bf7f4f41f","html_url":"https://github.com/manzt/numcodecs.js","commit_stats":{"total_commits":100,"total_committers":5,"mean_commits":20.0,"dds":0.06999999999999995,"last_synced_commit":"fa8a86065ce42ca024ecee8d376a440bdd304ac1"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzt%2Fnumcodecs.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzt%2Fnumcodecs.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzt%2Fnumcodecs.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzt%2Fnumcodecs.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manzt","download_url":"https://codeload.github.com/manzt/numcodecs.js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238651162,"owners_count":19507731,"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":["compression","javascript","wasm"],"created_at":"2024-10-11T15:00:15.975Z","updated_at":"2025-10-28T12:31:00.017Z","avatar_url":"https://github.com/manzt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# numcodecs.js\n[![Actions Status](https://github.com/manzt/numcodecs.js/workflows/tests/badge.svg)](https://github.com/manzt/numcodecs.js/actions)\n[![NPM badge](https://img.shields.io/npm/v/numcodecs)](https://www.npmjs.com/package/numcodecs)\n\nBuffer compression and transformation codecs for use in [Zarr.js](https://github.com/gzuidhof/zarr.js/) and beyond...\n\n### Installation\n\n```bash\nnpm install numcodecs\n```\n\n### Usage\n\n```javascript\nimport { Blosc, GZip, Zlib, LZ4, Zstd } from 'numcodecs';\n\nconst codec = new Blosc();\n// or Blosc.fromConfig({ clevel: 5, cname: 'lz4', shuffle: Blosc.SHUFFLE, blocksize: 0 });\n\nconst size = 100000;\nconst arr = new Uint32Array(size);\nfor (let i = 0; i \u003c size; i++) {\n  arr[i] = i;\n}\n\nconst bytes = new Uint8Array(arr.buffer);\nconsole.log(bytes);\n// Uint8Array(400000) [0, 0, 0, 0,  1, 0, 0, 0,  2, 0, 0, 0, ... ]\n\nconst encoded = await codec.encode(bytes);\nconsole.log(encoded);\n// Uint8Array(3744) [2, 1, 33, 4, 128, 26, 6, 0, 0, 0, 4, 0, ... ]\n\nconst decoded = await codec.decode(encoded);\nconsole.log(new Uint32Array(decoded.buffer));\n// Uint32Array(100000) [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,  ... ]\n```\n\n### Author's note\n\nThis project is an incomplete TypeScript implementation of the buffer compression library\n[`numcodecs`](https://github.com/zarr-developers/numcodecs). The following codecs\nare currently supported:\n\n- `blosc`\n- `gzip`\n- `lz4`\n- `zlib`\n- `zstd`\n\n\n### Package exports\n\nEach compressor is bundled as the default export of separate code-split submodules.\nThis makes it easy to import each module independently in your applications or from\na ESM-friendly CDN like [skypack](https://www.skypack.dev/).\n\n- Node / bundlers\n```javascript\n// Main entry point (exports all codecs)\nimport { Zlib } from 'numcodecs';\n\n// Submodule entry point (exports only `zlib`)\nimport Zlib from 'numcodecs/zlib';\n```\n\n- Browser / Deno\n```javascript\n// Main entry point (exports all codecs)\nimport { Zlib } from 'https://cdn.skypack.dev/numcodecs';\n\n// Submodule entry point (exports only `zlib`)\nimport Zlib from 'https://cdn.skypack.dev/numcodecs/zlib';\n```\n\n### Development\n\n```bash\n$ git clone https://github.com/manzt/numcodecs.js.git\n$ cd numcodecs.js\n$ npm install \u0026\u0026 npm run test\n```\n\nThe `\u003ccodec_name\u003e.js` + `\u003ccodec_name\u003e.wasm` source for each WASM-based codec are\ngenerated with [Docker](https://www.docker.com/) with the following commands:\n\n```bash\ncd codecs/\u003ccodec_name\u003e\nnpm run build\n```\n\n### Changelogs\n\nFor changes to be reflected in package changelogs, run `npx changeset` and\nfollow the prompts.\n\n\u003e **Note** not every PR requires a changeset. Since changesets are focused on\n\u003e releases and changelogs, changes to the repository that don't effect these\n\u003e won't need a changeset (e.g., documentation, tests).\n\n### Release\n\nThe [Changesets GitHub action](https://github.com/changesets/action) will create\nand update a PR that applies changesets and publishes new versions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanzt%2Fnumcodecs.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanzt%2Fnumcodecs.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanzt%2Fnumcodecs.js/lists"}