# @nativewrappers/client

> Javascript/Typescript wrapper for the FiveM natives

Latest version **1.7.33** (published 2022-11-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @nativewrappers/client
pnpm add @nativewrappers/client
yarn add @nativewrappers/client
bun add @nativewrappers/client
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.7.33 |
| Published | 2022-11-28 |
| First published | 2021-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Remco Troost |
| Maintainers | dillskaggs |
| Keywords | fivem, wrapper, javascript, typescript, citizenfx |

## Links

- npm: https://www.npmjs.com/package/@nativewrappers/client
- Repository: https://github.com/AvarianKnight/native-wrappers-client
- Homepage: https://fivemjs.avarian.dev/
- Issues: https://github.com/AvarianKnight/native-wrappers-client/issues
- npm.io page: https://npm.io/package/@nativewrappers/client

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.7.33 (latest) — 2022-11-28
- 1.7.32 — 2022-11-28
- 1.7.31 — 2022-11-25
- 1.7.30 — 2022-11-25
- 1.7.29 — 2022-11-24
- 1.7.28 — 2022-11-24
- 1.7.27 — 2022-11-24
- 1.7.27-rc1 — 2022-11-16
- 1.7.26 — 2022-08-21
- 1.7.25 — 2022-06-18
- 1.7.24 — 2022-05-26
- 1.7.23 — 2022-05-12
- 1.7.22 — 2022-05-12
- 1.7.21 — 2022-05-11
- 1.7.20 — 2022-05-10
- … 57 more at https://npm.io/package/@nativewrappers/client/versions

## README

## Notice for breaking changes
This library is going to be undergoing a rewrite over the next few months, backwards compatibility will not be guaranteed, if you want version thats guaranteed stable please look use 1.7.*

<h1 align="center">native-wrappers-client</h1>

<p align="center">
  <i>:fire: A Javascript/Typescript wrapper for the FiveM natives :video_game:</i>
  <br>
  <br>
  <a href="https://github.com/AvarianKnight/native-wrappers-client/blob/master/LICENSE">
    <img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat" alt="License: MIT">
  </a>
  <a href="https://www.npmjs.com/package/@nativewrappers/client">
    <img src="https://img.shields.io/npm/v/@nativewrappers/client?style=flat" alt="npm version">
  </a>
  <a href="https://www.npmjs.com/package/@nativewrappers/client">
    <img src="https://img.shields.io/npm/dm/@nativewrappers/client?style=flat">
  </a>
  <a href="https://github.com/nativewrappers/fivem-client/actions/workflows/config.yml">
    <img src="https://github.com/nativewrappers/fivem-client/actions/workflows/config.yml/badge.svg" alt="Workflow Status">
  </a>
  <a href="https://github.com/AvarianKnight/native-wrappers-client/commits/master">
    <img src="https://img.shields.io/github/last-commit/nativewrappers/fivem-client.svg?style=flat" alt="Last commit">
  </a>
</p>

<p align="center">
  <a href="https://fivemjs.avarian.dev/">Documentation</a>
  -
  <a href="https://forum.fivem.net/t/fivem-js-v1-3-2-javascript-typescript-wrapper-now-with-menu-class-nativeui/268640">Forum</a>
</p>

This is a continuation of [fivem-js](https://github.com/d0p3t/fivem-js), who's maintainer has sadly passed away.

This project is in no way affiliated with FiveM or the Cfx Collective.

Functionality of this wrapper is **based on the FiveM C# wrapper** - [link](https://github.com/citizenfx/fivem/tree/master/code/client/clrcore/External). It's a feature-rich set of helper classes, objects, and functions to help you develop your project faster.

## Features

- No runtime dependencies
- Abstracts common used FiveM practices
- Entity management through class objects (i.e. `Vehicle` and `Ped` entities)
- UI elements such as `scaleforms` and loading `prompts`
- Audio, Blips, Cameras and more...

In other words, whatever the FiveM C# wrapper can do, this package can as well and more!

## Download & Install

`yarn add @nativewrappers/client`

or

`npm i @nativewrappers/client`

https://www.npmjs.com/package/@nativewrappers/client


## Simple Usage

See [here](https://github.com/AvarianKnight/native-wrappers-client/tree/master/examples) for example projects.

### Typescript

```ts
import * as Cfx from '@nativewrappers/client';

RegisterCommand(
  'adder',
  async (source: number, args: string[]) => {
    const vehicle = await Cfx.World.createVehicle(
      new Cfx.Model('adder'),
      new Cfx.Vector3(1, 2, 3),
      4,
    );
    Cfx.Game.PlayerPed.setIntoVehicle(vehicle, Cfx.VehicleSeat.Driver);
  },
  false,
);
```

You can also individually import classes.

```typescript
import { World } from '@nativewrappers/client/lib/World';
```

### Javascript

```js
/// <reference path="node_modules/@nativewrappers/client/lib/index.d.ts"/>
/// <reference path="node_modules/@citizenfx/client/natives_universal.d.ts"/>

const Cfx = require('@nativewrappers/client');

RegisterCommand(
  'adder',
  async (source, args) => {
    const vehicle = await Cfx.World.createVehicle(
      new Cfx.Model('adder'),
      new Cfx.Vector3(1, 2, 3),
      4,
    );
    Cfx.Game.PlayerPed.setIntoVehicle(vehicle, Cfx.VehicleSeat.Driver);
  },
  false,
);
```

## Contributing

You are more than welcome to contribute to this project by submitting a pull request and creating issues.

Please checkout [CONTRIBUTING.md](./CONTRIBUTING.md) for our contributing guidelines.

## License

MIT with customization. See [LICENSE](https://github.com/AvarianKnight/native-wrappers-client/blob/master/LICENSE)

---
_Source: https://npm.io/package/@nativewrappers/client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
