小编Wib*_*ers的帖子

使用JavaScript替换txt文件中的一行

我试图使用JavaScript替换文本文件中的一行。

这个想法是:

var oldLine = 'This is the old line';
var newLine = 'This new line replaces the old line';
Run Code Online (Sandbox Code Playgroud)

现在,我想指定一个文件,找到oldLine并用替换newLine并保存。

有人可以在这里帮助我吗?

javascript writefile fs node.js appendfile

2
推荐指数
2
解决办法
1418
查看次数

标签 统计

appendfile ×1

fs ×1

javascript ×1

node.js ×1

writefile ×1