@perion/net

0.1.3 • Public • Published

@perion/net

A library for manipulating MapleStory packets.

Installation

npm i --save @perion/net

Usage

const net = require('@perion/net');

/** Example buffer */
const data = Buffer.from([1, 2]);

/** net.Packet.Parser example */
const packet = new net.Packet.Parser(data);
const fields = ['id', 'name', 'hp'];
const unpacked = packet.int().mapleascii().int().collect(fields);

/** Returns {id: <number>, name: <string>, hp: <number>} */

/** net.Packet.Writer example */

/** Initialize with length */
let packet = new net.Packet.Writer(5);
packet = packet.byte(0x0).int(9).buffer();

/** Returns the buffer with data */

/@perion/net/

    Package Sidebar

    Install

    npm i @perion/net

    Weekly Downloads

    23

    Version

    0.1.3

    License

    Apache-2.0

    Unpacked Size

    45.6 kB

    Total Files

    21

    Last publish

    Collaborators

    • jonnylin13