Ребят, такой вопрос
class Course {
constructor(title, price, img) {
this.title = title;
this.price = price;
this.img = img;
this.id = uuidv4();
}
save() {
fs.appendFile(
path.join(__dirname, "..", "data", "courses.json"),
new Course(),
err => {
if (err) throw err;
}
);
}
Через класс пытаюсь записать данные в файл, но записывается [object Object], как мне правильно их распарсить?