check for the 'index.js' location then set how many parents directory they differ with '\txt\test.txt' and join with relative directory '__dirname':
const fs = require('fs');
const path = require('path');
const archivo = fs.readFileSync(path.join(__dirname, '../txt/test.txt'));
console.log(archivo);