problem in recalling a command plugin in a script

ho un problema con l'inserimento di un comando plugin in una diramazione condizionale.
I've got a problem with the insertion of a command plugin in a condictional branch.

The commnad in the plugin is this:
Code:
const fs = require ('fs')

function containsPassword (path, password) {
  let result = false
  try {
    fs.readFile(path, 'utf8', (data) => {
      result = data.includes(password)
    })
  } catch (error) {
    throw new Error(error)
  }
  return result
};
Moderator note: Closing this as it is a duplicate thread.

Original thread: https://forums.rpgmakerweb.com/threads/problem-in-recalling-a-command-plugin-in-a-script.99869/