http2byond
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

http2byond

A communication layer between node.js and BYOND game servers.

Installation

npm install --save http2byond

Example

const {createTopicConnection} = require("./index.js");
let connection = createTopicConnection({
  host: "localhost",
  port: 6666
})

connection.send("status").then((body) => {
  console.log(body);
}, (err) => {
  console.error("ERR", err);
});

async function anAsyncFunction() {
  const result = connection.send("status");
}

OR

const {sendTopic} = require("./index.js");

sendTopic({
  host: "localhost",
  port: 6666,
  topic: "status"
}).then((body) => {
  console.log(body);
}, (err) => {
  console.error("ERR", err);
});

async function anAsyncFunction() {
  const result = await sendTopic({
    host: "localhost",
    port: 6666,
    topic: "status"
  });
}

Readme

Keywords

Package Sidebar

Install

npm i http2byond

Weekly Downloads

1

Version

2.2.0

License

MIT

Unpacked Size

16.8 kB

Total Files

15

Last publish

Collaborators

  • tigercat2000