I have this code
var fs = require('fs');
fs.readFile('data.txt', 'utf8', function(err, data) {
if (err) throw err;
console.log(data.replace('\r\n', ':'));
});
replace line breaks with ":"
Is working, but only for the first occurrence.
How can I do it to replace for all occurrences? Thank you so much