@perion/net
v0.1.3
Published
A few networking utilities for MapleStory server development
Downloads
2,763
Maintainers
Readme
@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 */