Socket
Socket
Sign inDemoInstall

erlang-term-format

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    erlang-term-format

Erlang External Term Format parser


Version published
Weekly downloads
4
Maintainers
1
Install size
727 kB
Created
Weekly downloads
 

Readme

Source

Erlang External Term Format

npm version Build Status Coverage Status js-standard-style semantic-release

This module implements a parser for the External Term Format of Erlang.

Installation

$ npm install erlang-term-format

Usage

See test.js for some examples.

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.

Keywords

FAQs

Last updated on 04 May 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc