Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/apacheli/void

Codec for the External Term Format
https://github.com/apacheli/void

deno elixir erlang etf typescript void

Last synced: about 1 month ago
JSON representation

Codec for the External Term Format

Awesome Lists containing this project

README

        

# Void

Packs and unpacks [ETF](https://erlang.org/doc/apps/erts/erl_ext_dist.html)
data. Written in [TypeScript](https://www.typescriptlang.org/) for
[Deno](https://deno.land/).

This can pack most JavaScript types except `symbol` and `undefined`.

```ts
import { pack, unpack } from "https://deno.land/x/[email protected]/mod.ts";

const packed = pack({
a: true,
list: ["of", 3, "things", "to", "unpack"],
});

const unpacked = unpack(packed);
```

Unpacking a `LARGE_BIG_EXT` will stringify it by default. If you need `bigint`s,
you can pass `false` into `unpack`.

```ts
// unpack(uint8: Uint8Array, stringify_bigints?: boolean)
const unpacked = unpack(uint8, false);
```