Answer the question
In order to leave comments, you need to log in
How to work correctly with data?
Good afternoon, please help, I can't figure out how to implement the following:
I write the received data
fs.appendFile('./data.txt', JSON.stringify(data));
I get an array of objects,
then I get this data
fs.readFile("./data.txt", "utf8",
function(error,r){
if(error) throw error;
datafixed = JSON.parse(('['+r+']').replace(/\]\[/g,'],['));
data = datafixed.flat(Infinity)
createitem();
});
Answer the question
In order to leave comments, you need to log in
Get started with databases. They are specially made for this. Get started with Redis.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question