{"id":18733153,"url":"https://github.com/bioforestchain/zstd-wasm","last_synced_at":"2026-03-01T23:03:01.210Z","repository":{"id":256357031,"uuid":"822444008","full_name":"BioforestChain/zstd-wasm","owner":"BioforestChain","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-22T09:24:34.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-12T18:46:28.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BioforestChain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-01T07:02:11.000Z","updated_at":"2025-01-23T16:30:00.000Z","dependencies_parsed_at":"2024-09-10T09:45:51.271Z","dependency_job_id":"ff137e26-f6cd-4b32-892d-ff8e9dc3d3bd","html_url":"https://github.com/BioforestChain/zstd-wasm","commit_stats":null,"previous_names":["bioforestchain/zstd-wasm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BioforestChain/zstd-wasm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioforestChain%2Fzstd-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioforestChain%2Fzstd-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioforestChain%2Fzstd-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioforestChain%2Fzstd-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BioforestChain","download_url":"https://codeload.github.com/BioforestChain/zstd-wasm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioforestChain%2Fzstd-wasm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29987656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T22:42:38.399Z","status":"ssl_error","status_checked_at":"2026-03-01T22:41:51.863Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-07T15:08:52.759Z","updated_at":"2026-03-01T23:03:01.195Z","avatar_url":"https://github.com/BioforestChain.png","language":"TypeScript","readme":"# zstd-wasm\n\nbuild with [zstd-rs](https://github.com/gyscos/zstd-rs)\n\n## how to use within vite\n\n1. fetch wasm file\n\n   \u003e Vite will automatically pack the wasm file into the `dist/assets` folder. On the website, it will download this wasm file using network.\n\n   ```ts\n   import init, { compress, decompress } from \"@dweb-browser/zstd-wasm\";\n   import zstd_wasm_url from \"@dweb-browser/zstd-wasm/zstd_wasm_bg.wasm?url\";\n   // Modern browsers can directly use `await init(zstd_wasm_url);`\n   init(zstd_wasm_url).then(() =\u003e {\n     /// compress or decompress\n     const output = compress(new Uint8Array(100), 10);\n     const input = decompress(output);\n     console.log(input, output);\n   });\n   ```\n\n1. bundle wasm into js with base64 encoding\n\n   ```ts\n   import { compress, decompress, initSync } from \"@dweb-browser/zstd-wasm\";\n   import get_zstd_wasm_binary from \"@dweb-browser/zstd-wasm/zstd_wasm_bg_wasm\";\n   initSync(get_zstd_wasm_binary());\n\n   /// compress or decompress\n   ```\n\n## how to use in nodejs\n\n1. commonjs\n\n   ```ts\n   const { compress, decompress } = require(\"@dweb-browser/zstd-wasm\");\n\n   /// compress or decompress\n   ```\n\n1. esmodule\n\n   ```ts\n   import fs from \"node:fs\";\n   import url from \"node:url\";\n   import { compress, decompress, initSync } from \"@dweb-browser/zstd-wasm\";\n   const zstd_wasm_binary = fs.readFileSync(\n     url.fileURLToPath(\n       import.meta.resolve(\"@dweb-browser/zstd-wasm/zstd_wasm_bg.wasm\")\n     )\n   );\n\n   initSync({ module: zstd_wasm_binary });\n\n   /// compress or decompress\n   ```\n\n## how to use in deno\n\n```ts\nimport { compress, decompress, initSync } from \"@dweb-browser/zstd-wasm\";\nimport zstd_wasm_binary from \"@dweb-browser/zstd-wasm/zstd_wasm_bg_wasm\";\ninitSync(get_zstd_wasm_binary());\n\n/// compress or decompress\nconst output = compress(new Uint8Array(100), 10);\nconst input = decompress(output);\nconsole.log(input, output);\n```\n\n## how to build\n\n1. read https://github.com/gyscos/zstd-rs/wiki/Compile-for-WASM\n1. install [wasm-bindgen]() `cargo install wasm-bindgen-cli`\n   \u003e checkout `wasm-bindgen -V` shoule equals the value in [cargo.toml](./cargo.toml)\n1. install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)\n1. install [esbuild](https://esbuild.github.io/getting-started/#install-esbuild) `npm install -g esbuild`\n1. install [deno](https://deno.com/)\n   ```\n   curl -fsSL https://deno.land/install.sh | sh # macos or linux\n   irm https://deno.land/install.ps1 | iex # windows\n   ```\n1. run script: `deno task build`\n   \u003e output to [pkg](./pkg) folder\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbioforestchain%2Fzstd-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbioforestchain%2Fzstd-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbioforestchain%2Fzstd-wasm/lists"}