# hl7-mllp

> HL7 Minimum Lower Layer Protocol (MLLP) implementation for Node.js

Latest version **0.0.11** (published 2026-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install hl7-mllp
pnpm add hl7-mllp
yarn add hl7-mllp
bun add hl7-mllp
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2026-08-17 |
| First published | 2022-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 46.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Pantelis Georgiadis |
| Maintainers | pantelisgeorgiadis |
| Keywords | HL7, MLLP |

## Links

- npm: https://www.npmjs.com/package/hl7-mllp
- Repository: https://github.com/PantelisGeorgiadis/hl7-mllp
- Issues: https://github.com/PantelisGeorgiadis/hl7-mllp/issues
- npm.io page: https://npm.io/package/hl7-mllp

## Dependencies (4)

- [dayjs](https://npm.io/package/dayjs.md) ^1.11.13
- [loglevel](https://npm.io/package/loglevel.md) ^1.9.2
- [async-event-emitter2](https://npm.io/package/async-event-emitter2.md) ^0.0.2
- [loglevel-plugin-prefix](https://npm.io/package/loglevel-plugin-prefix.md) ^0.8.4

## Recent versions

- 0.0.11 (latest) — 2026-08-17
- 0.0.10 — 2026-05-23
- 0.0.9 — 2025-04-14
- 0.0.8 — 2025-02-28
- 0.0.7 — 2024-10-31
- 0.0.6 — 2024-01-02
- 0.0.5 — 2023-09-06
- 0.0.4 — 2023-05-17
- 0.0.3 — 2022-12-09
- 0.0.2 — 2022-09-23
- 0.0.1 — 2022-06-30

## README

[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![build][build-image]][build-url] [![MIT License][license-image]][license-url] 

# hl7-mllp
HL7 Minimum Lower Layer Protocol (MLLP) implementation for Node.js.

### Note
**This effort is a work-in-progress and should not be used for production or clinical purposes.**

### Install

	npm install hl7-mllp

### Build

	npm install
	npm run build

### Examples

#### Client
```js
const hl7Mllp = require('hl7-mllp');
const { Client, Hl7Message } = hl7Mllp;

const client = new Client();
const hl7Message = new Hl7Message(
  `MSH|^~\&|SENDINGAPP|SENDINGFACILITY|RECEIVINGAPP|RECEIVINGFACILITY|200001010000||ADT|1234567890|D|2.2|
   PID||123456^^^2^ID 1|654321||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M|`
);
hl7Message.on('acknowledge', (ackMessage) => {
  console.log(ackMessage.toString());
});

client.addMessage(hl7Message);
client.send('127.0.0.1', 12345);
```

#### Server
```js
const hl7Mllp = require('hl7-mllp');
const { Server, Hl7Message, Hl7MessageHandler } = hl7Mllp;

class Hl7MllpMessageHandler extends Hl7MessageHandler {
  constructor(socket, opts) {
    super(socket, opts);
  }

  // Handle incoming messages
  onMessage(message, callback) {
    console.log(message.toString());
    callback(Hl7Message.createAcknowledgeMessage(message));
  }
}

const server = new Server(Hl7MllpMessageHandler);
server.on('networkError', (e) => {
  console.log('Network error: ', e);
});
server.listen(port);

// When done
server.close();
```

### License
hl7-mllp is released under the MIT License.

[npm-url]: https://npmjs.org/package/hl7-mllp
[npm-version-image]: https://img.shields.io/npm/v/hl7-mllp.svg?style=flat
[npm-downloads-image]: http://img.shields.io/npm/dm/hl7-mllp.svg?style=flat

[build-url]: https://github.com/PantelisGeorgiadis/hl7-mllp/actions/workflows/build.yml
[build-image]: https://github.com/PantelisGeorgiadis/hl7-mllp/actions/workflows/build.yml/badge.svg?branch=master

[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: LICENSE.txt

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