# amf-packet

> AMF0 packet serializer and deserializer

Latest version **1.0.3** (published 2026-07-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install amf-packet
pnpm add amf-packet
yarn add amf-packet
bun add amf-packet
```

## Health

**Score 50/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2026-07-13 |
| First published | 2021-01-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | David Csirmaz |
| Maintainers | csimi |
| Keywords | amf, amf0, packet, rpc |

## Links

- npm: https://www.npmjs.com/package/amf-packet
- Repository: https://github.com/csimi/amf-packet
- Homepage: https://github.com/csimi/amf-packet#readme
- Issues: https://github.com/csimi/amf-packet/issues
- npm.io page: https://npm.io/package/amf-packet

## Dependencies (1)

- [amf-codec](https://npm.io/package/amf-codec.md) ^1.4.1

## Recent versions

- 1.0.3 (latest) — 2026-07-13
- 1.0.2 — 2022-02-23
- 1.0.1 — 2021-02-01
- 1.0.0 — 2021-01-25

## README

[![npm version](https://img.shields.io/npm/v/amf-packet.svg?logo=npm)](https://www.npmjs.com/package/amf-packet)
[![build status](https://github.com/csimi/amf-packet/workflows/build/badge.svg)](https://github.com/csimi/amf-packet/actions)
[![codecov](https://codecov.io/gh/csimi/amf-packet/branch/master/graph/badge.svg)](https://codecov.io/gh/csimi/amf-packet)

# 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](https://www.npmjs.com/package/amf-codec).

---
_Source: https://npm.io/package/amf-packet · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
