Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/apacheli/void
- Owner: apacheli
- License: mit
- Created: 2021-05-02T13:05:01.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-05-24T15:37:26.000Z (over 3 years ago)
- Last Synced: 2024-12-09T17:50:39.828Z (about 2 months ago)
- Topics: deno, elixir, erlang, etf, typescript, void
- Language: TypeScript
- Homepage: https://deno.land/x/[email protected]
- Size: 25.4 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
```