Difficulty: 5/10fs.rename, error handling, cross-platform considerationsYou can rename a file or directory in Node.js using the fs.rename() method. Here's an example:javascriptCopyScenario Questions0-2 years experience1We need to move an uploaded image into a 'processed' folder and rename it to include a timestamp. How would you implement that in Node.js?2What happens if you try to rename a file to a name that already exists on the same filesystem, and how would you handle that situation?3Show me a short snippet that renames a directory synchronously. When might you choose the sync version over the async one?Follow-up QuestionsWhat edge cases would you add unit tests for?How would you surface rename failures to an operations dashboard?Can you compare the callback API with the promise‑based version?Suggest Improvement