1.1.4 • Published 3 years ago

@blocky/cfx.js v1.1.4

Weekly downloads
88
License
MIT
Repository
github
Last release
3 years ago

CFX.JS

A simple NodeJS wrapper for the cfx.re project.

What does this do?

Currently this just supports GET requesting URLs on the FiveM server. But this also comes with nice type definitions for some files (/info.json, /dynamic.json) with the ability to support more.

How to use it?

The API is made to be used simply. Here is a basic example:

// use `.default` for type definitions
const cfx = require('@blocky/cfx.js').default;

(async () => {
    let server = cfx('http://localhost:3000');
    let serverInfo = await server.getInfo();

    console.log(serverInfo.artifactVersion);
})();

You can also use it to get custom endpoints set by resources:

// use `.default` for type definitions
const cfx = require('@blocky/cfx.js').default;

(async () => {
    let server = cfx('http://localhost:3000');
    let resData = await server.getPath('/my_resource');

    let { myData } = resData;
})();

Contributors

License

This project is maintained under the MIT license. More info can be viewed under LICENSE

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago