EX: const jsonData = [{ age: 12, name: 'Someone' }]; And i want convert jsonData to file JSON and use this file to send request to the S3 sever.
2 Answers
Ok... the S3 thing is a big complicated for such a short question, but in general you can do something like this...
fs.writeFile("../../pathToFile.json", yourJSON, 'utf8', (err) => {
if (err) {
console.log("Ahh mother****");
return console.log(err);
}
console.log("Now I have to send it to S3");
});
1 Comment
Hamist1001
I have an error when using fs " fs.writefile is not a function" and I use browserify-fs but it have the same error.