fs.readFile find a placehold and replace, Handlebars js also an option if need be
Advertisements I currently load a file in node with fs.readFileSync: const filename = ‘test.html’; const html_code = fs.readFileSync(/var/www/vhosts/example.com/httpdocs/html/${filename}, ‘utf8’); in test.html I have this div: <div id="g-ai0-1" class="g-Text g-aiAbs g-aiPointText" style="top:59.6648%;margin-top:-14.2px;left:49.9587%;margin-left:-46px;width:92px;"> <p class="g-pstyle0">{{ Text }}</p> </div> Is there away I can search the html for the {{ Text }} string and replace it with something… Read More fs.readFile find a placehold and replace, Handlebars js also an option if need be