Answer the question
In order to leave comments, you need to log in
How to write to JSON using node.js?
Do I understand correctly that in order to save the values sent by the user from the form on the site, you must first save them to a variable:
var event = {
title: "Конференция",
date: "сегодня"
};
var str = JSON.stringify(event);
var fs = require('fs');
fs.writeFileSync('/some/path/test.txt', str);
Answer the question
In order to leave comments, you need to log in
Have you tried saving to the db? What is this file creation for?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question