https://github.com/lvorex/cfx-status
A package for simplifying CFX.re Status API.
https://github.com/lvorex/cfx-status
api cfx cfxre-api fivem fivem-api nodejs status typescript
Last synced: 4 months ago
JSON representation
A package for simplifying CFX.re Status API.
- Host: GitHub
- URL: https://github.com/lvorex/cfx-status
- Owner: lvorex
- License: mit
- Created: 2023-11-04T09:14:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-04T15:40:51.000Z (over 2 years ago)
- Last Synced: 2025-02-21T17:51:03.625Z (over 1 year ago)
- Topics: api, cfx, cfxre-api, fivem, fivem-api, nodejs, status, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/cfx-status
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple CFX API Package
*This package is a cfx status package which uses CFX.re API.*
*Feel free to contribute project.*
- **Install**
```bash
npm install cfx-status
```
## Utils
- Fetching General Status
- Fetching Components
- Get Component by ID
- Get Component by Name
## Usages
- **Basic Usage**
> *main.ts*
```ts
import CFXStatus from "cfx-status";
(async() => {
const cfxre = new CFXStatus()
// Automaticly Fetchs Components and General Status
const generalStatus = await cfxre.currentStatus // CFX.re Status
const components = await cfxre.components // CFX.re Systems Status
})();
```
- **Advanced Usage**
> *main.ts*
```ts
import CFXStatus from "cfx-status";
(async() => {
const cfxre = new CFXStatus()
// Automaticly Fetchs Components and General Status
const wantedComponent = await cfxre.getComponentById("component-id")
const wantedComponentTwo = await cfxre.getComponentByName("component-name")
console.log(`${wantedComponent.name}: ${wantedComponent.status}`) // e.g. CnL: operational
console.log(`${wantedComponentTwo.name}: ${wantedComponentTwo.status}`) // e.g. Keymaster: major_outage
})();
```