How do I read a TXT file?

Hello everyone, I'm working on a game with rpg maker mv.
I managed to create a TXT file inside the game folder, now I need a script to add to a conditional branch to make that TXT file read and if the file contains the text within the conditional branch.

Thanks.

TXT file creation code:
Code:
const path = require ('path');
const base = path.dirname (process.mainModule.filename);
const fs = require ('fs');
const fileText = "text";
fs.writeFileSync (base + '/test.txt', fileText);
You have posted this question in 4 other threads
https://forums.rpgmakerweb.com/inde...plugin-command-in-a-script.99902/#post-898195
https://forums.rpgmakerweb.com/inde...recalling-a-command-plugin-in-a-script.99869/
https://forums.rpgmakerweb.com/index.php?threads/transforming-a-script-into-a-function.99798/
https://forums.rpgmakerweb.com/index.php?threads/external-password-in-a-txt-file.99757/#post-897292

I have left open the first one in that list, as it is currently active, and have closed the other three.
Please keep one query to one thread. Multiple threads will not help you get an answer any quicker, and may only cause confusion.

Moderator note: Closing this as it is a duplicate thread.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-read-a-txt-file.100098/