我试图使用JavaScript替换文本文件中的一行。
这个想法是:
var oldLine = 'This is the old line'; var newLine = 'This new line replaces the old line';
现在,我想指定一个文件,找到oldLine并用替换newLine并保存。
oldLine
newLine
有人可以在这里帮助我吗?
javascript writefile fs node.js appendfile
appendfile ×1
fs ×1
javascript ×1
node.js ×1
writefile ×1