This is the code that is causing the error:
const writeToFile = data => {
return new Promise((resolve, reject) => {
fs.writeFile('./dist/generated-README.md', data, err => {
if (err) {
reject(err);
return;
}
resolve({
ok: true,
message: console.log('File created!')
});
})
})
}
I'm getting an error that says that fs.writeToFile
is not a function. Why is that and how do I fix it?