Answer the question
In order to leave comments, you need to log in
Can the content of a promise be written to a JSON file?
Let's say I have a promise. Can I import it in JSON file? If so, how?
Answer the question
In order to leave comments, you need to log in
const fs = require('fs');
promise.then(data => fs.promises.writeFile('/path/to/file', JSON.stringify(data)));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question