const fs = require('fs'); let code = fs.readFileSync('src/components/TerminalPanel.vue', 'utf8'); code = code.replace(/viewportScroller\.addEventListener\(type, /g, 'viewportScroller!.addEventListener(type, '); code = code.replace(/const threshold = 0\.2;/g, 'const threshold_v = 0.2;'); code = code.replace(/threshold\)/g, 'threshold_v)'); fs.writeFileSync('src/components/TerminalPanel.vue', code);