Play How to create files and directories with Node.js [15 of 26]
Creating files is a convenient way to export data in your applications, but you also need to make sure you do not overwrite existing files in the process. Learn how you can write to the file system in your Node.js programs while checking for existing files and folders.
Full "Intro to Node.js" course on Microsoft Learn: https://aka.ms/LearnNode.js
Watch the entire series: https://aka.ms/NodeBeginnerSeries
- Demo source code: https://github.com/MicrosoftDocs/node-essentials
- fs API: https://nodejs.org/api/fs.html
- Node.js: https://nodejs.org
- Visual Studio Code: https://code.visualstudio.com