<commit_before># Erlang External Term Format
[![npm version](https://badge.fury.io/js/erlang-term-format.svg)](https://badge.fury.io/js/erlang-term-format)
[![Build Status](https://travis-ci.org/mweibel/node-etf.svg?branch=master)](https://travis-ci.org/mweibel/node-etf)
[![Coverage Status](https://coveralls.io/repos/github/mweibel/node-etf/badge.svg?branch=master)](https://coveralls.io/github/mweibel/node-etf?branch=master)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

This module implements a parser for the [External Term Format](http://erlang.org/doc/apps/erts/erl_ext_dist.html) of Erlang.

## Installation

```bash
$ npm install erlang-term-format
```

## Usage

See [test.js](https://github.com/mweibel/node-etf/blob/master/test.js) for some examples.


```javascript
const Parser = require('erlang-term-format')
const parser = new Parser()

parser.on('readable', () => {
	console.log(parser.read())
})

const pid = [
	103,                               // 103 = PID type
	100, 0x00, 0x03, 0x66, 0x6f, 0x6f, // atom 'foo'
	0x00, 0x00, 0x00, 0x01,            // id 1
	0x00, 0x00, 0x00, 0x01,            // serial 1
	0x01                               // creation 1
]

parser.write(new Buffer(pid))
```

## Contributing
See [CONTRIBUTING.md](https://github.com/mweibel/node-etf/blob/master/CONTRIBUTING.md).<commit_msg>docs(README): Add info what is being output with the usage example<commit_after># Erlang External Term Format
[![npm version](https://badge.fury.io/js/erlang-term-format.svg)](https://badge.fury.io/js/erlang-term-format)
[![Build Status](https://travis-ci.org/mweibel/node-etf.svg?branch=master)](https://travis-ci.org/mweibel/node-etf)
[![Coverage Status](https://coveralls.io/repos/github/mweibel/node-etf/badge.svg?branch=master)](https://coveralls.io/github/mweibel/node-etf?branch=master)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

This module implements a parser for the [External Term Format](http://erlang.org/doc/apps/erts/erl_ext_dist.html) of Erlang.

## Installation

```bash
$ npm install erlang-term-format
```

## Usage

See [test.js](https://github.com/mweibel/node-etf/blob/master/test.js) for some examples.


```javascript
const Parser = require('erlang-term-format')
const parser = new Parser()

parser.on('readable', () => {
	console.log(parser.read())
})

const pid = [
	103,                               // 103 = PID type
	100, 0x00, 0x03, 0x66, 0x6f, 0x6f, // atom 'foo'
	0x00, 0x00, 0x00, 0x01,            // id 1
	0x00, 0x00, 0x00, 0x01,            // serial 1
	0x01                               // creation 1
]

parser.write(new Buffer(pid))

// The following structure will be logged:
/*
{
  name: 'pid',
  value: {
    node: {
      name: 'atom',
      value: {
        atom: 'foo',
        len: 3
      }
    },
    id: 1,
    serial: 1,
    creation: 1
  }
}
*/

```

## Contributing
See [CONTRIBUTING.md](https://github.com/mweibel/node-etf/blob/master/CONTRIBUTING.md).
{'fraction_non_alphanumeric': 0.18309859154929578, 'fraction_numerical': 0.04401408450704225, 'mean_word_length': 3.3873873873873874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 22, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5667735', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1276, 'n_words': 192}