From the reference libraryFiveM

exports

fivem-docs/docs/scripting-reference/runtimes/javascript/functions/exports.md

exports


title: Exports

Use this to export functions so they can be called from other resources.
Read more on exports

Signature

function exports(exportedName: string, fn: Function) => void

Signature > Required arguments

  • exportedName: The function name you want to export.
  • fn: The function to execute when the export is called.

Examples

exports("printSomething", () => {
  console.log("Something");
});
exports("dropPlayer", (src: string, reason: string) => {
  DropPlayer(src, reason);
});

// OR

exports("dropPlayer", DropPlayer);

title: Exports

Use this to export functions so they can be called from other resources.
Read more on exports

Back to documentation