Class: StaticPair

PSON. StaticPair

A static PSON encoder and decoder pair.

new StaticPair(dict, options)

Constructs a new static PSON encoder and decoder pair.

Parameters:
Name Type Argument Description
dict Array.<string> <optional>

Static dictionary

options Object.<string,*> <optional>

Options

Extends

Methods

decode(pson) → {*}

Decodes PSON to JSON.

Parameters:
Name Type Description
pson ByteBuffer | ArrayBuffer | Buffer

PSON

Inherited From:
Returns:

JSON

Type
*

encode(json) → {ByteBuffer}

Encodes JSON to PSON.

Parameters:
Name Type Description
json *

JSON

Inherited From:
Returns:

PSON

Type
ByteBuffer

toArrayBuffer(json) → {ArrayBuffer}

Encodes JSON straight to an ArrayBuffer of PSON.

Parameters:
Name Type Description
json *

JSON

Inherited From:
Returns:

PSON as ArrayBuffer

Type
ArrayBuffer

toBuffer(json) → {Buffer}

Encodes JSON straight to a node Buffer of PSON.

Parameters:
Name Type Description
json *

JSON

Inherited From:
Returns:

PSON as node Buffer

Type
Buffer