Code Monkey home page Code Monkey logo

zstd-emscripten's Introduction

Zstd Emscripten build

This build is based on facebook/zstd and provides a thin WebAssembly wrapper around the zstd.h API. Please see index.html for a demo and usage example.

This is a size-optimized build (ZSTD_MINIFY_LIB and ZSTD_NO_INLINE build flags). The build output is four versions of the binding: full, compress-only, decompress-only, and compress+decompress-only. The brotli-compressed size of the wasm varies from 23 kB decompress-only to 76kB full binding.

This repo tracks the upstream as a submodule.

The previous forked repo is archived.

Thanks to Fredrick R. Brennan for their awesome work bringing the forked repo up-to-date with upstream Zstandard and fixing the CMake build files.

Build

Skip the first line if you already have Emscripten set up.

git clone https://github.com/emscripten-core/emsdk.git && cd emsdk && ./emsdk install latest && ./emsdk activate latest && source ./emsdk_env.sh && cd .. &&
git clone https://github.com/kig/zstd-emscripten && cd zstd-emscripten && git submodule update --init &&
mkdir -p build && cd build && emcmake cmake ../cmake/ && emmake make -j4 && cd .. &&
serve -p 5000
# open http://localhost:5000/index.html

Usage

See the test page for examples on using the simple API and the streaming compression and decompression API.

Zstd-emscripten is a 1:1 binding to the ZSTD API in zstd.h, please refer to the ZSTD docs for further details.

The compress-only and decompress-only versions of the library bind just a few functions, see exported_functions_compress.txt and exported_functions_decompress.txt for the exported function lists. The full version function list is in exported_functions.txt.

License

(c) 2016โ€“2021 Ilmari Heikkinen, Fredrick R. Brennan. As with Zstd itself, this is dual-licensed under BSD and GPLv2.

zstd-emscripten's People

Contributors

kig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.