2.0.1 • Published 4 years ago

@sz-sw/postman v2.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

@sz-sw/postman

A very simple asynchronous protocol using a 2 byte packet size header allowing for data transfers of up to 64kBytes.

This protcol is intended for local inter process communication (IPC), but can be used outside of that scope.

API:

const postman = require("@sz-sw/postman")
const instance = postman.create()

// You need to provide read/write functions like this:
instance.sendBytes = function(bytes) {
	// Send "bytes" array, bytes is an Uint8Array
}

// "Feed" data into instance with "receiveBytes" function:
instance.receiveBytes(/* Uint8Array */)

// Sending messages...
instance.send("A string")
instance.send({
	value: 100
})

// Receiving them:
await instance.receive()
2.0.1

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago