1.0.2 • Published 2 years ago

amf-packet v1.0.2

Weekly downloads
8
License
ISC
Repository
github
Last release
2 years ago

npm version build status codecov

About

AMF0 packet serializer and deserializer.

Usage

Install using npm:

$ npm install amf-packet

Serialize

const { serializeAMF } = require('amf-packet');

const headers = {
	'foo': 'bar',
};
const messages = [{
	'targetUri': 'Service.doSomething',
	'responseUri': '/0',
	'body': [],
}];

console.log(serializeAMF(headers, messages));

Deserialize

const { deserializeAMF } = require('amf-packet');

const {
	headers,
	messages,
} = deserializeAMF(buf);
const {
	targetUri,
	responseUri,
	body,
} = messages[0];

Implementation notes

The must-understand flag of headers is not implemented.

Message body can be any value supported by amf-codec.