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