growtopia.js

GrowtopiaJS Github Stars NPM Version NPM Minified GitHub Actions Workflow Status

A Rust based, cross-platform, high-performance Growtopia private server ENet framework utilizing Node.js, Bun.js.

  • Stable
  • Built-in ItemsDat tools
npm i growtopia.js
const { Client, TextPacket, Peer } = require("growtopia.js");

const client = new Client({
enet: {
ip: "0.0.0.0",
port: 17091
}
});

client.on("ready", () => {
console.log(`ENet server: port ${client.config.enet.port} on ${client.config.enet.ip}`);
});

client.on("error", (err) => {
console.log("Something wrong", err);
});

client.on("connect", (netID) => {
console.log(`Connected netID ${netID}`);
const peer = new Peer(client, netID);
peer.send(TextPacket.from(0x1));
});

client.on("disconnect", (netID) => {
console.log(`Disconnected netID ${netID}`);
});

client.on("raw", (netID, channelID, data) => {
const peer = new Peer(client, netID);
console.log("raw", data);
console.log(peer.enet.address, peer.port);
});

client.listen();

Give a thumbs to these cool people