crossbind
GitHub

A library in your C++

A library is also there for your own C++: include its header and call it.

crossbind.config.js lists zstd's package, a crossbind port, as a dependency. That puts zstd.h on the include path and links the library, so native.h uses it as any C++ project would.

JavaScript sees only the two functions the header defines. This is the way in for a library whose API is all templates, and for one you would rather keep behind a few functions of your own.

Try it
Compress a text that repeats less, the alphabet say, and compare the two sizes.
Open in playground
Runs without a compile until the C++, Rust, packages or imports change.
Press Run, or Ctrl+Enter, to run main.js.
Type to search every guide page and section.
↑↓ navigate↵ openesc close