https://github.com/itschip/esx.js
A JavaScript/TypeScript wrapper for ESX (es_extended) framework in FiveM
https://github.com/itschip/esx.js
Last synced: 10 months ago
JSON representation
A JavaScript/TypeScript wrapper for ESX (es_extended) framework in FiveM
- Host: GitHub
- URL: https://github.com/itschip/esx.js
- Owner: itschip
- Created: 2020-11-16T02:46:01.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-14T11:24:14.000Z (about 5 years ago)
- Last Synced: 2025-08-20T06:03:26.464Z (10 months ago)
- Homepage:
- Size: 82 KB
- Stars: 6
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ESX.js
## About
This is a JavaScript/TypeScript wrapper for the ESX (es_extended) framework in FiveM.
If you experience any issues, please post them in the `Issues`.
## Guide
### `Installation`
Run `npm i esx.js` to install the package. When this is done you are ready to use it.
### `Usage`
So how do you use it?
First you need to import either the `Client` class or `Server` class.
### `Client`
```js
import { Client } from 'esx.js'
let ESX: Client = null
setImmediate (() => {
emit('esx:getSharedObject', (obj: Client) => (ESX = obj));
})
```
### `Server`
```js
import { Server } from 'esx.js'
let ESX: Server = null
emit('esx:getSharedObject', (obj: Server) => (ESX = obj));
```
## You can also import a single type:
```js
import { XPlayer } from 'esx.js/@types/server'
const Player: XPlayer
```
### That's it. Now you are ready to rock the world!