node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey ยป



Node.js client library for Pomelo framework


npm install pomelo-node-tcp-client

Usage: var Pomelo = require("pomelo-node-tcp-client")

pomelo.init("", 3010,{}, function() { console.log('success'); pomelo.request("connector.entryHandler.entry", {}, onEntry); });

function onEntry(object){ console.log("got it: " + object); }

Notify: pomelo.notify("gameManager.gameHandler.startGame", {});

Events: pomelo.on("gameManager.gameHandler.gameEvent", handleGameEvents);

function handleGameEvents(event){ console.log("handle: " + util.inspect(event)); switch(event.gameEvent.type){ case "myEvent_01": console.log("let's do something with it"); break; case "gameStart": console.log("game has started"); break; ... } }