Reading and Writing Files with Node.js | Node JS Beginners Tutorial

Dave Gray August 24, 2021
Video Thumbnail

About

Web Development tutorials with full courses on HTML, CSS, JavaScript, React, Node.js and more! My goal is to help you learn how to build the web. Teaching helps me learn, too. I work full-time as a Solutions Architect / Developer and part-time as a university web dev instructor. Thank you for subscribing, supporting my channel and sharing the videos you think may help others. Keep striving for progress over perfection. And a little progress every day goes a very long way. Milestones: July 20, 2020 - 1st video Jan 1, 2021 - 1k subs April 2021 - 4k watch hours Nov 2021 - 10k subs Jan 21, 2022 - Video at 100k views Feb 16, 2022 - 100k watch hours Feb 19, 2022 - 1m views Dec 13, 2022 - 100k subs Dec 2022 - Over 1m views in 1 month April 7, 2023 - 10m views May 26, 2023 - 1m watch hours Sept 22, 2023 - Video at 1m views Dec 25, 2023 - 250k subs

Video Description

Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap Reading and writing files with Node.js is easy after you learn the Node JS file system module. In this Node beginners tutorial, you will learn how to read, write, update and delete files with Node.js. You will also learn how to create readable and writeable streams of data with Node. 🚩 Subscribe ➜ https://bit.ly/3nGHmNn 🚀 This lesson is part of a Node.js for Beginners tutorial series playlist: https://www.youtube.com/playlist?list=PL0Zuz27SZ-6PFkIxaJ6Xx_X46avTM1aYw Reading and Writing Files with Node.js | Node JS File System Tutorial (00:00) Intro (00:05) Welcome (00:15) Overview (00:33) Use the NodeJS docs (01:50) How to read a file with Node.js (03:53) How to handle uncaught errors (04:52) Async example (06:01) Path module (07:17) How to write to a file with Node.js (08:48) How to update a file with Node.js (10:01) Nested operations (11:31) Callback hell (13:32) fsPromises (16:02) Replace Callback hell with Async Await (18:50) How to delete a file with Node.js (20:09) Readstream for large files (21.25) Writestream for large files (22:15) Stream data listener (23:19) Piping data streams (24:04) How to create a directory with Node.js (25:14) How to check if a file or directory exists (27:03) How to remove a directory with Node.js 📚 References: Node.js Official site: https://nodejs.org ✅ Follow Me: Twitter: https://twitter.com/yesdavidgray LinkedIn: https://www.linkedin.com/in/davidagray/ Blog: https://yesdavidgray.com Reddit: https://www.reddit.com/user/DaveOnEleven Was this tutorial about creating, reading, writing, updating and deleting files in Node.js helpful? If so, please share. Let me know your thoughts in the comments. #node #js #files

You May Also Like