New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

erlpackjs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

erlpackjs

JavaScript library for Erlang External Term Format

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

erlpackjs

ErlpackJS is a fast encoder and decoder for the Erlang Term Format (version 131) for JavaScript based on erlpack supporting the browser and node.

npm npm CircleCI Maintenance

Installation

$ yarn add erlpackjs

Things that can be packed

  • Null
  • Booleans
  • Strings
  • Atoms
  • Unicode Strings
  • Floats
  • Integers
  • Longs
  • Longs over 64 bits
  • Objects
  • Arrays
  • Tuples
  • PIDs
  • Ports
  • Exports
  • References

Usage

How to pack

import { pack } from 'erlpackjs';

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

console.log(packed);

How to unpack

Note: Unpacking requires the binary data be a Uint8Array or Buffer.

import { unpack } from 'erlpackjs';

const packed = Buffer.from('', 'binary');
let unpacked = null;

try {
    unpacked = unpack(packed);

    console.log(unpacked);
} catch (err) {
    // Got an exception parsing
    console.log(err);
}

FAQs

Package last updated on 04 Aug 2021

Did you know?

Socket

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