nodgpt/modules/_cleanInput.js

8 lines
307 B
JavaScript
Raw Normal View History

2023-12-30 15:43:20 +00:00
const path = './modules/input.txt';
const fs = require('fs');
const replaceAll = require('string.prototype.replaceall');
const string = fs.readFileSync(path).toString();
console.log(JSON.stringify(string));
let newString = replaceAll(string, '\r\n', '\\n');
fs.writeFileSync(path, newString);
return "Done";