Upload file and use it to export data

Asked

Viewed 23 times

0

I have a file called preload.js, it is the first to be loaded. I need to do a scan and send the result to multiple files when prompted. I tried:

module.exports = {
  online: false,
  client: client,
  async _load() {
    // ...
    this.online = true
    // ...
  }
}

but whenever another file calls him, it seems that he resets and the online reverts false

Is there any way I can make this work? ps. this file has to be: 1st call: file loading 2nd or more calls: use of loaded data

  • when the _load() function is called? , if it is not invoked, the online value will be false even if.

  • @Williambrunorochamoraes So she’s called when I start, I want her to run the results and make them available the next time I use them

  • You can put this data in . env or else you can make a class, first setar, after just the gets

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.