@thewtex/zstddec
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "@thewtex/zstddec", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "ZSTD (Zstandard) decoder for Web and Node.js, using WebAssembly", | ||
"repository": "github:donmccurdy/zstddec", | ||
"main": "dist/zstddec.js", | ||
"type": "module", | ||
"exports": { | ||
"types": "dist/zstddec.d.ts", | ||
"require": "./dist/zstddec.cjs", | ||
"default": "./dist/zstddec.modern.js" | ||
}, | ||
"main": "dist/zstddec.cjs", | ||
"module": "dist/zstddec.modern.js", | ||
@@ -14,4 +20,4 @@ "source": "zstddec.ts", | ||
"test": "npm run test:node && npm run test:browser", | ||
"test:node": "tape *.test.js | tap-spec", | ||
"test:browser": "browserify *.test.js | tape-run | tap-spec", | ||
"test:node": "tape *.test.cjs | tap-spec", | ||
"test:browser": "browserify *.test.cjs | tape-run | tap-spec", | ||
"preversion": "npm run dist && npm run test", | ||
@@ -18,0 +24,0 @@ "postversion": "git push && git push --tags && npm publish" |
@@ -51,3 +51,24 @@ # zstddec | ||
./combine.sh -r ../../lib -o zstddeclib.c zstddeclib-in.c | ||
emcc zstddeclib.c -Oz -s EXPORTED_FUNCTIONS="['_ZSTD_decompress', '_ZSTD_findDecompressedSize', '_ZSTD_isError', '_malloc', '_free']" -Wl,--no-entry -s STANDALONE_WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s MALLOC=emmalloc -o zstddec.wasm | ||
``` | ||
Add the following to the end of *zstddeclib.c* to [shim out unused wasi | ||
imports](https://github.com/emscripten-core/emscripten/issues/17331), | ||
```c | ||
int __wasi_fd_write(int, int, int, int) { | ||
__builtin_trap(); | ||
} | ||
int __wasi_fd_seek(int, int64_t, int, int) { | ||
__builtin_trap(); | ||
} | ||
int __wasi_fd_close(int) { | ||
__builtin_trap(); | ||
} | ||
_Noreturn void __wasi_proc_exit(int) { | ||
__builtin_trap(); | ||
} | ||
``` | ||
```shell | ||
emcc zstddeclib.c -Oz -s EXPORTED_FUNCTIONS="['_ZSTD_decompress', '_ZSTD_findDecompressedSize', '_ZSTD_isError', '_malloc', '_free']" -Wl,--no-entry -s ALLOW_MEMORY_GROWTH=1 -s MALLOC=emmalloc -o zstddec.wasm | ||
base64 -w 0 zstddec.wasm > zstddec.txt | ||
@@ -54,0 +75,0 @@ ``` |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
83
Yes
460200
1134
5