Hi Guest
HomePage
Jobs
WalkIn
Articles
Agile
DotNet
WebServices
SilverLight
OOPS
WEB
SharePoint
Java
DataBase
Artificial Intelligence
----- Select Country -----
----- Select Location -----
----- Select Category -----
:) Latest Topic
Git Tutorial
What is Git?
Features of Git
Benefits of Git
Why use Git?
GitHub Introduction
GitHub Features
GitHub Benefits
Git vs GitHub
Git vs SVN
Git vs Mercurial
Version Control System
Distributed Version Control
Install Git on Windows
Install Git on Linux
Install Git on MAC
Git Environment Setup
Git configuration levels
Git Tools
Git Third Party Tools
Git Terminology Part1
Git Terminology Part2
Git Commands Part1
Git Commands Part2
Git Commands Part3
Git Cheat Sheet
Folders Node.js part2
Folders Node.js part2
Question Posted on 06 Jun 2024
Home
>>
Tutorial
>>
Git Tutorial
>>
Folders Node.js part2
Folders Node.js part2
Folders Node.js Part2
Here in this chapter we will read the content of a directory or folder. And here we will do different operation on the folder and files. We use fs.readdir() or fs.readdirSync() or fsPromises.readdir() to read the contents of a directory. And below code reads the content of a folder, files and subfolders and then returns their relative path. Below is the code to return the all files in some specific folder here we use two require first is to get fs module and second is for Path.
Here in below code we have use readdirSync to check all files and name the file as foldertest.js.
To view the code
Download Code
And below is the folder and its files details.
Now we open the node.js command prompt and run the below command to execute the command
node foldertest.js
And output of above command is given below:-
Other Important Questions
Git Third Party Tools
What is Git?
GitHub Introduction
Features of Git
GitHub Features
Top Searches:
asp net questions
vb net questions
sql query
uddl questions
class
javascript Questions
sharepoint interview questions and concept
silverlight questions and concept
wcf questions
beans
general knowledge
ajax questions
PHP
|
Biztalk
|
Testing
|
SAP
|
HR
|
Privacy policy |
Terms and Conditions
| Blog
If the copyright of any questions or content or syntax belong to you email us we will remove that(info@getproductprice.com)
Home
About Us
GroupChat
Sitemap
Feedback
Contact us