Difficulty: 2/10fs module, async vs sync, streamsYou can write to a file in Node.js using the fs.writeFile() method. Here's an example:javascriptCopyScenario Questions0-2 years experience1How would you write a JSON config object to a file called config.json?2What happens if you call fs.writeFile on a path that's actually a directory?3Why might you use writeFileSync in a CLI startup script instead of the async version?Follow-up QuestionsWhat happens if the file doesn't exist?How would you handle writing a 10GB file?When would you choose sync over async?Suggest Improvement