An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# ESX.js





npm version




## 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!