{"_id":"fzstd","_rev":"4607760","name":"fzstd","description":"High performance Zstandard (de)compression","dist-tags":{"latest":"0.1.1"},"maintainers":[{"name":"101arrowz","email":"arjunbarrett@gmail.com"}],"time":{"modified":"2026-04-10T17:45:06.000Z","created":"2021-06-30T23:27:50.848Z","0.1.1":"2024-03-15T06:30:59.238Z","0.1.0":"2022-11-08T19:51:44.693Z","0.0.4":"2022-03-02T01:17:57.670Z","0.0.3":"2021-07-04T10:46:42.068Z","0.0.2":"2021-07-01T00:09:14.805Z","0.0.1":"2021-06-30T23:27:50.848Z"},"users":{},"author":{"name":"Arjun Barrett"},"repository":{"type":"git","url":"git+https://github.com/101arrowz/fzstd.git"},"versions":{"0.1.1":{"name":"fzstd","version":"0.1.1","description":"High performance Zstandard (de)compression","main":"./lib/index.js","module":"./esm/index.mjs","types":"./lib/index.d.ts","unpkg":"./umd/index.js","jsdelivr":"./umd/index.js","exports":{".":{"types":"./lib/index.d.ts","import":"./esm/index.mjs","require":"./lib/index.js"}},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/101arrowz/fzstd.git"},"bugs":{"url":"https://github.com/101arrowz/fzstd/issues","email":"arjunbarrett@gmail.com"},"author":{"name":"Arjun Barrett"},"license":"MIT","keywords":["compression","decompression","zstd","zstandard","browser","node.js","tiny","fast"],"scripts":{"build":"npm run build:lib","script":"node -r ts-node/register scripts/$SC.ts","build:lib":"tsc && tsc --project tsconfig.esm.json && npm run build:rewrite && npm run build:umd","build:umd":"SC=buildUMD npm run script","build:rewrite":"SC=rewriteBuilds npm run script","prepack":"npm run build"},"devDependencies":{"@types/node":"^14.11.2","terser":"^5.3.8","ts-node":"^9.0.0","typescript":"^4.1.5","zstandard-wasm":"^1.5.0-rev.2"},"_id":"fzstd@0.1.1","gitHead":"807a854cac2c5766ef030832cc5b66482dc7ca8a","homepage":"https://github.com/101arrowz/fzstd#readme","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"shasum":"a3da29f2fff45070ca90073f866d97e0c56a4a52","size":20277,"noattachment":false,"key":"/fzstd/-/fzstd-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/fzstd/download/fzstd-0.1.1.tgz"},"_npmUser":{"name":"101arrowz","email":"arjunbarrett@gmail.com"},"directories":{},"maintainers":[{"name":"101arrowz","email":"arjunbarrett@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fzstd_0.1.1_1710484259057_0.21144393445001852"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-15T06:30:59.238Z","publish_time":1710484259238,"_source_registry_name":"default","_cnpm_publish_time":1710484259238},"0.1.0":{"name":"fzstd","version":"0.1.0","description":"High performance Zstandard (de)compression","main":"./lib/index.js","module":"./esm/index.mjs","types":"./lib/index.d.ts","unpkg":"./umd/index.js","jsdelivr":"./umd/index.js","exports":{".":{"types":"./lib/index.d.ts","import":"./esm/index.mjs","require":"./lib/index.js"}},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/101arrowz/fzstd.git"},"bugs":{"url":"https://github.com/101arrowz/fzstd/issues","email":"arjunbarrett@gmail.com"},"author":{"name":"Arjun Barrett"},"license":"MIT","keywords":["compression","decompression","zstd","zstandard","browser","node.js","tiny","fast"],"scripts":{"build":"yarn build:lib","script":"node -r ts-node/register scripts/$SC.ts","build:lib":"tsc && tsc --project tsconfig.esm.json && yarn build:rewrite && yarn build:umd","build:umd":"SC=buildUMD yarn script","build:rewrite":"SC=rewriteBuilds yarn script","prepack":"yarn build"},"devDependencies":{"@types/node":"^14.11.2","terser":"^5.3.8","ts-node":"^9.0.0","typescript":"^4.1.5","zstandard-wasm":"^1.5.0-rev.2"},"gitHead":"a2fd39615acece29ed85656f5495666144609f9d","homepage":"https://github.com/101arrowz/fzstd#readme","_id":"fzstd@0.1.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"shasum":"1d7bccb5f819e2d073a15fccea1adb7fdc7a46a9","size":20213,"noattachment":false,"key":"/fzstd/-/fzstd-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fzstd/download/fzstd-0.1.0.tgz"},"_npmUser":{"name":"101arrowz","email":"arjunbarrett@gmail.com"},"directories":{},"maintainers":[{"name":"101arrowz","email":"arjunbarrett@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fzstd_0.1.0_1667937104492_0.9508812302596472"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-08T20:02:58.050Z","publish_time":1667937104693,"_cnpm_publish_time":1667937104693},"0.0.4":{"name":"fzstd","version":"0.0.4","description":"High performance Zstandard (de)compression","main":"./lib/index.js","module":"./esm/index.mjs","types":"./lib/index.d.ts","unpkg":"./umd/index.js","jsdelivr":"./umd/index.js","exports":{".":{"import":"./esm/index.mjs","require":"./lib/index.js"}},"targets":{"main":false,"module":false,"browser":false,"types":false},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/101arrowz/fzstd.git"},"bugs":{"url":"https://github.com/101arrowz/fzstd/issues","email":"arjunbarrett@gmail.com"},"author":{"name":"Arjun Barrett"},"license":"MIT","keywords":["compression","decompression","zstd","zstandard","browser","node.js","tiny","fast","non-blocking"],"scripts":{"build":"yarn build:lib","script":"node -r ts-node/register scripts/$SC.ts","build:lib":"tsc && tsc --project tsconfig.esm.json && yarn build:rewrite && yarn build:umd","build:umd":"SC=buildUMD yarn script","build:rewrite":"SC=rewriteBuilds yarn script","prepack":"yarn build"},"devDependencies":{"@types/node":"^14.11.2","@types/react":"^16.9.55","@types/react-dom":"^16.9.9","parcel":"^2.0.0-nightly.440","parcel-config-precache-manifest":"^0.0.3","preact":"^10.5.12","react":"^17.0.1","react-dom":"^17.0.1","simple-git":"^2.22.0","terser":"^5.3.8","ts-node":"^9.0.0","typedoc":"^0.17.0-3","typedoc-plugin-markdown":"^3.0.2","typescript":"^4.1.5","uvu":"^0.3.3","zstandard-wasm":"^1.5.0-rev.2"},"alias":{"react":"preact/compat","react-dom":"preact/compat","react-dom/test-utils":"preact/test-utils"},"gitHead":"eb34544a5230dbf979ac95cac84486bb1f2e0908","homepage":"https://github.com/101arrowz/fzstd#readme","_id":"fzstd@0.0.4","_nodeVersion":"16.6.2","_npmVersion":"7.20.3","dist":{"shasum":"00f63df42ee7acde2c68b2d8b7be92b6c633d629","size":20415,"noattachment":false,"key":"/fzstd/-/fzstd-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/fzstd/download/fzstd-0.0.4.tgz"},"_npmUser":{"name":"101arrowz","email":"arjunbarrett@gmail.com"},"directories":{},"maintainers":[{"name":"101arrowz","email":"arjunbarrett@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fzstd_0.0.4_1646183877398_0.5209189549431472"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-02T01:18:01.603Z","publish_time":1646183877670,"_cnpm_publish_time":1646183877670},"0.0.3":{"name":"fzstd","version":"0.0.3","description":"High performance Zstandard (de)compression","main":"./lib/index.js","module":"./esm/index.js","types":"./lib/index.d.ts","unpkg":"./umd/index.js","jsdelivr":"./umd/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"}},"targets":{"main":false,"module":false,"browser":false,"types":false},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/101arrowz/fzstd.git"},"bugs":{"url":"https://github.com/101arrowz/fzstd/issues","email":"arjunbarrett@gmail.com"},"author":{"name":"Arjun Barrett"},"license":"MIT","keywords":["compression","decompression","zstd","zstandard","browser","node.js","tiny","fast","non-blocking"],"scripts":{"build":"yarn build:lib","script":"node -r ts-node/register scripts/$SC.ts","build:lib":"tsc && tsc --project tsconfig.esm.json && yarn build:rewrite && yarn build:umd","build:umd":"SC=buildUMD yarn script","build:rewrite":"SC=rewriteBuilds yarn script","prepack":"yarn build"},"devDependencies":{"@types/node":"^14.11.2","@types/react":"^16.9.55","@types/react-dom":"^16.9.9","parcel":"^2.0.0-nightly.440","parcel-config-precache-manifest":"^0.0.3","preact":"^10.5.12","react":"^17.0.1","react-dom":"^17.0.1","simple-git":"^2.22.0","terser":"^5.3.8","ts-node":"^9.0.0","typedoc":"^0.17.0-3","typedoc-plugin-markdown":"^3.0.2","typescript":"^4.1.5","uvu":"^0.3.3","zstandard-wasm":"^1.5.0-rev.2"},"alias":{"react":"preact/compat","react-dom":"preact/compat","react-dom/test-utils":"preact/test-utils"},"gitHead":"217b797b6a111e7138f806e6261071102552172e","homepage":"https://github.com/101arrowz/fzstd#readme","_id":"fzstd@0.0.3","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"0ca738ae3751b93cbd3ab2e8d62e51fa2f0ef8b9","size":15374,"noattachment":false,"key":"/fzstd/-/fzstd-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/fzstd/download/fzstd-0.0.3.tgz"},"_npmUser":{"name":"101arrowz","email":"arjunbarrett@gmail.com"},"directories":{},"maintainers":[{"name":"101arrowz","email":"arjunbarrett@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fzstd_0.0.3_1625395601945_0.9947758147770733"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T17:38:35.937Z","publish_time":1625395602068,"_cnpm_publish_time":1625395602068},"0.0.2":{"name":"fzstd","version":"0.0.2","description":"High performance Zstandard (de)compression","main":"./lib/index.js","module":"./esm/index.js","types":"./lib/index.d.ts","unpkg":"./umd/index.js","jsdelivr":"./umd/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"}},"targets":{"main":false,"module":false,"browser":false,"types":false},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/101arrowz/fzstd.git"},"bugs":{"url":"https://github.com/101arrowz/fzstd/issues","email":"arjunbarrett@gmail.com"},"author":{"name":"Arjun Barrett"},"license":"MIT","keywords":["compression","decompression","zstd","zstandard","browser","node.js","tiny","fast","non-blocking"],"scripts":{"build":"yarn build:lib","script":"node -r ts-node/register scripts/$SC.ts","build:lib":"tsc && tsc --project tsconfig.esm.json && yarn build:rewrite && yarn build:umd","build:umd":"SC=buildUMD yarn script","build:rewrite":"SC=rewriteBuilds yarn script","prepack":"yarn build"},"devDependencies":{"@types/node":"^14.11.2","@types/react":"^16.9.55","@types/react-dom":"^16.9.9","parcel":"^2.0.0-nightly.440","parcel-config-precache-manifest":"^0.0.3","preact":"^10.5.12","react":"^17.0.1","react-dom":"^17.0.1","simple-git":"^2.22.0","terser":"^5.3.8","ts-node":"^9.0.0","typedoc":"^0.17.0-3","typedoc-plugin-markdown":"^3.0.2","typescript":"^4.1.5","uvu":"^0.3.3","zstandard-wasm":"^1.5.0-rev.2"},"alias":{"react":"preact/compat","react-dom":"preact/compat","react-dom/test-utils":"preact/test-utils"},"gitHead":"41613a08caa7ebe0a3ee93a201a2ec51726440e8","homepage":"https://github.com/101arrowz/fzstd#readme","_id":"fzstd@0.0.2","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"0a9c22faef04fff4d195259643f9eee73b935165","size":14406,"noattachment":false,"key":"/fzstd/-/fzstd-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/fzstd/download/fzstd-0.0.2.tgz"},"_npmUser":{"name":"101arrowz","email":"arjunbarrett@gmail.com"},"directories":{},"maintainers":[{"name":"101arrowz","email":"arjunbarrett@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fzstd_0.0.2_1625098154640_0.45162058226504476"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T17:38:34.576Z","publish_time":1625098154805,"_cnpm_publish_time":1625098154805},"0.0.1":{"name":"fzstd","version":"0.0.1","description":"High performance Zstandard (de)compression","main":"./lib/index.js","module":"./esm/index.js","types":"./lib/index.d.ts","unpkg":"./umd/index.js","jsdelivr":"./umd/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"}},"targets":{"main":false,"module":false,"browser":false,"types":false},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/101arrowz/fzstd.git"},"bugs":{"url":"https://github.com/101arrowz/fzstd/issues","email":"arjunbarrett@gmail.com"},"author":{"name":"Arjun Barrett"},"license":"MIT","keywords":["compression","decompression","zstd","zstandard","browser","node.js","tiny","fast","non-blocking"],"scripts":{"build":"yarn build:lib","script":"node -r ts-node/register scripts/$SC.ts","build:lib":"tsc && tsc --project tsconfig.esm.json && yarn build:rewrite && yarn build:umd","build:umd":"SC=buildUMD yarn script","build:rewrite":"SC=rewriteBuilds yarn script","prepack":"yarn build"},"devDependencies":{"@types/node":"^14.11.2","@types/react":"^16.9.55","@types/react-dom":"^16.9.9","parcel":"^2.0.0-nightly.440","parcel-config-precache-manifest":"^0.0.3","preact":"^10.5.12","react":"^17.0.1","react-dom":"^17.0.1","simple-git":"^2.22.0","terser":"^5.3.8","ts-node":"^9.0.0","typedoc":"^0.17.0-3","typedoc-plugin-markdown":"^3.0.2","typescript":"^4.1.5","uvu":"^0.3.3","zstandard-wasm":"^1.5.0-rev.2"},"alias":{"react":"preact/compat","react-dom":"preact/compat","react-dom/test-utils":"preact/test-utils"},"gitHead":"dc12ec681c06d3613d8e52ff874cf3ecbd5d6be9","homepage":"https://github.com/101arrowz/fzstd#readme","_id":"fzstd@0.0.1","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"79cd948dbc986eb1114dbfa2423c8b41cfb8550e","size":12882,"noattachment":false,"key":"/fzstd/-/fzstd-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/fzstd/download/fzstd-0.0.1.tgz"},"_npmUser":{"name":"101arrowz","email":"arjunbarrett@gmail.com"},"directories":{},"maintainers":[{"name":"101arrowz","email":"arjunbarrett@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fzstd_0.0.1_1625095670743_0.07431987675450347"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T17:38:33.489Z","publish_time":1625095670848,"_cnpm_publish_time":1625095670848}},"readme":"# fzstd\nHigh performance Zstandard decompression in a pure JavaScript, 8kB package\n\n## Usage\n\nImport:\n```js\n// I will assume that you use the following for the rest of this guide\nimport * as fzstd from 'fzstd';\n```\n\nIf your environment doesn't support ES Modules (e.g. Node.js):\n```js\nconst fzstd = require('fzstd');\n```\n\nIf you want to load from a CDN in the browser:\n```html\n<!--\nYou should use either UNPKG or jsDelivr (i.e. only one of the following)\n\nYou may also want to specify the version, e.g. with fzstd@0.01\n-->\n<script src=\"https://unpkg.com/fzstd\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/fzstd/umd/index.js\"></script>\n<!-- Now, the global variable fzstd contains the library -->\n\n<!-- If you're going buildless but want ESM, import from Skypack -->\n<script type=\"module\">\n  import * as fzstd from 'https://cdn.skypack.dev/fzstd?min';\n</script>\n```\n\nIf you are using Deno:\n```js\n// Don't use the ?dts Skypack flag; it isn't necessary for Deno support\n// The @deno-types comment adds TypeScript typings\n\n// @deno-types=\"https://cdn.skypack.dev/fzstd/lib/index.d.ts\"\nimport * as fzstd from 'https://cdn.skypack.dev/fzstd?min';\n```\n\nAnd use:\n```js\n// This is an ArrayBuffer of data\nconst compressedBuf = await fetch('/compressedData.zst').then(\n  res => res.arrayBuffer()\n);\n// To use fzstd, you need a Uint8Array\nconst compressed = new Uint8Array(compressedBuf);\n// Note that Node.js Buffers work just fine as well:\n// const massiveFile = require('fs').readFileSync('aMassiveFile.txt');\n\nconst decompressed = fzstd.decompress(compressed);\n\n// Second argument is optional: custom output buffer\nconst outBuf = new Uint8Array(100000);\n// IMPORTANT: fzstd will assume the buffer is sufficiently sized, so it\n// will yield corrupt data if the buffer is too small. It is highly\n// recommended to only specify this if you know the maximum output size.\nfzstd.decompress(compressed, outBuf);\n```\n\nYou can also use data streams to minimize memory usage while decompressing.\n```js\nlet outChunks = [];\nconst stream = new fzstd.Decompress((chunk, isLast) => {\n  // Add to list of output chunks\n  outChunks.push(chunk);\n  // Log after all chunks decompressed\n  if (isLast) {\n    console.log('Output chunks:', outChunks);\n  }\n});\n\n// You can also attach the data handler separately if you don't want to\n// do so in the constructor.\nstream.ondata = (chunk, final) => { ... }\n\n// Since this is synchronous, all errors will be thrown by stream.push()\nstream.push(chunk1);\nstream.push(chunk2);\n...\n// Last chunk must have the second parameter true\nstream.push(chunkLast, true);\n\n// Alternatively, you can push every data chunk normally and push an empty\n// chunk at the end:\n// stream.push(chunkLast);\n// stream.push(new Uint8Array(0), true);\n```\n\n## Considerations\nUnlike my Zlib implementation [`fflate`](https://github.com/101arrowz/fflate), WebAssembly ports of Zstandard are usually significantly (40-50%) faster than `fzstd`. However, they fail to decompress most archives without the decompressed size provided in advance. Moreover, they do not support streaming and thereby allocate a large amount of memory that cannot be freed. Lastly, `fzstd` is absolutely tiny: at 8kB minified and 3.8kB after gzipping, it's much smaller than most WASM implementations.\n\nPlease note that unlike the reference implementation, `fzstd` only supports a maximum backreference distance of 2<sup>25</sup> bytes. If you need to decompress files with an \"ultra\" compression level (20 or greater) AND if your files can be above 32MB decompressed, `fzstd` *might* fail to decompress properly. Consider using a WebAssembly port for files this large (though this may be difficult if you don't know the decompressed size).","_attachments":{},"homepage":"https://github.com/101arrowz/fzstd#readme","bugs":{"url":"https://github.com/101arrowz/fzstd/issues","email":"arjunbarrett@gmail.com"},"license":"MIT"}