0.0.19 • Published 1 year ago

photon-packet-parser v0.0.19

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year 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

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago