async-samp-query
TypeScript icon, indicating that this package has built-in type declarations

1.1.7 • Public • Published

async-samp-query

Simplified SAMP API client

Installation

Using npm

npm i async-samp-query

or using yarn

yarn add async-samp-query

Code example

import query from "async-samp-query";

async function main() {
  const data = await query({
    host: "play.uifserver.net",
    port: 7776,
  });

  console.log(data);
}

main();

Options:

  • host - required
  • port (7777 by default) - optional
  • timeout (5000 by default) - optional

Output sample

{
  "online": 402,
  "address": "play.uifserver.net",
  "port": 7776,
  "hostname": "UIF - United Islands Freeroam",
  "gamemode": "UIF Freeroam",
  "mapname": "English",
  "passworded": false,
  "maxplayers": 500,
  "rules": {
    "lagcomp": true,
    "mapname": "UIF build 155",
    "version": "0.3.7-R3",
    "weather": 10,
    "weburl": "www.uifserver.net",
    "worldtime": "12:00"
  }
}

Todo

  • Optimize dependencies

Readme

Keywords

Package Sidebar

Install

npm i async-samp-query

Weekly Downloads

2

Version

1.1.7

License

MIT

Unpacked Size

29.5 kB

Total Files

9

Last publish

Collaborators

  • kashadeveloper