Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 610 Bytes

README.md

File metadata and controls

25 lines (17 loc) · 610 Bytes

Cfx.re JavaScript API

A package that helps you interacting with the Cfx.re API to fetch FiveM servers

How to install

npm i cfx-api

How to use:

const cfx = require("cfx-api");

const server = cfx.retrieveFive("v45z95").then(server => { // Replace v45z95 with a server id
    console.log(server.hostname)

    console.log(server.ownerProfileUrl)

    server.players.forEach(player => {
         console.log(player.name)
    })
})