photon-packet-parser
TypeScript icon, indicating that this package has built-in type declarations

0.0.19 • Public • Published

Photon Packet Parser

Photon Packet Parser is a Node.js library for parsing Photon Protocol 16 packets. It provides tools for deserializing Photon commands and packets, making it easier to handle Photon-based communication in your Node.js applications.

Installation

You can install the library via npm:

npm install photon-packet-parser

Usage

Here's an example of how to use the Photon Packet Parser:

const PhotonPacketParser = require('photon-packet-parser');
const parser = new PhotonPacketParser();

parser.on('packet', (packet) => {
    console.log('Packet received:', packet);
});

const sampleBuffer = Buffer.from(/*your-packet-data-here*/);
parser.handle(sampleBuffer);

Classes

PhotonCommand

Parses individual Photon commands from a payload.

PhotonPacket

Parses Photon packets which can contain multiple commands.

PhotonPacketParser

Main parser class that handles incoming packet buffers.

Protocol16Deserializer

Deserializes different types of data based on Photon Protocol 16.

Events

  • packet: Emitted when a packet is parsed successfully.
  • request: Emitted when an operation request is parsed.
  • response: Emitted when an operation response is parsed.
  • event: Emitted when an event is parsed.

License

This project is licensed under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i photon-packet-parser

Weekly Downloads

9

Version

0.0.19

License

ISC

Unpacked Size

17.1 kB

Total Files

9

Last publish

Collaborators

  • mr.rise