How to modify the contents of specified variables in js files by nodejs

there is js code in a html file.
node modifies the variable value in js code

Mar.04,2021

use fs.readFile () to read the file, then use replace () to match and replace variable values, and then fs.writeFile () go back


using the html template engine
if it is, you can pass the value directly like an ejs template, oh


[how nodejs modifies the specified variable content in the js file] is there a good way?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaba9f-2073.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaba9f-2073.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?