External Text Format
is the format Erlang uses when sending and receiving data. This module implements packing and unpacking of said format in pure, native JavaScript.
This module is plug-and-play, it exposes two functions, pack
and unpack
, and would be used in the following way:
const { pack, unpack } = require('etf.js');
const serialized = pack({ hello: 'world' });
const deserialized = unpack(serialized);
console.log(deserialized); // { hello: 'world' }
- Null (Primitive Tests)
- Booleans (Primitive Tests)
- Strings (Primitive Tests)
- Atoms (Atom Tests)
- Unicode Strings (String Tests)
- Floats (Primitive Tests)
- Integers (Primitive Tests)
- Longs (Primitive Tests)
- Longs over 64 bits (Primitive Tests)
- Objects
- Arrays
- Tuples
- PIDs
- Ports
- Exports
- References
Plus added support for Maps (will be converted into Objects) and Sets (will be converted into Arrays)
etf.js
is heavily based of binarytf
for the structure, and could not have been done without the help from it's author:
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request!
etf.js © vladfrangu, released under the MIT License. Authored and maintained by vladfrangu.
Github vladfrangu - Twitter @KingDGrizzle