JSPM

zerlpack

0.0.2
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q24527F

    Erlang term format un/packer written in zig

    Package Exports

    • zerlpack
    • zerlpack/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (zerlpack) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Zerlpack

    An erlang term format un/packer written in zig.

    Supported runtimes:

    • Node.js
    • Electron
    • Bun
    • Deno (no reexported symbols)

    Usage

    import { pack, unpack } from "zerlpack"; // or use require
    
    const buffer = pack(123); // <Buffer 83 61 7b>
    const value = unpack(buffer); // 123
    
    // for compatibility with discords erlpack
    const value2 = unpack(buffer, { bigintsAsStrings: true });
    
    // optionally you can use zlib to compress the packed data
    const buffer2 = pack(123, { compress: true });