const fs = require('fs'); const path = 'm:/OFICIAIS E FUNCIONANDO/STEELBASE/js/sections/perfis-catalog.js'; let c = fs.readFileSync(path, 'utf8'); // Unescape some mangled ones c = c.replace(/\\`/g, '`'); // Match ... `;' // 2. Replace with 'return ` ... ... `; tags ONLY if they are inside return ` ... `; // and keep the content. c = c.replace(/return\s+`([\s\S]*?)