0.0.19 • Published 12 months ago

photon-packet-parser v0.0.19

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

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.

0.0.19

12 months ago

0.0.18

12 months ago

0.0.17

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

12 months ago

0.0.13

12 months ago

0.0.12

12 months ago

0.0.11

12 months ago

0.0.10

12 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago