├── test ├── hello ├── hello.zst ├── json-dict ├── __snapshots__ │ ├── simple-compress.test.ts.snap │ └── simple-decompress.test.ts.snap ├── simple-compress.test.ts ├── largefile.test.ts ├── compress_using_dict.test.ts └── simple-decompress.test.ts ├── export_module.js ├── renovate.json ├── deno ├── zstd.wasm ├── zstd.test.ts ├── zstd.ts └── zstd.deno.js ├── lib ├── zstd.wasm ├── module.ts ├── index.web.ts ├── errors │ └── index.ts ├── index.node.ts ├── simple │ ├── compress.ts │ ├── decompress_using_dict.ts │ ├── decompress.ts │ └── compress_using_dict.ts └── zstd.ts ├── .github ├── FUNDING.yml └── workflows │ └── ci.yml ├── benchmark ├── example.html.zst ├── index.ts └── example.html ├── examples ├── node-esm-dict │ ├── json-dict │ ├── package.json │ ├── yarn.lock │ └── index.mjs ├── node-common │ ├── package.json │ ├── index.js │ └── yarn.lock ├── node-esm │ ├── package.json │ ├── index.js │ └── yarn.lock ├── vite │ ├── vite.config.js │ ├── .gitignore │ ├── index.html │ ├── package.json │ ├── tsconfig.json │ ├── src │ │ └── main.ts │ └── yarn.lock ├── deno │ └── index.ts ├── webpack4 │ ├── package.json │ ├── webpack.config.js │ └── index.js └── webpack5 │ ├── package.json │ ├── index.js │ └── webpack.config.js ├── jest.config.js ├── .prettierrc.js ├── tsconfig.json ├── tsconfig.web.json ├── tsconfig.node.esm.json ├── tsconfig.node.common.json ├── CHANGELOG.md ├── tools └── deno.js ├── package.json ├── .gitignore └── README.md /test/hello: -------------------------------------------------------------------------------- 1 | hello -------------------------------------------------------------------------------- /export_module.js: -------------------------------------------------------------------------------- 1 | module.exports = Module; 2 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /deno/zstd.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokuweb/zstd-wasm/HEAD/deno/zstd.wasm -------------------------------------------------------------------------------- /lib/zstd.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokuweb/zstd-wasm/HEAD/lib/zstd.wasm -------------------------------------------------------------------------------- /test/hello.zst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokuweb/zstd-wasm/HEAD/test/hello.zst -------------------------------------------------------------------------------- /test/json-dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokuweb/zstd-wasm/HEAD/test/json-dict -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [bokuweb] 4 | -------------------------------------------------------------------------------- /benchmark/example.html.zst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokuweb/zstd-wasm/HEAD/benchmark/example.html.zst -------------------------------------------------------------------------------- /examples/node-esm-dict/json-dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokuweb/zstd-wasm/HEAD/examples/node-esm-dict/json-dict -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testMatch: ['**/test/**/?(*.)+(spec|test).+(ts|tsx|js)'], 3 | transform: { 4 | '^.+\\.(ts|tsx)$': 'ts-jest', 5 | }, 6 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], 7 | }; 8 | -------------------------------------------------------------------------------- /examples/node-common/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-common", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "dependencies": { 7 | "@bokuweb/zstd-wasm": "0.0.21-alpha.5" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/node-esm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-common", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "type": "module", 7 | "dependencies": { 8 | "@bokuweb/zstd-wasm": "0.0.21-alpha.5" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/node-esm-dict/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-common", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "type": "module", 7 | "dependencies": { 8 | "@bokuweb/zstd-wasm": "0.0.21-alpha.3" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/vite/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | 3 | export default defineConfig({ 4 | optimizeDeps: { 5 | exclude: ['@bokuweb/zstd-wasm'], 6 | esbuildOptions: { 7 | target: 'es2020', 8 | }, 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | printWidth: 120, 3 | tabWidth: 2, 4 | useTabs: false, 5 | semi: true, 6 | singleQuote: true, 7 | trailingComma: "all", 8 | bracketSpacing: true, 9 | arrowParens: "always", 10 | parser: "typescript", 11 | }; 12 | -------------------------------------------------------------------------------- /examples/node-esm/index.js: -------------------------------------------------------------------------------- 1 | import { init, compress, decompress } from '@bokuweb/zstd-wasm'; 2 | 3 | (async () => { 4 | await init(); 5 | const compressed = compress(Buffer.from('Hello zstd!!'), 10); 6 | const res = decompress(compressed); 7 | console.log(Buffer.from(res).toString()); 8 | })(); 9 | -------------------------------------------------------------------------------- /lib/module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from './zstd'; 2 | 3 | const initialized = (() => 4 | new Promise((resolve) => { 5 | Module.onRuntimeInitialized = resolve; 6 | }))(); 7 | 8 | export const waitInitialized = async () => { 9 | await initialized; 10 | }; 11 | 12 | export { Module }; 13 | -------------------------------------------------------------------------------- /examples/node-common/index.js: -------------------------------------------------------------------------------- 1 | const { init, compress, decompress } = require('@bokuweb/zstd-wasm'); 2 | 3 | (async () => { 4 | await init(); 5 | const compressed = compress(Buffer.from('Hello zstd!!'), 10); 6 | const res = decompress(compressed); 7 | console.log(Buffer.from(res).toString()); 8 | })(); 9 | -------------------------------------------------------------------------------- /test/__snapshots__/simple-compress.test.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`hello 1`] = ` 4 | Uint8Array [ 5 | 40, 6 | 181, 7 | 47, 8 | 253, 9 | 32, 10 | 5, 11 | 41, 12 | 0, 13 | 0, 14 | 72, 15 | 101, 16 | 108, 17 | 108, 18 | 111, 19 | ] 20 | `; 21 | -------------------------------------------------------------------------------- /examples/vite/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /examples/deno/index.ts: -------------------------------------------------------------------------------- 1 | import { init, decompress, compress } from 'https://deno.land/x/zstd_wasm/deno/zstd.ts'; 2 | 3 | await init(); 4 | const encoder = new TextEncoder(); 5 | const buffer = encoder.encode('Hello World'); 6 | const compressed = compress(buffer, 10); 7 | const decompressed = decompress(compressed); 8 | const decoder = new TextDecoder(); 9 | console.log(decoder.decode(decompressed)); 10 | -------------------------------------------------------------------------------- /examples/vite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/node-common/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@bokuweb/zstd-wasm@0.0.21-alpha.5": 6 | version "0.0.21-alpha.5" 7 | resolved "https://registry.yarnpkg.com/@bokuweb/zstd-wasm/-/zstd-wasm-0.0.21-alpha.5.tgz#e8f8732b639f727fec48fa6516e575aff685cd73" 8 | integrity sha512-HydRNavt4rlQH3sbAG1iksR9V9+AsxfAXSzG5zRoksFn0f+yq8VqJ/BFp5MdcGt6lzNdELDiCOjKvJ3NpSc+Qw== 9 | -------------------------------------------------------------------------------- /examples/node-esm/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@bokuweb/zstd-wasm@0.0.21-alpha.5": 6 | version "0.0.21-alpha.5" 7 | resolved "https://registry.yarnpkg.com/@bokuweb/zstd-wasm/-/zstd-wasm-0.0.21-alpha.5.tgz#e8f8732b639f727fec48fa6516e575aff685cd73" 8 | integrity sha512-HydRNavt4rlQH3sbAG1iksR9V9+AsxfAXSzG5zRoksFn0f+yq8VqJ/BFp5MdcGt6lzNdELDiCOjKvJ3NpSc+Qw== 9 | -------------------------------------------------------------------------------- /examples/node-esm-dict/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@bokuweb/zstd-wasm@0.0.21-alpha.3": 6 | version "0.0.21-alpha.3" 7 | resolved "https://registry.yarnpkg.com/@bokuweb/zstd-wasm/-/zstd-wasm-0.0.21-alpha.3.tgz#02bce4812cafb889e0aca83e89a211b22d1f3d05" 8 | integrity sha512-20usfEAKRaNzF5jJ1nb3hKB8PYMoDEN9hZpr2JL6KXM/Jp6+u2AyiYwNZ0XBCK02Pj5AnaN6FtPZ1OK+zcVneQ== 9 | -------------------------------------------------------------------------------- /test/simple-compress.test.ts: -------------------------------------------------------------------------------- 1 | import { decompress } from '../lib/simple/decompress'; 2 | import { compress } from '../lib/simple/compress'; 3 | import { init } from '../lib/index.node'; 4 | 5 | test('hello', async () => { 6 | await init(); 7 | const compressed = compress(Buffer.from('Hello'), 10); 8 | expect(compressed).toMatchSnapshot(); 9 | const decompressed = decompress(compressed); 10 | expect(Buffer.from(decompressed).toString()).toBe('Hello'); 11 | }); 12 | -------------------------------------------------------------------------------- /lib/index.web.ts: -------------------------------------------------------------------------------- 1 | import { Module, waitInitialized } from './module'; 2 | 3 | export const init = async (path?: string) => { 4 | // @ts-ignore 5 | const url = new URL(`./zstd.wasm`, import.meta.url).href; 6 | Module['init'](path ?? url); 7 | await waitInitialized(); 8 | }; 9 | 10 | export * from './simple/decompress'; 11 | export * from './simple/compress'; 12 | 13 | export * from './simple/decompress_using_dict'; 14 | export * from './simple/compress_using_dict'; 15 | -------------------------------------------------------------------------------- /lib/errors/index.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '../module'; 2 | 3 | export const isError = (code: number): number => { 4 | const _isError = Module['_ZSTD_isError']; 5 | return _isError(code); 6 | }; 7 | 8 | // @See https://github.com/facebook/zstd/blob/12c045f74d922dc934c168f6e1581d72df983388/lib/common/error_private.c#L24-L53 9 | // export const getErrorName = (code: number): string => { 10 | // const _getErrorName = Module.cwrap('ZSTD_getErrorName', 'string', ['number']); 11 | // return _getErrorName(code); 12 | // }; 13 | -------------------------------------------------------------------------------- /lib/index.node.ts: -------------------------------------------------------------------------------- 1 | import { Module, waitInitialized } from './module'; 2 | 3 | export const init = async () => { 4 | const { readFile } = require('fs/promises'); 5 | const { resolve } = require('path'); 6 | const buf = await readFile(resolve(__dirname, './zstd.wasm')); 7 | Module['init'](buf); 8 | await waitInitialized(); 9 | }; 10 | 11 | export * from './simple/decompress'; 12 | export * from './simple/compress'; 13 | 14 | export * from './simple/decompress_using_dict'; 15 | export * from './simple/compress_using_dict'; 16 | -------------------------------------------------------------------------------- /examples/vite/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "devDependencies": { 12 | "@rollup/pluginutils": "^5.1.0", 13 | "buffer": "^6.0.3", 14 | "typescript": "^5.7", 15 | "vite": "^5.4.1", 16 | "vite-plugin-wasm": "^3.3.0", 17 | "@bokuweb/zstd-wasm": "0.0.21-alpha.5" 18 | }, 19 | "dependencies": { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/largefile.test.ts: -------------------------------------------------------------------------------- 1 | import { readFile } from 'fs/promises'; 2 | import { resolve } from 'path'; 3 | 4 | import { decompress } from '../lib/simple/decompress'; 5 | import { compress } from '../lib/simple/compress'; 6 | import { init } from '../lib/index.node'; 7 | 8 | test('largefile', async () => { 9 | await init(); 10 | const buf = await readFile(resolve(__dirname, './large-file')); 11 | const compressed = compress(buf, 10); 12 | const decompressed = decompress(compressed); 13 | expect(buf.equals(Buffer.from(decompressed))).toBeTruthy(); 14 | }); 15 | -------------------------------------------------------------------------------- /deno/zstd.test.ts: -------------------------------------------------------------------------------- 1 | import { assertEquals } from 'https://deno.land/std@0.65.0/testing/asserts.ts'; 2 | 3 | import { init, decompress, compress } from './zstd.ts'; 4 | 5 | Deno.test({ 6 | name: 'Hello zstd', 7 | fn: async () => { 8 | await init(); 9 | const encoder = new TextEncoder(); 10 | const buffer = encoder.encode('Hello World'); 11 | const compressed = compress(buffer, 10); 12 | const decompressed = decompress(compressed); 13 | const decoder = new TextDecoder(); 14 | assertEquals(decoder.decode(decompressed), 'Hello World'); 15 | }, 16 | }); 17 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "NodeNext", 5 | "moduleResolution": "NodeNext", 6 | "noEmit": true, 7 | "strict": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "noImplicitReturns": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "noUncheckedIndexedAccess": true, 13 | "noImplicitOverride": true, 14 | "noPropertyAccessFromIndexSignature": true, 15 | "esModuleInterop": true, 16 | "skipLibCheck": true, 17 | "forceConsistentCasingInFileNames": true 18 | }, 19 | "exclude": ["examples", "deno"] 20 | } 21 | -------------------------------------------------------------------------------- /examples/vite/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "isolatedModules": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | 16 | /* Linting */ 17 | "strict": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "noFallthroughCasesInSwitch": true 21 | }, 22 | "include": ["src"] 23 | } 24 | -------------------------------------------------------------------------------- /examples/webpack4/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webpack4-example", 3 | "version": "0.0.14", 4 | "repository": "ssh://git@github.com/bokuweb/zstd-wasm.git", 5 | "author": "", 6 | "license": "MIT", 7 | "scripts": { 8 | "serve": "webpack-dev-server" 9 | }, 10 | "devDependencies": { 11 | "@types/node": "15.6.1", 12 | "file-loader": "6.2.0", 13 | "html-webpack-plugin": "3.2.0", 14 | "text-encoding": "0.7.0", 15 | "webpack": "4.46.0", 16 | "webpack-cli": "3.3.12", 17 | "webpack-dev-server": "3.11.2" 18 | }, 19 | "dependencies": { 20 | "@bokuweb/zstd-wasm": "^0.0.14" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /examples/webpack4/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 3 | 4 | module.exports = { 5 | entry: { 6 | index: [path.resolve(__dirname, 'index.js')], 7 | }, 8 | output: { 9 | path: path.resolve(__dirname, 'dist'), 10 | filename: 'index.js', 11 | }, 12 | module: { 13 | rules: [ 14 | { 15 | test: /zstd\.wasm$/, 16 | type: 'javascript/auto', 17 | loader: 'file-loader', 18 | }, 19 | ], 20 | }, 21 | resolve: { 22 | extensions: ['.ts', '.js', '.wasm'], 23 | }, 24 | plugins: [new HtmlWebpackPlugin()], 25 | mode: 'development' 26 | }; 27 | -------------------------------------------------------------------------------- /examples/node-esm-dict/index.mjs: -------------------------------------------------------------------------------- 1 | import { init, decompressUsingDict, createDCtx, compressUsingDict, createCCtx } from '@bokuweb/zstd-wasm'; 2 | import { readFile } from 'fs/promises'; 3 | import { resolve, dirname } from 'path'; 4 | 5 | (async () => { 6 | await init(); 7 | const buf = Buffer.from('Hello zstd!!'); 8 | const dir = dirname(new URL(import.meta.url).pathname) 9 | const dict = await readFile(resolve(dir, './json-dict')); 10 | const compressed = compressUsingDict(createCCtx(), buf, dict, 10); 11 | const decompressed = decompressUsingDict(createDCtx(), compressed, dict); 12 | const res = Buffer.from(decompressed).toString(); 13 | console.info(res) 14 | })(); 15 | -------------------------------------------------------------------------------- /tsconfig.web.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "ESNext", 5 | "moduleResolution": "node", 6 | "strict": true, 7 | "noUnusedLocals": true, 8 | "noUnusedParameters": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "noUncheckedIndexedAccess": true, 12 | "noImplicitOverride": true, 13 | "noPropertyAccessFromIndexSignature": true, 14 | "esModuleInterop": true, 15 | "skipLibCheck": true, 16 | "sourceMap": true, 17 | "outDir": "dist/web", 18 | "declaration": true, 19 | "forceConsistentCasingInFileNames": true 20 | }, 21 | "exclude": ["examples", "benchmark", "test", "deno"] 22 | } 23 | -------------------------------------------------------------------------------- /tsconfig.node.esm.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "esNext", 5 | "moduleResolution": "node", 6 | "strict": true, 7 | "noUnusedLocals": true, 8 | "noUnusedParameters": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "noUncheckedIndexedAccess": true, 12 | "noImplicitOverride": true, 13 | "noPropertyAccessFromIndexSignature": true, 14 | "esModuleInterop": true, 15 | "skipLibCheck": true, 16 | "sourceMap": true, 17 | "outDir": "dist/esm", 18 | "declaration": true, 19 | "forceConsistentCasingInFileNames": true 20 | }, 21 | "exclude": ["examples", "benchmark", "test", "deno"] 22 | } 23 | -------------------------------------------------------------------------------- /examples/webpack5/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webpack5-example", 3 | "version": "0.0.14", 4 | "repository": "ssh://git@github.com/bokuweb/zstd-wasm.git", 5 | "author": "", 6 | "license": "MIT", 7 | "scripts": { 8 | "serve": "webpack-cli serve --config webpack.config.js" 9 | }, 10 | "devDependencies": { 11 | "@types/node": "16.4.4", 12 | "buffer": "^6.0.3", 13 | "file-loader": "6.2.0", 14 | "html-webpack-plugin": "5.3.2", 15 | "text-encoding": "0.7.0", 16 | "ts-loader": "^9.5.1", 17 | "webpack": "5.47.0", 18 | "webpack-cli": "4.7.2", 19 | "webpack-dev-server": "3.11.2" 20 | }, 21 | "dependencies": { 22 | "@bokuweb/zstd-wasm": "0.0.21-alpha.5" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tsconfig.node.common.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "strict": true, 7 | "noUnusedLocals": true, 8 | "noUnusedParameters": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "noUncheckedIndexedAccess": true, 12 | "noImplicitOverride": true, 13 | "noPropertyAccessFromIndexSignature": true, 14 | "esModuleInterop": true, 15 | "skipLibCheck": true, 16 | "sourceMap": true, 17 | "outDir": "dist/common", 18 | "declaration": true, 19 | "forceConsistentCasingInFileNames": true 20 | }, 21 | "exclude": ["examples", "benchmark", "test", "deno", "lib/index.web.ts"] 22 | } 23 | -------------------------------------------------------------------------------- /examples/webpack4/index.js: -------------------------------------------------------------------------------- 1 | import { init, compress, decompress } from '@bokuweb/zstd-wasm'; 2 | 3 | (async () => { 4 | const compressAndDecompressTest = () => { 5 | const compressed = compress(Buffer.from('Hello zstd!!'), 10); 6 | const res = decompress(compressed); 7 | const str = Buffer.from(res).toString(); 8 | if (str !== 'Hello zstd!!') throw new Error('Failed to compressAndDecompressTest by zstd.'); 9 | console.log(`%c${str}`, 'color: lightgreen;'); 10 | console.log('%cSucceeded to compressAndDecompressTest.', 'color: lightgreen;'); 11 | }; 12 | await init(); 13 | compressAndDecompressTest(); 14 | document.body.innerText = 'Succeeded'; 15 | })().catch((e) => { 16 | document.body.innerText = 'Failed'; 17 | }); 18 | -------------------------------------------------------------------------------- /examples/webpack5/index.js: -------------------------------------------------------------------------------- 1 | import { init, compress, decompress } from '@bokuweb/zstd-wasm'; 2 | 3 | (async () => { 4 | const compressAndDecompressTest = () => { 5 | const compressed = compress(Buffer.from('Hello zstd!!'), 10); 6 | const res = decompress(compressed); 7 | const str = Buffer.from(res).toString(); 8 | if (str !== 'Hello zstd!!') throw new Error('Failed to compressAndDecompressTest by zstd.'); 9 | console.log(`%c${str}`, 'color: lightgreen;'); 10 | console.log('%cSucceeded to compressAndDecompressTest.', 'color: lightgreen;'); 11 | }; 12 | await init(); 13 | compressAndDecompressTest(); 14 | document.body.innerText = 'Succeeded'; 15 | })().catch((e) => { 16 | document.body.innerText = 'Failed'; 17 | }); 18 | -------------------------------------------------------------------------------- /benchmark/index.ts: -------------------------------------------------------------------------------- 1 | import * as Benchmark from 'benchmark'; 2 | import { readFileSync } from 'fs'; 3 | 4 | import { decompress } from '../lib/simple/decompress'; 5 | import { compress } from '../lib/simple/compress'; 6 | 7 | const suite = new Benchmark.Suite(); 8 | 9 | const html = readFileSync('./benchmark/example.html'); 10 | const zst = readFileSync('./benchmark/example.html.zst'); 11 | 12 | console.log(html.byteLength); 13 | console.log(zst.byteLength); 14 | 15 | suite 16 | .add('compress level 10', async () => { 17 | await compress(html, 10); 18 | }) 19 | .add('decompress', async () => { 20 | await decompress(zst); 21 | }) 22 | .on('cycle', (event: any) => { 23 | console.log(String(event.target)); 24 | }) 25 | .run({ async: true }); 26 | -------------------------------------------------------------------------------- /test/compress_using_dict.test.ts: -------------------------------------------------------------------------------- 1 | import { readFile } from 'fs/promises'; 2 | import { resolve } from 'path'; 3 | 4 | import { decompressUsingDict, createDCtx } from '../lib/simple/decompress_using_dict'; 5 | import { compressUsingDict, createCCtx } from '../lib/simple/compress_using_dict'; 6 | import { init } from '../lib/index.node'; 7 | 8 | test('using dict', async () => { 9 | await init(); 10 | const buf = await readFile(resolve(__dirname, './mock/mock.json')); 11 | const dict = await readFile(resolve(__dirname, './json-dict')); 12 | const compressed = compressUsingDict(createCCtx(), buf, dict, 10); 13 | const decompressed = decompressUsingDict(createDCtx(), compressed, dict); 14 | expect(buf.toString()).toBe(Buffer.from(decompressed).toString()); 15 | }); 16 | -------------------------------------------------------------------------------- /examples/vite/src/main.ts: -------------------------------------------------------------------------------- 1 | import { Buffer } from 'buffer'; 2 | import { init, compress, decompress } from '@bokuweb/zstd-wasm'; 3 | 4 | (async () => { 5 | const compressAndDecompressTest = () => { 6 | const compressed = compress(Buffer.from('Hello zstd!!'), 10); 7 | const res = decompress(compressed); 8 | const str = Buffer.from(res).toString(); 9 | if (str !== 'Hello zstd!!') throw new Error('Failed to compressAndDecompressTest by zstd.'); 10 | console.log(`%c${str}`, 'color: lightgreen;'); 11 | console.log('%cSucceeded to compressAndDecompressTest.', 'color: lightgreen;'); 12 | }; 13 | await init(); 14 | compressAndDecompressTest(); 15 | document.body.innerText = 'Succeeded'; 16 | })().catch((e) => { 17 | console.error(e); 18 | document.body.innerText = 'Failed'; 19 | }); 20 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## 0.0.27 (17. Feb, 2025) 9 | 10 | - use emsdk 3.1.74 11 | 12 | ## 0.0.26 (4. Feb, 2025) 13 | 14 | - use zstd v1.5.6 15 | 16 | ## 0.0.22 (13. Dec, 2024) 17 | 18 | - update ArrayBuffer types. 19 | 20 | ## 0.0.20 (9. Apr, 2023) 21 | 22 | - use zstd v1.5.5 23 | 24 | ## 0.0.19 (11. Mar, 2023) 25 | 26 | - Fixed issue #104: RuntimeError: memory access out of bounds 27 | 28 | ## 0.0.17 (11. July, 2022) 29 | 30 | - expose dictionary API 31 | 32 | ## 0.0.16 (2. January, 2022) 33 | 34 | - Support simple dictionary API 35 | 36 | ## 0.0.15 (2. January, 2022) 37 | 38 | - Use zstd1.5.1 and emscripten3.1.0 39 | -------------------------------------------------------------------------------- /examples/webpack5/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const webpack = require('webpack'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | 5 | module.exports = [ 6 | { 7 | entry: { 8 | index: [path.resolve(__dirname, 'index.js')], 9 | }, 10 | output: { 11 | path: path.resolve(__dirname, 'dist'), 12 | filename: 'index.js', 13 | }, 14 | module: { 15 | rules: [ 16 | { 17 | test: /\.ts$/, 18 | loader: 'ts-loader', 19 | options: { 20 | transpileOnly: true, 21 | }, 22 | }, 23 | { 24 | test: /zstd\.wasm/, 25 | type: 'asset/resource', 26 | }, 27 | ], 28 | }, 29 | resolve: { 30 | extensions: ['.ts', '.js', '.wasm'], 31 | }, 32 | plugins: [ 33 | new HtmlWebpackPlugin(), 34 | new webpack.ProvidePlugin({ 35 | Buffer: ['buffer', 'Buffer'], 36 | }), 37 | ], 38 | mode: 'development', 39 | }, 40 | ]; 41 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | tsc: 6 | runs-on: ubuntu-20.04 7 | steps: 8 | - uses: actions/checkout@master 9 | - uses: actions/setup-node@master 10 | with: 11 | node-version: 18 12 | - name: yarn 13 | run: yarn --frozen-lockfile 14 | - name: tsc 15 | run: yarn tsc 16 | 17 | test: 18 | runs-on: ubuntu-20.04 19 | steps: 20 | - uses: actions/checkout@master 21 | - uses: actions/setup-node@master 22 | with: 23 | node-version: 18 24 | - name: yarn 25 | run: yarn --frozen-lockfile 26 | - name: test 27 | run: yarn test 28 | 29 | deno: 30 | runs-on: ubuntu-20.04 31 | steps: 32 | - uses: actions/checkout@master 33 | - uses: denoland/setup-deno@v1 34 | with: 35 | deno-version: v1.x 36 | - name: run example 37 | run: deno test deno 38 | - name: test 39 | run: deno test deno -------------------------------------------------------------------------------- /test/simple-decompress.test.ts: -------------------------------------------------------------------------------- 1 | import { decompress } from '../lib/simple/decompress'; 2 | import { init } from '../lib/index.node'; 3 | 4 | test('decompress multiple json', async () => { 5 | const dataA = 6 | 'KLUv/QBgpQQA0gkfHWClqgMIrrCtT3yQwJQIidYIgtCCI8CfnRdBEHABc7LJJpvs0EdlsMvRV0fXLl7Re/k5y+/oEoAlM8m7ngUB8uhKgw859JEdZI7ml9FqWzVhdafmiE1CE0MyWhmpWEOh1lBc75I/+pXrjvSS4aVp0B2dm7fO9bJxAIF/AgcARQ3FJ+JWVRjGDm8FszjLChgqDw=='; 7 | 8 | const dataB = 9 | 'KLUv/QBgnQQAwskeHWClqgMIrrCtT3yQwJQIidYIgtCCI8CfnRdBEHABc7LJJpvs0EdlsMvRO7p28Yrey89ZfkeXACyZSd71LAiQR1cafMihj+wgczS/jFbbqgmrOzVHbBKaGJLRykjFGgq1huJ6l/zRr1x3pJcML02D7ujcvHWul40DCPwTBwBFDcUn4lZVGMYObwWzOMsKGCoP'; 10 | 11 | await init(); 12 | const resA = decompress(Buffer.from(dataA, 'base64')); 13 | const jsonA = Buffer.from(resA).toString(); 14 | expect(JSON.parse(jsonA)).toMatchSnapshot(); 15 | 16 | const resB = decompress(Buffer.from(dataB, 'base64')); 17 | const jsonB = Buffer.from(resB).toString(); 18 | expect(JSON.parse(jsonB)).toMatchSnapshot(); 19 | }); 20 | -------------------------------------------------------------------------------- /benchmark/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Example Domain 5 | 6 | 7 | 8 | 9 | 36 | 37 | 38 | 39 |
40 |

Example Domain

41 |

This domain is for use in illustrative examples in documents. You may use this 42 | domain in literature without prior coordination or asking for permission.

43 |

More information...

44 |
45 | 46 | -------------------------------------------------------------------------------- /test/__snapshots__/simple-decompress.test.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`decompress multiple json 1`] = ` 4 | Object { 5 | "document": Object { 6 | "data": Object { 7 | "id": "74207427-90f9-46f1-a6dc-ff21c0fa0f92", 8 | }, 9 | "nodes": Array [ 10 | Object { 11 | "data": Object {}, 12 | "nodes": Array [ 13 | Object { 14 | "leaves": Array [ 15 | Object { 16 | "marks": Array [], 17 | "object": "leaf", 18 | "text": "sdfdsf2", 19 | }, 20 | ], 21 | "object": "text", 22 | }, 23 | ], 24 | "object": "block", 25 | "type": "line", 26 | }, 27 | ], 28 | "object": "document", 29 | }, 30 | "object": "value", 31 | } 32 | `; 33 | 34 | exports[`decompress multiple json 2`] = ` 35 | Object { 36 | "document": Object { 37 | "data": Object { 38 | "id": "74207427-90f9-46f1-a6dc-ff21c0fa0f92", 39 | }, 40 | "nodes": Array [ 41 | Object { 42 | "data": Object {}, 43 | "nodes": Array [ 44 | Object { 45 | "leaves": Array [ 46 | Object { 47 | "marks": Array [], 48 | "object": "leaf", 49 | "text": "sdfdsf", 50 | }, 51 | ], 52 | "object": "text", 53 | }, 54 | ], 55 | "object": "block", 56 | "type": "line", 57 | }, 58 | ], 59 | "object": "document", 60 | }, 61 | "object": "value", 62 | } 63 | `; 64 | -------------------------------------------------------------------------------- /lib/simple/compress.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '../module'; 2 | import { isError } from '../errors'; 3 | 4 | const compressBound = (size: number): number => { 5 | const bound = Module['_ZSTD_compressBound']; 6 | return bound(size); 7 | }; 8 | 9 | export const compress = (buf: Uint8Array, level?: number): Uint8Array => { 10 | const bound = compressBound(buf.byteLength); 11 | const malloc = Module['_malloc']; 12 | const compressed = malloc(bound); 13 | const src = malloc(buf.byteLength); 14 | Module.HEAP8.set(buf, src); 15 | const free = Module['_free']; 16 | try { 17 | /* 18 | @See https://zstd.docsforge.com/dev/api/ZSTD_compress/ 19 | size_t ZSTD_compress( void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel); 20 | Compresses `src` content as a single zstd compressed frame into already allocated `dst`. 21 | Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`. 22 | @return : compressed size written into `dst` (<= `dstCapacity), 23 | or an error code if it fails (which can be tested using ZSTD_isError()). 24 | */ 25 | const _compress = Module['_ZSTD_compress']; 26 | const sizeOrError = _compress(compressed, bound, src, buf.byteLength, level ?? 3); 27 | if (isError(sizeOrError)) { 28 | throw new Error(`Failed to compress with code ${sizeOrError}`); 29 | } 30 | // // Copy buffer 31 | // // Uint8Array.prototype.slice() return copied buffer. 32 | const data = new Uint8Array(Module.HEAPU8.buffer, compressed, sizeOrError).slice(); 33 | free(compressed, bound); 34 | free(src, buf.byteLength); 35 | return data; 36 | } catch (e) { 37 | free(compressed, bound); 38 | free(src, buf.byteLength); 39 | throw e; 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /lib/simple/decompress_using_dict.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '../module'; 2 | import { isError } from '../errors'; 3 | import { DecompressOption } from './decompress'; 4 | 5 | const getFrameContentSize = (src: number, size: number): number => { 6 | const getSize = Module['_ZSTD_getFrameContentSize']; 7 | return getSize(src, size); 8 | }; 9 | 10 | export const createDCtx = (): number => { 11 | return Module['_ZSTD_createDCtx'](); 12 | }; 13 | 14 | export const freeDCtx = (dctx: number) => { 15 | return Module['_ZSTD_freeDCtx'](dctx); 16 | }; 17 | 18 | export const decompressUsingDict = ( 19 | dctx: number, 20 | buf: Uint8Array, 21 | dict: Uint8Array, 22 | opts: DecompressOption = { defaultHeapSize: 1024 * 1024 }, // Use 1MB on default if it is failed to get content size. 23 | ): Uint8Array => { 24 | const malloc = Module['_malloc']; 25 | const src = malloc(buf.byteLength); 26 | Module.HEAP8.set(buf, src); 27 | const pdict = malloc(dict.byteLength); 28 | Module.HEAP8.set(dict, pdict); 29 | const contentSize = getFrameContentSize(src, buf.byteLength); 30 | const size = contentSize === -1 ? opts.defaultHeapSize : contentSize; 31 | const free = Module['_free']; 32 | const heap = malloc(size); 33 | try { 34 | const _decompress = Module['_ZSTD_decompress_usingDict']; 35 | const sizeOrError = _decompress(dctx, heap, size, src, buf.byteLength, pdict, dict.byteLength); 36 | if (isError(sizeOrError)) { 37 | throw new Error(`Failed to compress with code ${sizeOrError}`); 38 | } 39 | // Copy buffer 40 | // Uint8Array.prototype.slice() return copied buffer. 41 | const data = new Uint8Array(Module.HEAPU8.buffer, heap, sizeOrError).slice(); 42 | free(heap, size); 43 | free(src, buf.byteLength); 44 | free(pdict, dict.byteLength); 45 | return data; 46 | } catch (e) { 47 | free(heap, size); 48 | free(src, buf.byteLength); 49 | free(pdict, dict.byteLength); 50 | throw e; 51 | } 52 | }; 53 | -------------------------------------------------------------------------------- /lib/simple/decompress.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '../module'; 2 | import { isError } from '../errors'; 3 | 4 | const getFrameContentSize = (src: number, size: number): number => { 5 | const getSize = Module['_ZSTD_getFrameContentSize']; 6 | return getSize(src, size); 7 | }; 8 | 9 | export type DecompressOption = { 10 | defaultHeapSize?: number; 11 | }; 12 | 13 | export const decompress = ( 14 | buf: Uint8Array, 15 | opts: DecompressOption = { defaultHeapSize: 1024 * 1024 }, // Use 1MB on default if it is failed to get content size. 16 | ): Uint8Array => { 17 | const malloc = Module['_malloc']; 18 | const src = malloc(buf.byteLength); 19 | Module.HEAP8.set(buf, src); 20 | const contentSize = getFrameContentSize(src, buf.byteLength); 21 | const size = contentSize === -1 ? opts.defaultHeapSize : contentSize; 22 | const free = Module['_free']; 23 | const heap = malloc(size); 24 | try { 25 | /* 26 | @See https://zstd.docsforge.com/dev/api/ZSTD_decompress/ 27 | compressedSize : must be the exact size of some number of compressed and/or skippable frames. 28 | dstCapacity is an upper bound of originalSize to regenerate. 29 | If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data. 30 | @return: the number of bytes decompressed into dst (<= dstCapacity), or an errorCode if it fails (which can be tested using ZSTD_isError()). 31 | */ 32 | const _decompress = Module['_ZSTD_decompress']; 33 | const sizeOrError = _decompress(heap, size, src, buf.byteLength); 34 | if (isError(sizeOrError)) { 35 | throw new Error(`Failed to compress with code ${sizeOrError}`); 36 | } 37 | // Copy buffer 38 | // Uint8Array.prototype.slice() return copied buffer. 39 | const data = new Uint8Array(Module.HEAPU8.buffer, heap, sizeOrError).slice(); 40 | free(heap, size); 41 | free(src, buf.byteLength); 42 | return data; 43 | } catch (e) { 44 | free(heap, size); 45 | free(src, buf.byteLength); 46 | throw e; 47 | } 48 | }; 49 | -------------------------------------------------------------------------------- /tools/deno.js: -------------------------------------------------------------------------------- 1 | const prettier = require('prettier'); 2 | const glob = require('glob-all'); 3 | const { readFileSync, writeFileSync } = require('fs'); 4 | 5 | // Ignore index.ts/init.ts 6 | const files = glob 7 | .sync('./lib/**/*.ts') 8 | .filter((name) => name !== './lib/index.web.ts' && name !== './lib/module.ts' && name !== './lib/index.node.ts'); 9 | 10 | console.log(files); 11 | 12 | const res = files.reduce((code, file) => { 13 | const content = readFileSync(file, 'utf-8'); 14 | return ( 15 | code + 16 | '\n\n' + 17 | prettier.format(content, { 18 | parser(text, parser) { 19 | const ast = parser['babel-ts'](text); 20 | // Remove import and require 21 | const body = ast.program.body.filter((b) => { 22 | if (b.type === 'ImportDeclaration') return false; 23 | if (b.type === 'ExportAllDeclaration') return false; 24 | if (b.type === 'VariableDeclaration') { 25 | if (b.declarations[0].init.callee && b.declarations[0].init.callee.name === 'require') { 26 | return false; 27 | } 28 | } 29 | return true; 30 | }); 31 | ast.program.body = body; 32 | return ast; 33 | }, 34 | }) 35 | ); 36 | }, ''); 37 | 38 | const encoded = Buffer.from(readFileSync('./lib/wasm/zstd.wasm')).toString('base64'); 39 | 40 | writeFileSync( 41 | './deno/zstd.encoded.wasm.ts', 42 | ` 43 | export const wasm = "${encoded}"; 44 | `, 45 | ); 46 | 47 | const head = ` 48 | import { decode } from "https://deno.land/std/encoding/base64.ts" 49 | import { wasm } from "./zstd.encoded.wasm.ts" 50 | import Module from './zstd.deno.js'; 51 | 52 | const initialized = (() => 53 | new Promise((resolve) => { 54 | Module.onRuntimeInitialized = resolve; 55 | }))(); 56 | 57 | export const init = async () => { 58 | const bytes = decode(wasm); 59 | Module['init'](bytes); 60 | await initialized; 61 | }; 62 | `; 63 | 64 | writeFileSync('./deno/zstd.ts', head + res); 65 | 66 | console.log(`Succeeded to create deno/zstd.ts`); 67 | -------------------------------------------------------------------------------- /lib/simple/compress_using_dict.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '../module'; 2 | import { isError } from '../errors'; 3 | 4 | const compressBound = (size: number): number => { 5 | const bound = Module['_ZSTD_compressBound']; 6 | return bound(size); 7 | }; 8 | 9 | export const createCCtx = (): number => { 10 | return Module['_ZSTD_createCCtx'](); 11 | }; 12 | 13 | export const freeCCtx = (cctx: number) => { 14 | return Module['_ZSTD_freeCCtx'](cctx); 15 | }; 16 | 17 | export const compressUsingDict = (cctx: number, buf: Uint8Array, dict: Uint8Array, level?: number): Uint8Array => { 18 | const bound = compressBound(buf.byteLength); 19 | const malloc = Module['_malloc']; 20 | const compressed = malloc(bound); 21 | const src = malloc(buf.byteLength); 22 | Module.HEAP8.set(buf, src); 23 | // Setup dict 24 | const pdict = malloc(dict.byteLength); 25 | Module.HEAP8.set(dict, pdict); 26 | const free = Module['_free']; 27 | try { 28 | /* 29 | @See https://zstd.docsforge.com/dev/api/ZSTD_compress_usingDict/ 30 | size_t ZSTD_compress_usingDict(ZSTD_CCtx* cctx, 31 | void* dst, size_t dstCapacity, 32 | const void* src, size_t srcSize, 33 | const void* dict, size_t dictSize, 34 | int compressionLevel) 35 | */ 36 | const _compress = Module['_ZSTD_compress_usingDict']; 37 | const sizeOrError = _compress(cctx, compressed, bound, src, buf.byteLength, pdict, dict.byteLength, level ?? 3); 38 | if (isError(sizeOrError)) { 39 | throw new Error(`Failed to compress with code ${sizeOrError}`); 40 | } 41 | // // Copy buffer 42 | // // Uint8Array.prototype.slice() return copied buffer. 43 | const data = new Uint8Array(Module.HEAPU8.buffer, compressed, sizeOrError).slice(); 44 | free(compressed, bound); 45 | free(src, buf.byteLength); 46 | free(pdict, dict.byteLength); 47 | return data; 48 | } catch (e) { 49 | free(compressed, bound); 50 | free(src, buf.byteLength); 51 | free(pdict, dict.byteLength); 52 | throw e; 53 | } 54 | }; 55 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bokuweb/zstd-wasm", 3 | "version": "0.0.27", 4 | "repository": "ssh://git@github.com/bokuweb/zstd-wasm.git", 5 | "author": "", 6 | "license": "MIT", 7 | "main": "dist/common/index.node.js", 8 | "browser": "dist/web/index.web.js", 9 | "types": "dist/web/index.web.d.ts", 10 | "scripts": { 11 | "largefile": "yes \"Hello\" | head -n 40000000 > ./test/large-file", 12 | "tsc": "tsc -p tsconfig.json --skipLibCheck", 13 | "copy:wasm:web": "cp -r ./lib/zstd.wasm dist/web", 14 | "copy:wasm:common": "cp -r ./lib/zstd.wasm dist/common", 15 | "copy:wasm:esm": "cp -r ./lib/zstd.wasm dist/esm", 16 | "tsc:web": "tsc -p tsconfig.web.json --skipLibCheck", 17 | "tsc:common": "tsc -p tsconfig.node.common.json --skipLibCheck", 18 | "tsc:esm": "tsc -p tsconfig.node.esm.json --skipLibCheck", 19 | "build:web": "npm run tsc:web && npm run copy:wasm:web", 20 | "build:common": "npm run tsc:common && npm run copy:wasm:common", 21 | "build:esm": "npm run tsc:esm && npm run copy:wasm:esm", 22 | "build:deno": "node tools/deno.js && sed -e 's/module.exports = /export default /' lib/wasm/zstd.js > deno/zstd.deno.js", 23 | "benchmark": "npx ts-node ./benchmark/index.ts", 24 | "build:js": "npm run clean && npm run build:web && npm run build:common && npm run build:esm", 25 | "clean": "rm -rf dist", 26 | "prepublishOnly": "npm run build:js", 27 | "build:wasm": "sh build.sh", 28 | "build:all": "npm run build:wasm && npm run build:js", 29 | "test": "npm run largefile && jest && rm ./test/large-file" 30 | }, 31 | "publishConfig": { 32 | "access": "public" 33 | }, 34 | "files": [ 35 | "dist" 36 | ], 37 | "devDependencies": { 38 | "@types/benchmark": "2.1.5", 39 | "@types/jest": "28.1.8", 40 | "@types/node": "20.12.4", 41 | "benchmark": "2.1.4", 42 | "glob-all": "3.3.1", 43 | "jest": "28.1.3", 44 | "prettier": "3.2.5", 45 | "text-encoding": "0.7.0", 46 | "ts-jest": "28.0.8", 47 | "typescript": "5.8" 48 | }, 49 | "dependencies": {}, 50 | "exports": { 51 | "node": "./dist/common/index.node.js", 52 | "require": "./dist/common/index.node.js", 53 | "browser": "./dist/web/index.web.js", 54 | "default": "./dist/common/index.node.js" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### https://raw.github.com/github/gitignore/218a941be92679ce67d0484547e3e142b2f5f6f0/Node.gitignore 2 | 3 | # Logs 4 | logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | lerna-debug.log* 10 | zstd.c 11 | 12 | # Diagnostic reports (https://nodejs.org/api/report.html) 13 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 14 | 15 | # Runtime data 16 | pids 17 | *.pid 18 | *.seed 19 | *.pid.lock 20 | 21 | # Directory for instrumented libs generated by jscoverage/JSCover 22 | lib-cov 23 | 24 | # Coverage directory used by tools like istanbul 25 | coverage 26 | *.lcov 27 | 28 | # nyc test coverage 29 | .nyc_output 30 | 31 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 32 | .grunt 33 | 34 | # Bower dependency directory (https://bower.io/) 35 | bower_components 36 | 37 | # node-waf configuration 38 | .lock-wscript 39 | 40 | # Compiled binary addons (https://nodejs.org/api/addons.html) 41 | build/Release 42 | 43 | # Dependency directories 44 | node_modules/ 45 | jspm_packages/ 46 | 47 | # Snowpack dependency directory (https://snowpack.dev/) 48 | web_modules/ 49 | 50 | # TypeScript cache 51 | *.tsbuildinfo 52 | 53 | # Optional npm cache directory 54 | .npm 55 | 56 | # Optional eslint cache 57 | .eslintcache 58 | 59 | # Microbundle cache 60 | .rpt2_cache/ 61 | .rts2_cache_cjs/ 62 | .rts2_cache_es/ 63 | .rts2_cache_umd/ 64 | 65 | # Optional REPL history 66 | .node_repl_history 67 | 68 | # Output of 'npm pack' 69 | *.tgz 70 | 71 | # Yarn Integrity file 72 | .yarn-integrity 73 | 74 | # dotenv environment variables file 75 | .env 76 | .env.test 77 | 78 | # parcel-bundler cache (https://parceljs.org/) 79 | .cache 80 | .parcel-cache 81 | 82 | # Next.js build output 83 | .next 84 | out 85 | 86 | # Nuxt.js build / generate output 87 | .nuxt 88 | dist 89 | 90 | # Gatsby files 91 | .cache/ 92 | # Comment in the public line in if your project uses Gatsby and not Next.js 93 | # https://nextjs.org/blog/next-9-1#public-directory-support 94 | # public 95 | 96 | # vuepress build output 97 | .vuepress/dist 98 | 99 | # Serverless directories 100 | .serverless/ 101 | 102 | # FuseBox cache 103 | .fusebox/ 104 | 105 | # DynamoDB Local files 106 | .dynamodb/ 107 | 108 | # TernJS port file 109 | .tern-port 110 | 111 | # Stores VSCode versions used for testing VSCode extensions 112 | .vscode-test 113 | 114 | # yarn v2 115 | .yarn/cache 116 | .yarn/unplugged 117 | .yarn/build-state.yml 118 | .yarn/install-state.gz 119 | .pnp.* 120 | 121 | zstd 122 | zstd.js 123 | zstd.wasm 124 | !lib/zstd.wasm 125 | zstd.c 126 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zstd-wasm 2 | 3 | Build Status Build Status 4 | 5 | 6 | Zstandard for browser, Node.js and Deno. 7 | For now support only simple API. 8 | 9 | ## installation 10 | 11 | ``` 12 | npm install @bokuweb/zstd-wasm 13 | ``` 14 | ## examples 15 | 16 | ### Node.js 17 | 18 | Playground: https://runkit.com/bokuweb/60f1172a58aae5001aea2418 19 | 20 | ``` js 21 | const { init, compress, decompress } = require('@bokuweb/zstd-wasm'); 22 | 23 | (async () => { 24 | await init(); 25 | const compressed = compress(Buffer.from('Hello zstd!!'), 10); 26 | const res = decompress(compressed); 27 | Buffer.from(res).toString(); // Hello zstd!! 28 | })(); 29 | ``` 30 | 31 | ### Deno 32 | 33 | See also, https://github.com/bokuweb/zstd-wasm/tree/master/examples/deno 34 | 35 | ``` ts 36 | import { init, decompress, compress } from 'https://deno.land/x/zstd_wasm/deno/zstd.ts'; 37 | 38 | await init(); 39 | const encoder = new TextEncoder(); 40 | const buffer = encoder.encode('Hello World'); 41 | const compressed = compress(buffer, 10); 42 | const decompressed = decompress(compressed); 43 | const decoder = new TextDecoder(); 44 | console.log(decoder.decode(decompressed)); 45 | ``` 46 | ### without bundlers 47 | 48 | ``` js 49 | import { init, compress, decompress } from '@bokuweb/zstd-wasm'; 50 | 51 | (async () => { 52 | await init('./zstd.wasm'); // Please deploy `node_modules/@bokuweb/zstd-wasm/lib/wasm/zstd.wasm` to your hosting server. 53 | const compressed = compress(Buffer.from('Hello zstd!!'), 10); 54 | const res = decompress(compressed); 55 | Buffer.from(res).toString(); // Hello zstd!! 56 | })(); 57 | ``` 58 | 59 | --- 60 | 61 | ### with `vite` 62 | 63 | Please set following config in `vite.config.js`. 64 | 65 | ``` js 66 | import { defineConfig } from 'vite'; 67 | 68 | export default defineConfig({ 69 | optimizeDeps: { 70 | exclude: ['@bokuweb/zstd-wasm'], 71 | esbuildOptions: { 72 | target: 'es2020', 73 | }, 74 | }, 75 | }); 76 | ``` 77 | 78 | --- 79 | 80 | ### with webpack4 81 | 82 | We need to use `file-loader` with webpack4. 83 | This is because, webpack doesn’t work well with wasm modules created with Emscripten. 84 | See, https://github.com/webpack/webpack/issues/7352 85 | 86 | 87 | ``` js 88 | import { init, compress, decompress } from '@bokuweb/zstd-wasm'; 89 | 90 | (async () => { 91 | await init(); 92 | const compressed = compress(Buffer.from('Hello zstd!!'), 10); 93 | const res = decompress(compressed); 94 | Buffer.from(res).toString(); // Hello zstd!! 95 | })(); 96 | ``` 97 | 98 | In this case, please install `file-loader` by yourself. 99 | 100 | - webpack.config.js 101 | ``` js 102 | { 103 | // ...snipped 104 | module: { 105 | rules: [ 106 | { 107 | test: /zstd\.wasm$/, 108 | type: 'javascript/auto', 109 | loader: 'file-loader', // Please use file loader 110 | }, 111 | ], 112 | }, 113 | } 114 | ``` 115 | 116 | --- 117 | 118 | ### with webpack5 119 | 120 | We need to use `Asset Modules` with webpack5. 121 | This is because, webpack doesn’t work well with wasm modules created with Emscripten. 122 | See, https://github.com/webpack/webpack/issues/7352 123 | 124 | 125 | ``` js 126 | import { init, compress, decompress } from '@bokuweb/zstd-wasm'; 127 | 128 | (async () => { 129 | await init(); 130 | const compressed = compress(Buffer.from('Hello zstd!!'), 10); 131 | const res = decompress(compressed); 132 | Buffer.from(res).toString(); // Hello zstd!! 133 | })(); 134 | ``` 135 | 136 | - webpack.config.js 137 | ``` js 138 | { 139 | // ...snipped 140 | module: { 141 | rules: [ 142 | { 143 | test: /zstd\.wasm/, 144 | type: 'asset/resource', 145 | }, 146 | ], 147 | }, 148 | // ...snipped 149 | } 150 | ``` 151 | 152 | ## Using dictionary 153 | 154 | 1. Create the dictionary 155 | 156 | `zstd --train FullPathToTrainingSet/* -o dictionaryName` 157 | 158 | 2. Compress with dictionary 159 | 160 | ```typescript 161 | const dict = readFileSync('./dict'); 162 | const compressed = compressUsingDict(createCCtx(), buffer, dict, 10); 163 | ``` 164 | 165 | 3. Decompress with dictionary 166 | 167 | ``` typescript 168 | const dict = readFileSync('./dict'); 169 | const decompressed = decompressUsingDict(createDCtx(), buffer, dict); 170 | ``` 171 | 172 | See also [example](./test/compress_using_dict.test.ts) 173 | 174 | ## API 175 | 176 | ### async init(path?: string): Promise 177 | 178 | Initialize module. 179 | Please specify path to `zstd.wasm` without bunders on browser. 180 | 181 | ### compress(buffer: Uint8Array, compressionLevel?: number): Uint8Array 182 | 183 | - buffer: data to compress. 184 | - compressionLevel: (optional) compression level, default value is 3 185 | 186 | **Example:** 187 | 188 | ```typescript 189 | const compressed = compress(buffer, 10); 190 | ``` 191 | 192 | ### decompress(buffer: Uint8Array): Uint8Array 193 | 194 | - buffer: data to decompress. 195 | 196 | **Example:** 197 | 198 | ```typescript 199 | const decompressed = decompress(buffer); 200 | ``` 201 | 202 | ### compressUsingDict(cctx: number, buffer: Uint8Array, dict: Uint8Array, compressionLevel?: number): Uint8Array 203 | 204 | - cctx: a pointer to compress context. please create cctx with `createCCtx`. 205 | - buffer: data to compress. 206 | - dict: dictionary data. 207 | - compressionLevel: (optional) compression level, default value is 3 208 | 209 | **Example:** 210 | 211 | ```typescript 212 | const dict = readFileSync('./dict'); 213 | const compressed = compressUsingDict(createCCtx(), buffer, dict, 10); 214 | ``` 215 | 216 | ### createCCtx(): number 217 | 218 | - create a pointer to compress context. 219 | 220 | ### decompressUsingDict(dctx: number, dict: Uint8Array): Uint8Array 221 | 222 | - dctx: a pointer to decompress context. please create cctx with `createDCtx`. 223 | - buffer: data to decompress. 224 | - dict: dictionary data. 225 | 226 | **Example:** 227 | 228 | ```typescript 229 | const dict = readFileSync('./dict'); 230 | const decompressed = decompressUsingDict(createDCtx(), buffer, dict); 231 | ``` 232 | 233 | ### createDCtx(): number 234 | 235 | - create a pointer to decompress context. 236 | 237 | 238 | ## License 239 | 240 | TypeScript glue is provided under the MIT License, and the zstd is provided by Facebook under the BSD 3-Clause License. 241 | -------------------------------------------------------------------------------- /deno/zstd.ts: -------------------------------------------------------------------------------- 1 | import { decodeBase64 } from 'https://deno.land/std/encoding/base64.ts'; 2 | import { wasm } from './zstd.encoded.wasm.ts'; 3 | import Module from './zstd.deno.js'; 4 | 5 | const initialized = (() => 6 | new Promise((resolve) => { 7 | Module.onRuntimeInitialized = resolve; 8 | }))(); 9 | 10 | export const init = async () => { 11 | const bytes = decodeBase64(wasm); 12 | Module['init'](bytes); 13 | await initialized; 14 | }; 15 | 16 | export const isError = (code: number): number => { 17 | const _isError = Module['_ZSTD_isError']; 18 | return _isError(code); 19 | }; 20 | 21 | // @See https://github.com/facebook/zstd/blob/12c045f74d922dc934c168f6e1581d72df983388/lib/common/error_private.c#L24-L53 22 | // export const getErrorName = (code: number): string => { 23 | // const _getErrorName = Module.cwrap('ZSTD_getErrorName', 'string', ['number']); 24 | // return _getErrorName(code); 25 | // }; 26 | 27 | const compressBound = (size: number): number => { 28 | const bound = Module['_ZSTD_compressBound']; 29 | return bound(size); 30 | }; 31 | 32 | export const createCCtx = (): number => { 33 | return Module['_ZSTD_createCCtx'](); 34 | }; 35 | 36 | export const freeCCtx = (cctx: number) => { 37 | return Module['_ZSTD_freeCCtx'](cctx); 38 | }; 39 | 40 | export const compressUsingDict = (cctx: number, buf: Uint8Array, dict: Uint8Array, level?: number) => { 41 | const bound = compressBound(buf.byteLength); 42 | const malloc = Module['_malloc']; 43 | const compressed = malloc(bound); 44 | const src = malloc(buf.byteLength); 45 | Module.HEAP8.set(buf, src); 46 | // Setup dict 47 | const pdict = malloc(dict.byteLength); 48 | Module.HEAP8.set(dict, pdict); 49 | const free = Module['_free']; 50 | try { 51 | /* 52 | @See https://zstd.docsforge.com/dev/api/ZSTD_compress_usingDict/ 53 | size_t ZSTD_compress_usingDict(ZSTD_CCtx* cctx, 54 | void* dst, size_t dstCapacity, 55 | const void* src, size_t srcSize, 56 | const void* dict, size_t dictSize, 57 | int compressionLevel) 58 | */ 59 | const _compress = Module['_ZSTD_compress_usingDict']; 60 | const sizeOrError = _compress(cctx, compressed, bound, src, buf.byteLength, pdict, dict.byteLength, level ?? 3); 61 | if (isError(sizeOrError)) { 62 | throw new Error(`Failed to compress with code ${sizeOrError}`); 63 | } 64 | // // Copy buffer 65 | // // Uint8Array.prototype.slice() return copied buffer. 66 | const data = new Uint8Array(Module.HEAPU8.buffer, compressed, sizeOrError).slice(); 67 | free(compressed, bound); 68 | free(src, buf.byteLength); 69 | free(pdict, dict.byteLength); 70 | return data; 71 | } catch (e) { 72 | free(compressed, bound); 73 | free(src, buf.byteLength); 74 | free(pdict, dict.byteLength); 75 | throw e; 76 | } 77 | }; 78 | 79 | export const compress = (buf: Uint8Array, level?: number) => { 80 | const bound = compressBound(buf.byteLength); 81 | const malloc = Module['_malloc']; 82 | const compressed = malloc(bound); 83 | const src = malloc(buf.byteLength); 84 | Module.HEAP8.set(buf, src); 85 | const free = Module['_free']; 86 | try { 87 | /* 88 | @See https://zstd.docsforge.com/dev/api/ZSTD_compress/ 89 | size_t ZSTD_compress( void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel); 90 | Compresses `src` content as a single zstd compressed frame into already allocated `dst`. 91 | Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`. 92 | @return : compressed size written into `dst` (<= `dstCapacity), 93 | or an error code if it fails (which can be tested using ZSTD_isError()). 94 | */ 95 | const _compress = Module['_ZSTD_compress']; 96 | const sizeOrError = _compress(compressed, bound, src, buf.byteLength, level ?? 3); 97 | if (isError(sizeOrError)) { 98 | throw new Error(`Failed to compress with code ${sizeOrError}`); 99 | } 100 | // // Copy buffer 101 | // // Uint8Array.prototype.slice() return copied buffer. 102 | const data = new Uint8Array(Module.HEAPU8.buffer, compressed, sizeOrError).slice(); 103 | free(compressed, bound); 104 | free(src, buf.byteLength); 105 | return data; 106 | } catch (e) { 107 | free(compressed, bound); 108 | free(src, buf.byteLength); 109 | throw e; 110 | } 111 | }; 112 | 113 | const getFrameContentSize = (src: number, size: number): number => { 114 | const getSize = Module['_ZSTD_getFrameContentSize']; 115 | return getSize(src, size); 116 | }; 117 | 118 | export const createDCtx = (): number => { 119 | return Module['_ZSTD_createDCtx'](); 120 | }; 121 | 122 | export const freeDCtx = (dctx: number) => { 123 | return Module['_ZSTD_freeDCtx'](dctx); 124 | }; 125 | 126 | export const decompressUsingDict = ( 127 | dctx: number, 128 | buf: Uint8Array, 129 | dict: Uint8Array, 130 | opts: DecompressOption = { defaultHeapSize: 1024 * 1024 }, // Use 1MB on default if it is failed to get content size. 131 | ): Uint8Array => { 132 | const malloc = Module['_malloc']; 133 | const src = malloc(buf.byteLength); 134 | Module.HEAP8.set(buf, src); 135 | const pdict = malloc(dict.byteLength); 136 | Module.HEAP8.set(dict, pdict); 137 | const contentSize = getFrameContentSize(src, buf.byteLength); 138 | const size = contentSize === -1 ? opts.defaultHeapSize : contentSize; 139 | const free = Module['_free']; 140 | const heap = malloc(size); 141 | try { 142 | const _decompress = Module['_ZSTD_decompress_usingDict']; 143 | const sizeOrError = _decompress(dctx, heap, size, src, buf.byteLength, pdict, dict.byteLength); 144 | if (isError(sizeOrError)) { 145 | throw new Error(`Failed to compress with code ${sizeOrError}`); 146 | } 147 | // Copy buffer 148 | // Uint8Array.prototype.slice() return copied buffer. 149 | const data = new Uint8Array(Module.HEAPU8.buffer, heap, sizeOrError).slice(); 150 | free(heap, size); 151 | free(src, buf.byteLength); 152 | free(pdict, dict.byteLength); 153 | return data; 154 | } catch (e) { 155 | free(heap, size); 156 | free(src, buf.byteLength); 157 | free(pdict, dict.byteLength); 158 | throw e; 159 | } 160 | }; 161 | 162 | export type DecompressOption = { 163 | defaultHeapSize?: number; 164 | }; 165 | 166 | export const decompress = ( 167 | buf: Uint8Array, 168 | opts: DecompressOption = { defaultHeapSize: 1024 * 1024 }, // Use 1MB on default if it is failed to get content size. 169 | ): Uint8Array => { 170 | const malloc = Module['_malloc']; 171 | const src = malloc(buf.byteLength); 172 | Module.HEAP8.set(buf, src); 173 | const contentSize = getFrameContentSize(src, buf.byteLength); 174 | const size = contentSize === -1 ? opts.defaultHeapSize : contentSize; 175 | const free = Module['_free']; 176 | const heap = malloc(size); 177 | try { 178 | /* 179 | @See https://zstd.docsforge.com/dev/api/ZSTD_decompress/ 180 | compressedSize : must be the exact size of some number of compressed and/or skippable frames. 181 | dstCapacity is an upper bound of originalSize to regenerate. 182 | If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data. 183 | @return: the number of bytes decompressed into dst (<= dstCapacity), or an errorCode if it fails (which can be tested using ZSTD_isError()). 184 | */ 185 | const _decompress = Module['_ZSTD_decompress']; 186 | const sizeOrError = _decompress(heap, size, src, buf.byteLength); 187 | if (isError(sizeOrError)) { 188 | throw new Error(`Failed to compress with code ${sizeOrError}`); 189 | } 190 | // Copy buffer 191 | // Uint8Array.prototype.slice() return copied buffer. 192 | const data = new Uint8Array(Module.HEAPU8.buffer, heap, sizeOrError).slice(); 193 | free(heap, size); 194 | free(src, buf.byteLength); 195 | return data; 196 | } catch (e) { 197 | free(heap, size); 198 | free(src, buf.byteLength); 199 | throw e; 200 | } 201 | }; 202 | -------------------------------------------------------------------------------- /deno/zstd.deno.js: -------------------------------------------------------------------------------- 1 | var Module = typeof Module !== 'undefined' ? Module : {}; 2 | var moduleOverrides = {}; 3 | var key; 4 | for (key in Module) { 5 | if (Module.hasOwnProperty(key)) { 6 | moduleOverrides[key] = Module[key]; 7 | } 8 | } 9 | var arguments_ = []; 10 | var err = Module['printErr'] || console.warn.bind(console); 11 | for (key in moduleOverrides) { 12 | if (moduleOverrides.hasOwnProperty(key)) { 13 | Module[key] = moduleOverrides[key]; 14 | } 15 | } 16 | moduleOverrides = null; 17 | if (Module['arguments']) arguments_ = Module['arguments']; 18 | if (Module['thisProgram']) thisProgram = Module['thisProgram']; 19 | if (Module['quit']) quit_ = Module['quit']; 20 | var tempRet0 = 0; 21 | var setTempRet0 = function (value) { 22 | tempRet0 = value; 23 | }; 24 | if (typeof WebAssembly !== 'object') { 25 | abort('no native wasm support detected'); 26 | } 27 | var wasmMemory; 28 | var ABORT = false; 29 | function ___assert_fail(condition, filename, line, func) { 30 | abort('Assertion failed: ' + [filename ? filename : 'unknown filename', line, func ? func : 'unknown function']); 31 | } 32 | function alignUp(x, multiple) { 33 | if (x % multiple > 0) { 34 | x += multiple - (x % multiple); 35 | } 36 | return x; 37 | } 38 | var buffer, HEAPU8; 39 | function updateGlobalBufferAndViews(buf) { 40 | buffer = buf; 41 | Module['HEAP8'] = new Int8Array(buf); 42 | Module['HEAPU8'] = HEAPU8 = new Uint8Array(buf); 43 | } 44 | var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 16777216; 45 | var wasmTable; 46 | var __ATPRERUN__ = []; 47 | var __ATINIT__ = []; 48 | var __ATPOSTRUN__ = []; 49 | var runtimeInitialized = false; 50 | function preRun() { 51 | if (Module['preRun']) { 52 | if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']]; 53 | while (Module['preRun'].length) { 54 | addOnPreRun(Module['preRun'].shift()); 55 | } 56 | } 57 | callRuntimeCallbacks(__ATPRERUN__); 58 | } 59 | function initRuntime() { 60 | runtimeInitialized = true; 61 | callRuntimeCallbacks(__ATINIT__); 62 | } 63 | function postRun() { 64 | if (Module['postRun']) { 65 | if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']]; 66 | while (Module['postRun'].length) { 67 | addOnPostRun(Module['postRun'].shift()); 68 | } 69 | } 70 | callRuntimeCallbacks(__ATPOSTRUN__); 71 | } 72 | function addOnPreRun(cb) { 73 | __ATPRERUN__.unshift(cb); 74 | } 75 | function addOnInit(cb) { 76 | __ATINIT__.unshift(cb); 77 | } 78 | function addOnPostRun(cb) { 79 | __ATPOSTRUN__.unshift(cb); 80 | } 81 | var runDependencies = 0; 82 | var runDependencyWatcher = null; 83 | var dependenciesFulfilled = null; 84 | function addRunDependency(id) { 85 | runDependencies++; 86 | if (Module['monitorRunDependencies']) { 87 | Module['monitorRunDependencies'](runDependencies); 88 | } 89 | } 90 | function removeRunDependency(id) { 91 | runDependencies--; 92 | if (Module['monitorRunDependencies']) { 93 | Module['monitorRunDependencies'](runDependencies); 94 | } 95 | if (runDependencies == 0) { 96 | if (runDependencyWatcher !== null) { 97 | clearInterval(runDependencyWatcher); 98 | runDependencyWatcher = null; 99 | } 100 | if (dependenciesFulfilled) { 101 | var callback = dependenciesFulfilled; 102 | dependenciesFulfilled = null; 103 | callback(); 104 | } 105 | } 106 | } 107 | Module['preloadedImages'] = {}; 108 | Module['preloadedAudios'] = {}; 109 | function abort(what) { 110 | if (Module['onAbort']) { 111 | Module['onAbort'](what); 112 | } 113 | what += ''; 114 | err(what); 115 | ABORT = true; 116 | EXITSTATUS = 1; 117 | what = 'abort(' + what + ').'; 118 | var e = new WebAssembly.RuntimeError(what); 119 | throw e; 120 | } 121 | 122 | function getBinaryPromise(url) { 123 | return fetch(url, { credentials: 'same-origin' }).then(function (response) { 124 | if (!response['ok']) { 125 | throw "failed to load wasm binary file at '" + url + "'"; 126 | } 127 | return response['arrayBuffer'](); 128 | }); 129 | } 130 | 131 | function init(filePathOrBuf) { 132 | var info = { a: asmLibraryArg }; 133 | function receiveInstance(instance, module) { 134 | var exports = instance.exports; 135 | Module['asm'] = exports; 136 | wasmMemory = Module['asm']['d']; 137 | updateGlobalBufferAndViews(wasmMemory.buffer); 138 | wasmTable = Module['asm']['s']; 139 | addOnInit(Module['asm']['e']); 140 | removeRunDependency('wasm-instantiate'); 141 | } 142 | addRunDependency('wasm-instantiate'); 143 | function receiveInstantiationResult(result) { 144 | receiveInstance(result['instance']); 145 | } 146 | function instantiateArrayBuffer(receiver) { 147 | return getBinaryPromise(filePathOrBuf) 148 | .then(function (binary) { 149 | var result = WebAssembly.instantiate(binary, info); 150 | return result; 151 | }) 152 | .then(receiver, function (reason) { 153 | err('failed to asynchronously prepare wasm: ' + reason); 154 | abort(reason); 155 | }); 156 | } 157 | function instantiateAsync() { 158 | if (filePathOrBuf && filePathOrBuf.byteLength > 0) { 159 | return WebAssembly.instantiate(filePathOrBuf, info).then(receiveInstantiationResult, function (reason) { 160 | err('wasm compile failed: ' + reason); 161 | }); 162 | } else if ( 163 | typeof WebAssembly.instantiateStreaming === 'function' && 164 | typeof filePathOrBuf === 'string' && 165 | typeof fetch === 'function' 166 | ) { 167 | return fetch(filePathOrBuf, { credentials: 'same-origin' }).then(function (response) { 168 | var result = WebAssembly.instantiateStreaming(response, info); 169 | return result.then(receiveInstantiationResult, function (reason) { 170 | err('wasm streaming compile failed: ' + reason); 171 | err('falling back to ArrayBuffer instantiation'); 172 | return instantiateArrayBuffer(receiveInstantiationResult); 173 | }); 174 | }); 175 | } else { 176 | return instantiateArrayBuffer(receiveInstantiationResult); 177 | } 178 | } 179 | if (Module['instantiateWasm']) { 180 | try { 181 | var exports = Module['instantiateWasm'](info, receiveInstance); 182 | return exports; 183 | } catch (e) { 184 | err('Module.instantiateWasm callback failed with error: ' + e); 185 | return false; 186 | } 187 | } 188 | instantiateAsync(); 189 | return {}; 190 | } 191 | function callRuntimeCallbacks(callbacks) { 192 | while (callbacks.length > 0) { 193 | var callback = callbacks.shift(); 194 | if (typeof callback == 'function') { 195 | callback(Module); 196 | continue; 197 | } 198 | var func = callback.func; 199 | if (typeof func === 'number') { 200 | if (callback.arg === undefined) { 201 | wasmTable.get(func)(); 202 | } else { 203 | wasmTable.get(func)(callback.arg); 204 | } 205 | } else { 206 | func(callback.arg === undefined ? null : callback.arg); 207 | } 208 | } 209 | } 210 | function emscripten_realloc_buffer(size) { 211 | try { 212 | wasmMemory.grow((size - buffer.byteLength + 65535) >>> 16); 213 | updateGlobalBufferAndViews(wasmMemory.buffer); 214 | return 1; 215 | } catch (e) {} 216 | } 217 | function _emscripten_resize_heap(requestedSize) { 218 | var oldSize = HEAPU8.length; 219 | requestedSize = requestedSize >>> 0; 220 | var maxHeapSize = 2147483648; 221 | if (requestedSize > maxHeapSize) { 222 | return false; 223 | } 224 | for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { 225 | var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); 226 | overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); 227 | var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536)); 228 | var replacement = emscripten_realloc_buffer(newSize); 229 | if (replacement) { 230 | return true; 231 | } 232 | } 233 | return false; 234 | } 235 | function _setTempRet0(val) { 236 | setTempRet0(val); 237 | } 238 | var asmLibraryArg = { a: ___assert_fail, b: _emscripten_resize_heap, c: _setTempRet0 }; 239 | Module['___wasm_call_ctors'] = function () { 240 | return (Module['___wasm_call_ctors'] = Module['asm']['e']).apply(null, arguments); 241 | }; 242 | Module['_malloc'] = function () { 243 | return (Module['_malloc'] = Module['asm']['q']).apply(null, arguments); 244 | }; 245 | Module['_free'] = function () { 246 | return (Module['_free'] = Module['asm']['r']).apply(null, arguments); 247 | }; 248 | Module['_ZSTD_isError'] = function () { 249 | return (Module['_ZSTD_isError'] = Module['asm']['f']).apply(null, arguments); 250 | }; 251 | Module['_ZSTD_compressBound'] = function () { 252 | return (Module['_ZSTD_compressBound'] = Module['asm']['g']).apply(null, arguments); 253 | }; 254 | Module['_ZSTD_createCCtx'] = function () { 255 | return (Module['_ZSTD_createCCtx'] = Module['asm']['h']).apply(null, arguments); 256 | }; 257 | Module['_ZSTD_freeCCtx'] = function () { 258 | return (Module['_ZSTD_freeCCtx'] = Module['asm']['i']).apply(null, arguments); 259 | }; 260 | Module['_ZSTD_compress_usingDict'] = function () { 261 | return (Module['_ZSTD_compress_usingDict'] = Module['asm']['j']).apply(null, arguments); 262 | }; 263 | Module['_ZSTD_compress'] = function () { 264 | return (Module['_ZSTD_compress'] = Module['asm']['k']).apply(null, arguments); 265 | }; 266 | Module['_ZSTD_createDCtx'] = function () { 267 | return (Module['_ZSTD_createDCtx'] = Module['asm']['l']).apply(null, arguments); 268 | }; 269 | Module['_ZSTD_freeDCtx'] = function () { 270 | return (Module['_ZSTD_freeDCtx'] = Module['asm']['m']).apply(null, arguments); 271 | }; 272 | Module['_ZSTD_getFrameContentSize'] = function () { 273 | return (Module['_ZSTD_getFrameContentSize'] = Module['asm']['n']).apply(null, arguments); 274 | }; 275 | Module['_ZSTD_decompress_usingDict'] = function () { 276 | return (Module['_ZSTD_decompress_usingDict'] = Module['asm']['o']).apply(null, arguments); 277 | }; 278 | Module['_ZSTD_decompress'] = function () { 279 | return (Module['_ZSTD_decompress'] = Module['asm']['p']).apply(null, arguments); 280 | }; 281 | 282 | var calledRun; 283 | dependenciesFulfilled = function runCaller() { 284 | if (!calledRun) run(); 285 | if (!calledRun) dependenciesFulfilled = runCaller; 286 | }; 287 | function run(args) { 288 | args = args || arguments_; 289 | if (runDependencies > 0) { 290 | return; 291 | } 292 | preRun(); 293 | if (runDependencies > 0) { 294 | return; 295 | } 296 | function doRun() { 297 | if (calledRun) return; 298 | calledRun = true; 299 | Module['calledRun'] = true; 300 | if (ABORT) return; 301 | initRuntime(); 302 | if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized'](); 303 | postRun(); 304 | } 305 | if (Module['setStatus']) { 306 | Module['setStatus']('Running...'); 307 | setTimeout(function () { 308 | setTimeout(function () { 309 | Module['setStatus'](''); 310 | }, 1); 311 | doRun(); 312 | }, 1); 313 | } else { 314 | doRun(); 315 | } 316 | } 317 | Module['run'] = run; 318 | if (Module['preInit']) { 319 | if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']]; 320 | while (Module['preInit'].length > 0) { 321 | Module['preInit'].pop()(); 322 | } 323 | } 324 | Module['init'] = init; 325 | export default Module; 326 | -------------------------------------------------------------------------------- /lib/zstd.ts: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | var Module = typeof Module !== 'undefined' ? Module : {}; 3 | var moduleOverrides = {}; 4 | var key; 5 | for (key in Module) { 6 | if (Module.hasOwnProperty(key)) { 7 | moduleOverrides[key] = Module[key]; 8 | } 9 | } 10 | var arguments_ = []; 11 | var err = Module['printErr'] || console.warn.bind(console); 12 | for (key in moduleOverrides) { 13 | if (moduleOverrides.hasOwnProperty(key)) { 14 | Module[key] = moduleOverrides[key]; 15 | } 16 | } 17 | 18 | var quit_ = (status, toThrow) => { 19 | throw toThrow; 20 | }; 21 | 22 | moduleOverrides = null; 23 | if (Module['arguments']) arguments_ = Module['arguments']; 24 | if (Module['thisProgram']) thisProgram = Module['thisProgram']; 25 | if (Module['quit']) quit_ = Module['quit']; 26 | var tempRet0 = 0; 27 | var setTempRet0 = function (value) { 28 | tempRet0 = value; 29 | }; 30 | if (typeof WebAssembly !== 'object') { 31 | abort('no native wasm support detected'); 32 | } 33 | var wasmMemory; 34 | var ABORT = false; 35 | var EXITSTATUS; 36 | var buffer, HEAPU8, HEAP8; 37 | 38 | function updateMemoryViews() { 39 | var b = wasmMemory.buffer; 40 | Module['HEAP8'] = HEAP8 = new Int8Array(b); 41 | Module['HEAPU8'] = HEAPU8 = new Uint8Array(b); 42 | } 43 | 44 | var __ATPRERUN__ = []; 45 | var __ATINIT__ = []; 46 | var __ATPOSTRUN__ = []; 47 | var runtimeInitialized = false; 48 | 49 | function preRun() { 50 | if (Module['preRun']) { 51 | if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']]; 52 | while (Module['preRun'].length) { 53 | addOnPreRun(Module['preRun'].shift()); 54 | } 55 | } 56 | callRuntimeCallbacks(__ATPRERUN__); 57 | } 58 | function initRuntime() { 59 | runtimeInitialized = true; 60 | callRuntimeCallbacks(__ATINIT__); 61 | } 62 | function postRun() { 63 | if (Module['postRun']) { 64 | if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']]; 65 | while (Module['postRun'].length) { 66 | addOnPostRun(Module['postRun'].shift()); 67 | } 68 | } 69 | callRuntimeCallbacks(__ATPOSTRUN__); 70 | } 71 | function addOnPreRun(cb) { 72 | __ATPRERUN__.unshift(cb); 73 | } 74 | function addOnInit(cb) { 75 | __ATINIT__.unshift(cb); 76 | } 77 | function addOnPostRun(cb) { 78 | __ATPOSTRUN__.unshift(cb); 79 | } 80 | var runDependencies = 0; 81 | var dependenciesFulfilled = null; 82 | function addRunDependency(id) { 83 | runDependencies++; 84 | Module['monitorRunDependencies']?.(runDependencies); 85 | } 86 | function removeRunDependency(id) { 87 | runDependencies--; 88 | Module['monitorRunDependencies']?.(runDependencies); 89 | if (runDependencies == 0) { 90 | if (dependenciesFulfilled) { 91 | var callback = dependenciesFulfilled; 92 | dependenciesFulfilled = null; 93 | callback(); 94 | } 95 | } 96 | } 97 | function abort(what) { 98 | Module['onAbort']?.(what); 99 | what = 'Aborted(' + what + ')'; 100 | err(what); 101 | ABORT = true; 102 | what += '. Build with -sASSERTIONS for more info.'; 103 | var e = new WebAssembly.RuntimeError(what); 104 | throw e; 105 | } 106 | 107 | function getWasmImports() { 108 | return { a: wasmImports }; 109 | } 110 | 111 | function getBinaryPromise(url) { 112 | return fetch(url, { credentials: 'same-origin' }).then(function (response) { 113 | if (!response['ok']) { 114 | throw "failed to load wasm binary file at '" + url + "'"; 115 | } 116 | return response['arrayBuffer'](); 117 | }); 118 | } 119 | 120 | function init(filePathOrBuf) { 121 | var info = getWasmImports(); 122 | function receiveInstance(instance, module) { 123 | wasmExports = instance.exports; 124 | wasmMemory = wasmExports['f']; 125 | updateMemoryViews(); 126 | addOnInit(wasmExports['g']); 127 | removeRunDependency('wasm-instantiate'); 128 | return wasmExports; 129 | } 130 | addRunDependency('wasm-instantiate'); 131 | function receiveInstantiationResult(result) { 132 | receiveInstance(result['instance']); 133 | } 134 | function instantiateArrayBuffer(receiver) { 135 | return getBinaryPromise(filePathOrBuf) 136 | .then(function (binary) { 137 | var result = WebAssembly.instantiate(binary, info); 138 | return result; 139 | }) 140 | .then(receiver, function (reason) { 141 | err('failed to asynchronously prepare wasm: ' + reason); 142 | abort(reason); 143 | }); 144 | } 145 | function instantiateAsync() { 146 | if (filePathOrBuf && filePathOrBuf.byteLength > 0) { 147 | return WebAssembly.instantiate(filePathOrBuf, info).then(receiveInstantiationResult, function (reason) { 148 | err('wasm compile failed: ' + reason); 149 | }); 150 | } else if ( 151 | typeof WebAssembly.instantiateStreaming === 'function' && 152 | typeof filePathOrBuf === 'string' && 153 | typeof fetch === 'function' 154 | ) { 155 | return fetch(filePathOrBuf, { credentials: 'same-origin' }).then(function (response) { 156 | var result = WebAssembly.instantiateStreaming(response, info); 157 | return result.then(receiveInstantiationResult, function (reason) { 158 | err('wasm streaming compile failed: ' + reason); 159 | err('falling back to ArrayBuffer instantiation'); 160 | return instantiateArrayBuffer(receiveInstantiationResult); 161 | }); 162 | }); 163 | } else { 164 | return instantiateArrayBuffer(receiveInstantiationResult); 165 | } 166 | } 167 | if (Module['instantiateWasm']) { 168 | try { 169 | var exports = Module['instantiateWasm'](info, receiveInstance); 170 | return exports; 171 | } catch (e) { 172 | err('Module.instantiateWasm callback failed with error: ' + e); 173 | return false; 174 | } 175 | } 176 | instantiateAsync(); 177 | return {}; 178 | } 179 | 180 | class ExitStatus { 181 | name = 'ExitStatus'; 182 | constructor(status) { 183 | this.message = `Program terminated with exit(${status})`; 184 | this.status = status; 185 | } 186 | } 187 | var callRuntimeCallbacks = (callbacks) => { 188 | while (callbacks.length > 0) { 189 | callbacks.shift()(Module); 190 | } 191 | }; 192 | var noExitRuntime = Module['noExitRuntime'] || true; 193 | var __abort_js = () => abort(''); 194 | var runtimeKeepaliveCounter = 0; 195 | var __emscripten_runtime_keepalive_clear = () => { 196 | noExitRuntime = false; 197 | runtimeKeepaliveCounter = 0; 198 | }; 199 | var timers = {}; 200 | var handleException = (e) => { 201 | if (e instanceof ExitStatus || e == 'unwind') { 202 | return EXITSTATUS; 203 | } 204 | quit_(1, e); 205 | }; 206 | var keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0; 207 | var _proc_exit = (code) => { 208 | EXITSTATUS = code; 209 | if (!keepRuntimeAlive()) { 210 | Module['onExit']?.(code); 211 | ABORT = true; 212 | } 213 | quit_(code, new ExitStatus(code)); 214 | }; 215 | var exitJS = (status, implicit) => { 216 | EXITSTATUS = status; 217 | _proc_exit(status); 218 | }; 219 | 220 | var _exit = exitJS; 221 | var maybeExit = () => { 222 | if (!keepRuntimeAlive()) { 223 | try { 224 | _exit(EXITSTATUS); 225 | } catch (e) { 226 | handleException(e); 227 | } 228 | } 229 | }; 230 | 231 | var callUserCallback = (func) => { 232 | if (ABORT) { 233 | return; 234 | } 235 | try { 236 | func(); 237 | maybeExit(); 238 | } catch (e) { 239 | handleException(e); 240 | } 241 | }; 242 | var _emscripten_get_now = () => performance.now(); 243 | var __setitimer_js = (which, timeout_ms) => { 244 | if (timers[which]) { 245 | clearTimeout(timers[which].id); 246 | delete timers[which]; 247 | } 248 | if (!timeout_ms) return 0; 249 | var id = setTimeout(() => { 250 | delete timers[which]; 251 | callUserCallback(() => __emscripten_timeout(which, _emscripten_get_now())); 252 | }, timeout_ms); 253 | timers[which] = { id, timeout_ms }; 254 | return 0; 255 | }; 256 | 257 | var getHeapMax = () => 2147483648; 258 | var alignMemory = (size, alignment) => Math.ceil(size / alignment) * alignment; 259 | var growMemory = (size) => { 260 | var b = wasmMemory.buffer; 261 | var pages = ((size - b.byteLength + 65535) / 65536) | 0; 262 | try { 263 | wasmMemory.grow(pages); 264 | updateMemoryViews(); 265 | return 1; 266 | } catch (e) {} 267 | }; 268 | var _emscripten_resize_heap = (requestedSize) => { 269 | var oldSize = HEAPU8.length; 270 | requestedSize >>>= 0; 271 | var maxHeapSize = getHeapMax(); 272 | if (requestedSize > maxHeapSize) { 273 | return false; 274 | } 275 | for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { 276 | var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); 277 | overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); 278 | var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536)); 279 | var replacement = growMemory(newSize); 280 | if (replacement) { 281 | return true; 282 | } 283 | } 284 | return false; 285 | }; 286 | 287 | var wasmImports = { 288 | c: __abort_js, 289 | b: __emscripten_runtime_keepalive_clear, 290 | d: __setitimer_js, 291 | e: _emscripten_resize_heap, 292 | a: _proc_exit, 293 | }; 294 | var wasmExports; 295 | 296 | var ___wasm_call_ctors = () => (___wasm_call_ctors = wasmExports['g'])(); 297 | var _ZSTD_isError = (Module['_ZSTD_isError'] = (a0) => 298 | (_ZSTD_isError = Module['_ZSTD_isError'] = wasmExports['h'])(a0)); 299 | var _ZSTD_compressBound = (Module['_ZSTD_compressBound'] = (a0) => 300 | (_ZSTD_compressBound = Module['_ZSTD_compressBound'] = wasmExports['i'])(a0)); 301 | var _ZSTD_createCCtx = (Module['_ZSTD_createCCtx'] = () => 302 | (_ZSTD_createCCtx = Module['_ZSTD_createCCtx'] = wasmExports['j'])()); 303 | var _ZSTD_freeCCtx = (Module['_ZSTD_freeCCtx'] = (a0) => 304 | (_ZSTD_freeCCtx = Module['_ZSTD_freeCCtx'] = wasmExports['k'])(a0)); 305 | var _ZSTD_compress_usingDict = (Module['_ZSTD_compress_usingDict'] = (a0, a1, a2, a3, a4, a5, a6, a7) => 306 | (_ZSTD_compress_usingDict = Module['_ZSTD_compress_usingDict'] = wasmExports['l'])(a0, a1, a2, a3, a4, a5, a6, a7)); 307 | var _ZSTD_compress = (Module['_ZSTD_compress'] = (a0, a1, a2, a3, a4) => 308 | (_ZSTD_compress = Module['_ZSTD_compress'] = wasmExports['m'])(a0, a1, a2, a3, a4)); 309 | var _ZSTD_createDCtx = (Module['_ZSTD_createDCtx'] = () => 310 | (_ZSTD_createDCtx = Module['_ZSTD_createDCtx'] = wasmExports['n'])()); 311 | var _ZSTD_freeDCtx = (Module['_ZSTD_freeDCtx'] = (a0) => 312 | (_ZSTD_freeDCtx = Module['_ZSTD_freeDCtx'] = wasmExports['o'])(a0)); 313 | var _ZSTD_getFrameContentSize = (Module['_ZSTD_getFrameContentSize'] = (a0, a1) => 314 | (_ZSTD_getFrameContentSize = Module['_ZSTD_getFrameContentSize'] = wasmExports['p'])(a0, a1)); 315 | var _ZSTD_decompress_usingDict = (Module['_ZSTD_decompress_usingDict'] = (a0, a1, a2, a3, a4, a5, a6) => 316 | (_ZSTD_decompress_usingDict = Module['_ZSTD_decompress_usingDict'] = wasmExports['q'])(a0, a1, a2, a3, a4, a5, a6)); 317 | var _ZSTD_decompress = (Module['_ZSTD_decompress'] = (a0, a1, a2, a3) => 318 | (_ZSTD_decompress = Module['_ZSTD_decompress'] = wasmExports['r'])(a0, a1, a2, a3)); 319 | var _malloc = (Module['_malloc'] = (a0) => (_malloc = Module['_malloc'] = wasmExports['s'])(a0)); 320 | var _free = (Module['_free'] = (a0) => (_free = Module['_free'] = wasmExports['t'])(a0)); 321 | var __emscripten_timeout = (a0, a1) => (__emscripten_timeout = wasmExports['v'])(a0, a1); 322 | 323 | var calledRun; 324 | dependenciesFulfilled = function runCaller() { 325 | if (!calledRun) run(); 326 | if (!calledRun) dependenciesFulfilled = runCaller; 327 | }; 328 | function run() { 329 | if (runDependencies > 0) { 330 | return; 331 | } 332 | preRun(); 333 | if (runDependencies > 0) { 334 | return; 335 | } 336 | function doRun() { 337 | if (calledRun) return; 338 | calledRun = true; 339 | Module['calledRun'] = true; 340 | if (ABORT) return; 341 | initRuntime(); 342 | Module['onRuntimeInitialized']?.(); 343 | postRun(); 344 | } 345 | if (Module['setStatus']) { 346 | Module['setStatus']('Running...'); 347 | setTimeout(() => { 348 | setTimeout(() => Module['setStatus'](''), 1); 349 | doRun(); 350 | }, 1); 351 | } else { 352 | doRun(); 353 | } 354 | } 355 | Module['run'] = run; 356 | if (Module['preInit']) { 357 | if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']]; 358 | while (Module['preInit'].length > 0) { 359 | Module['preInit'].pop()(); 360 | } 361 | } 362 | Module['init'] = init; 363 | 364 | export { Module }; 365 | -------------------------------------------------------------------------------- /examples/vite/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@bokuweb/zstd-wasm@0.0.21-alpha.5": 6 | version "0.0.21-alpha.5" 7 | resolved "https://registry.yarnpkg.com/@bokuweb/zstd-wasm/-/zstd-wasm-0.0.21-alpha.5.tgz#e8f8732b639f727fec48fa6516e575aff685cd73" 8 | integrity sha512-HydRNavt4rlQH3sbAG1iksR9V9+AsxfAXSzG5zRoksFn0f+yq8VqJ/BFp5MdcGt6lzNdELDiCOjKvJ3NpSc+Qw== 9 | 10 | "@esbuild/aix-ppc64@0.21.5": 11 | version "0.21.5" 12 | resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" 13 | integrity sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ== 14 | 15 | "@esbuild/android-arm64@0.21.5": 16 | version "0.21.5" 17 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052" 18 | integrity sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A== 19 | 20 | "@esbuild/android-arm@0.21.5": 21 | version "0.21.5" 22 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28" 23 | integrity sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg== 24 | 25 | "@esbuild/android-x64@0.21.5": 26 | version "0.21.5" 27 | resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e" 28 | integrity sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA== 29 | 30 | "@esbuild/darwin-arm64@0.21.5": 31 | version "0.21.5" 32 | resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a" 33 | integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ== 34 | 35 | "@esbuild/darwin-x64@0.21.5": 36 | version "0.21.5" 37 | resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22" 38 | integrity sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw== 39 | 40 | "@esbuild/freebsd-arm64@0.21.5": 41 | version "0.21.5" 42 | resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e" 43 | integrity sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g== 44 | 45 | "@esbuild/freebsd-x64@0.21.5": 46 | version "0.21.5" 47 | resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261" 48 | integrity sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ== 49 | 50 | "@esbuild/linux-arm64@0.21.5": 51 | version "0.21.5" 52 | resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b" 53 | integrity sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q== 54 | 55 | "@esbuild/linux-arm@0.21.5": 56 | version "0.21.5" 57 | resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9" 58 | integrity sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA== 59 | 60 | "@esbuild/linux-ia32@0.21.5": 61 | version "0.21.5" 62 | resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2" 63 | integrity sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg== 64 | 65 | "@esbuild/linux-loong64@0.21.5": 66 | version "0.21.5" 67 | resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df" 68 | integrity sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg== 69 | 70 | "@esbuild/linux-mips64el@0.21.5": 71 | version "0.21.5" 72 | resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe" 73 | integrity sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg== 74 | 75 | "@esbuild/linux-ppc64@0.21.5": 76 | version "0.21.5" 77 | resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4" 78 | integrity sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w== 79 | 80 | "@esbuild/linux-riscv64@0.21.5": 81 | version "0.21.5" 82 | resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc" 83 | integrity sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA== 84 | 85 | "@esbuild/linux-s390x@0.21.5": 86 | version "0.21.5" 87 | resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de" 88 | integrity sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A== 89 | 90 | "@esbuild/linux-x64@0.21.5": 91 | version "0.21.5" 92 | resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0" 93 | integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ== 94 | 95 | "@esbuild/netbsd-x64@0.21.5": 96 | version "0.21.5" 97 | resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047" 98 | integrity sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg== 99 | 100 | "@esbuild/openbsd-x64@0.21.5": 101 | version "0.21.5" 102 | resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70" 103 | integrity sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow== 104 | 105 | "@esbuild/sunos-x64@0.21.5": 106 | version "0.21.5" 107 | resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b" 108 | integrity sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg== 109 | 110 | "@esbuild/win32-arm64@0.21.5": 111 | version "0.21.5" 112 | resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d" 113 | integrity sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A== 114 | 115 | "@esbuild/win32-ia32@0.21.5": 116 | version "0.21.5" 117 | resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b" 118 | integrity sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA== 119 | 120 | "@esbuild/win32-x64@0.21.5": 121 | version "0.21.5" 122 | resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" 123 | integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw== 124 | 125 | "@rollup/pluginutils@^5.1.0": 126 | version "5.1.0" 127 | resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.0.tgz#7e53eddc8c7f483a4ad0b94afb1f7f5fd3c771e0" 128 | integrity sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g== 129 | dependencies: 130 | "@types/estree" "^1.0.0" 131 | estree-walker "^2.0.2" 132 | picomatch "^2.3.1" 133 | 134 | "@rollup/rollup-android-arm-eabi@4.21.0": 135 | version "4.21.0" 136 | resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.0.tgz#d941173f82f9b041c61b0dc1a2a91dcd06e4b31e" 137 | integrity sha512-WTWD8PfoSAJ+qL87lE7votj3syLavxunWhzCnx3XFxFiI/BA/r3X7MUM8dVrH8rb2r4AiO8jJsr3ZjdaftmnfA== 138 | 139 | "@rollup/rollup-android-arm64@4.21.0": 140 | version "4.21.0" 141 | resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.0.tgz#7e7157c8543215245ceffc445134d9e843ba51c0" 142 | integrity sha512-a1sR2zSK1B4eYkiZu17ZUZhmUQcKjk2/j9Me2IDjk1GHW7LB5Z35LEzj9iJch6gtUfsnvZs1ZNyDW2oZSThrkA== 143 | 144 | "@rollup/rollup-darwin-arm64@4.21.0": 145 | version "4.21.0" 146 | resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.0.tgz#f0a18a4fc8dc6eb1e94a51fa2adb22876f477947" 147 | integrity sha512-zOnKWLgDld/svhKO5PD9ozmL6roy5OQ5T4ThvdYZLpiOhEGY+dp2NwUmxK0Ld91LrbjrvtNAE0ERBwjqhZTRAA== 148 | 149 | "@rollup/rollup-darwin-x64@4.21.0": 150 | version "4.21.0" 151 | resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.0.tgz#34b7867613e5cc42d2b85ddc0424228cc33b43f0" 152 | integrity sha512-7doS8br0xAkg48SKE2QNtMSFPFUlRdw9+votl27MvT46vo44ATBmdZdGysOevNELmZlfd+NEa0UYOA8f01WSrg== 153 | 154 | "@rollup/rollup-linux-arm-gnueabihf@4.21.0": 155 | version "4.21.0" 156 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.0.tgz#422b19ff9ae02b05d3395183d1d43b38c7c8be0b" 157 | integrity sha512-pWJsfQjNWNGsoCq53KjMtwdJDmh/6NubwQcz52aEwLEuvx08bzcy6tOUuawAOncPnxz/3siRtd8hiQ32G1y8VA== 158 | 159 | "@rollup/rollup-linux-arm-musleabihf@4.21.0": 160 | version "4.21.0" 161 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.0.tgz#568aa29195ef6fc57ec6ed3f518923764406a8ee" 162 | integrity sha512-efRIANsz3UHZrnZXuEvxS9LoCOWMGD1rweciD6uJQIx2myN3a8Im1FafZBzh7zk1RJ6oKcR16dU3UPldaKd83w== 163 | 164 | "@rollup/rollup-linux-arm64-gnu@4.21.0": 165 | version "4.21.0" 166 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.0.tgz#22309c8bcba9a73114f69165c72bc94b2fbec085" 167 | integrity sha512-ZrPhydkTVhyeGTW94WJ8pnl1uroqVHM3j3hjdquwAcWnmivjAwOYjTEAuEDeJvGX7xv3Z9GAvrBkEzCgHq9U1w== 168 | 169 | "@rollup/rollup-linux-arm64-musl@4.21.0": 170 | version "4.21.0" 171 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.0.tgz#c93c388af6d33f082894b8a60839d7265b2b9bc5" 172 | integrity sha512-cfaupqd+UEFeURmqNP2eEvXqgbSox/LHOyN9/d2pSdV8xTrjdg3NgOFJCtc1vQ/jEke1qD0IejbBfxleBPHnPw== 173 | 174 | "@rollup/rollup-linux-powerpc64le-gnu@4.21.0": 175 | version "4.21.0" 176 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.0.tgz#493c5e19e395cf3c6bd860c7139c8a903dea72b4" 177 | integrity sha512-ZKPan1/RvAhrUylwBXC9t7B2hXdpb/ufeu22pG2psV7RN8roOfGurEghw1ySmX/CmDDHNTDDjY3lo9hRlgtaHg== 178 | 179 | "@rollup/rollup-linux-riscv64-gnu@4.21.0": 180 | version "4.21.0" 181 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.0.tgz#a2eab4346fbe5909165ce99adb935ba30c9fb444" 182 | integrity sha512-H1eRaCwd5E8eS8leiS+o/NqMdljkcb1d6r2h4fKSsCXQilLKArq6WS7XBLDu80Yz+nMqHVFDquwcVrQmGr28rg== 183 | 184 | "@rollup/rollup-linux-s390x-gnu@4.21.0": 185 | version "4.21.0" 186 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.0.tgz#0bc49a79db4345d78d757bb1b05e73a1b42fa5c3" 187 | integrity sha512-zJ4hA+3b5tu8u7L58CCSI0A9N1vkfwPhWd/puGXwtZlsB5bTkwDNW/+JCU84+3QYmKpLi+XvHdmrlwUwDA6kqw== 188 | 189 | "@rollup/rollup-linux-x64-gnu@4.21.0": 190 | version "4.21.0" 191 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.0.tgz#4fd36a6a41f3406d8693321b13d4f9b7658dd4b9" 192 | integrity sha512-e2hrvElFIh6kW/UNBQK/kzqMNY5mO+67YtEh9OA65RM5IJXYTWiXjX6fjIiPaqOkBthYF1EqgiZ6OXKcQsM0hg== 193 | 194 | "@rollup/rollup-linux-x64-musl@4.21.0": 195 | version "4.21.0" 196 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.0.tgz#10ebb13bd4469cbad1a5d9b073bd27ec8a886200" 197 | integrity sha512-1vvmgDdUSebVGXWX2lIcgRebqfQSff0hMEkLJyakQ9JQUbLDkEaMsPTLOmyccyC6IJ/l3FZuJbmrBw/u0A0uCQ== 198 | 199 | "@rollup/rollup-win32-arm64-msvc@4.21.0": 200 | version "4.21.0" 201 | resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.0.tgz#2fef1a90f1402258ef915ae5a94cc91a5a1d5bfc" 202 | integrity sha512-s5oFkZ/hFcrlAyBTONFY1TWndfyre1wOMwU+6KCpm/iatybvrRgmZVM+vCFwxmC5ZhdlgfE0N4XorsDpi7/4XQ== 203 | 204 | "@rollup/rollup-win32-ia32-msvc@4.21.0": 205 | version "4.21.0" 206 | resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.0.tgz#a18ad47a95c5f264defb60acdd8c27569f816fc1" 207 | integrity sha512-G9+TEqRnAA6nbpqyUqgTiopmnfgnMkR3kMukFBDsiyy23LZvUCpiUwjTRx6ezYCjJODXrh52rBR9oXvm+Fp5wg== 208 | 209 | "@rollup/rollup-win32-x64-msvc@4.21.0": 210 | version "4.21.0" 211 | resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.0.tgz#20c09cf44dcb082140cc7f439dd679fe4bba3375" 212 | integrity sha512-2jsCDZwtQvRhejHLfZ1JY6w6kEuEtfF9nzYsZxzSlNVKDX+DpsDJ+Rbjkm74nvg2rdx0gwBS+IMdvwJuq3S9pQ== 213 | 214 | "@types/estree@1.0.5", "@types/estree@^1.0.0": 215 | version "1.0.5" 216 | resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" 217 | integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== 218 | 219 | base64-js@^1.3.1: 220 | version "1.5.1" 221 | resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" 222 | integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== 223 | 224 | buffer@^6.0.3: 225 | version "6.0.3" 226 | resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" 227 | integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== 228 | dependencies: 229 | base64-js "^1.3.1" 230 | ieee754 "^1.2.1" 231 | 232 | esbuild@^0.21.3: 233 | version "0.21.5" 234 | resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d" 235 | integrity sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw== 236 | optionalDependencies: 237 | "@esbuild/aix-ppc64" "0.21.5" 238 | "@esbuild/android-arm" "0.21.5" 239 | "@esbuild/android-arm64" "0.21.5" 240 | "@esbuild/android-x64" "0.21.5" 241 | "@esbuild/darwin-arm64" "0.21.5" 242 | "@esbuild/darwin-x64" "0.21.5" 243 | "@esbuild/freebsd-arm64" "0.21.5" 244 | "@esbuild/freebsd-x64" "0.21.5" 245 | "@esbuild/linux-arm" "0.21.5" 246 | "@esbuild/linux-arm64" "0.21.5" 247 | "@esbuild/linux-ia32" "0.21.5" 248 | "@esbuild/linux-loong64" "0.21.5" 249 | "@esbuild/linux-mips64el" "0.21.5" 250 | "@esbuild/linux-ppc64" "0.21.5" 251 | "@esbuild/linux-riscv64" "0.21.5" 252 | "@esbuild/linux-s390x" "0.21.5" 253 | "@esbuild/linux-x64" "0.21.5" 254 | "@esbuild/netbsd-x64" "0.21.5" 255 | "@esbuild/openbsd-x64" "0.21.5" 256 | "@esbuild/sunos-x64" "0.21.5" 257 | "@esbuild/win32-arm64" "0.21.5" 258 | "@esbuild/win32-ia32" "0.21.5" 259 | "@esbuild/win32-x64" "0.21.5" 260 | 261 | estree-walker@^2.0.2: 262 | version "2.0.2" 263 | resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" 264 | integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== 265 | 266 | fsevents@~2.3.2, fsevents@~2.3.3: 267 | version "2.3.3" 268 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" 269 | integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== 270 | 271 | ieee754@^1.2.1: 272 | version "1.2.1" 273 | resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" 274 | integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== 275 | 276 | nanoid@^3.3.7: 277 | version "3.3.7" 278 | resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" 279 | integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== 280 | 281 | picocolors@^1.0.1: 282 | version "1.0.1" 283 | resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" 284 | integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== 285 | 286 | picomatch@^2.3.1: 287 | version "2.3.1" 288 | resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" 289 | integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== 290 | 291 | postcss@^8.4.41: 292 | version "8.4.41" 293 | resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.41.tgz#d6104d3ba272d882fe18fc07d15dc2da62fa2681" 294 | integrity sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ== 295 | dependencies: 296 | nanoid "^3.3.7" 297 | picocolors "^1.0.1" 298 | source-map-js "^1.2.0" 299 | 300 | rollup@^4.13.0: 301 | version "4.21.0" 302 | resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.21.0.tgz#28db5f5c556a5180361d35009979ccc749560b9d" 303 | integrity sha512-vo+S/lfA2lMS7rZ2Qoubi6I5hwZwzXeUIctILZLbHI+laNtvhhOIon2S1JksA5UEDQ7l3vberd0fxK44lTYjbQ== 304 | dependencies: 305 | "@types/estree" "1.0.5" 306 | optionalDependencies: 307 | "@rollup/rollup-android-arm-eabi" "4.21.0" 308 | "@rollup/rollup-android-arm64" "4.21.0" 309 | "@rollup/rollup-darwin-arm64" "4.21.0" 310 | "@rollup/rollup-darwin-x64" "4.21.0" 311 | "@rollup/rollup-linux-arm-gnueabihf" "4.21.0" 312 | "@rollup/rollup-linux-arm-musleabihf" "4.21.0" 313 | "@rollup/rollup-linux-arm64-gnu" "4.21.0" 314 | "@rollup/rollup-linux-arm64-musl" "4.21.0" 315 | "@rollup/rollup-linux-powerpc64le-gnu" "4.21.0" 316 | "@rollup/rollup-linux-riscv64-gnu" "4.21.0" 317 | "@rollup/rollup-linux-s390x-gnu" "4.21.0" 318 | "@rollup/rollup-linux-x64-gnu" "4.21.0" 319 | "@rollup/rollup-linux-x64-musl" "4.21.0" 320 | "@rollup/rollup-win32-arm64-msvc" "4.21.0" 321 | "@rollup/rollup-win32-ia32-msvc" "4.21.0" 322 | "@rollup/rollup-win32-x64-msvc" "4.21.0" 323 | fsevents "~2.3.2" 324 | 325 | source-map-js@^1.2.0: 326 | version "1.2.0" 327 | resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" 328 | integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg== 329 | 330 | typescript@^5.5.3: 331 | version "5.5.4" 332 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" 333 | integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== 334 | 335 | vite-plugin-wasm@^3.3.0: 336 | version "3.3.0" 337 | resolved "https://registry.yarnpkg.com/vite-plugin-wasm/-/vite-plugin-wasm-3.3.0.tgz#2908ef2529bf8f33f4e549c8c6fda26ad273ca15" 338 | integrity sha512-tVhz6w+W9MVsOCHzxo6SSMSswCeIw4HTrXEi6qL3IRzATl83jl09JVO1djBqPSwfjgnpVHNLYcaMbaDX5WB/pg== 339 | 340 | vite@^5.4.1: 341 | version "5.4.1" 342 | resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.1.tgz#2aa72370de824d23f53658affd807e4c9905b058" 343 | integrity sha512-1oE6yuNXssjrZdblI9AfBbHCC41nnyoVoEZxQnID6yvQZAFBzxxkqoFLtHUMkYunL8hwOLEjgTuxpkRxvba3kA== 344 | dependencies: 345 | esbuild "^0.21.3" 346 | postcss "^8.4.41" 347 | rollup "^4.13.0" 348 | optionalDependencies: 349 | fsevents "~2.3.3" 350 | --------------------------------------------------------------------------------