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.