External File

Is there a way to read and write to an external file using JS in FiveM for permeant storage.

Greetings @JimmyBinoculars,

I think you mean the JS in connection with the NUI. There it is not possible for security reasons (the JS is executed directly on the PC of the player). You can use the Web Storage API though: Web Storage API - Web APIs | MDN

Here you can use the setItem() method to set settings:

localStorage.setItem(“KEY”, “VALUE”);

You can then retrieve them with the getItem() method:

localStorage.getItem(“KEY”);

The whole thing is stored client-side and remains unchanged even after a restart.