How To Read The Contents Of A Directory In Node JS (Async & Sync) | Java Inspires
Автор: Java Inspires
Загружено: 2020-05-09
Просмотров: 2205
Описание:
In this video, we will learn how to read contents of a folder(directory) using api rmdir from Node Js File system module.
In Node.js, from fs module,
provides an api,
'fs.readdir()' reads the contents of a directory.
syntax:
'fs.readdir(path[, options], callback)
where
path = path of the directory
options = optional parameters
callback = callbackFunction
The callback gets two arguments (err, files) where files is an array of the names of the files in the directory.
'fs.readdirSync()' is synchronous version
ENOENT: no such file or directory, scandir 'sampleDirectory1'
#JavaInspires #NodeJsPractice #SilentTutorial
---------------------------------------------------------------------------------
Facebook / javainspires
Twitter / javainspires
Pinterest / boards
Linked In / java-inspires-b782621a7
Reddit / javainspires_
Tumblr / javainspires
Blogger https://javainspires.blogspot.com/
---------------------------------------------------------------------------------
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: