crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

Folders in Node.js
Question Posted on 06 Jun 2024Home >> Tutorial >> Node.js Tutorial >> Folders in Node.js

Folders in Node.js

Folders in Node.js


When we say about the folders handling in Node.js, we need to use the fs core module and this module also provide many handy methods to work with folders. Here in this chapter we try to cover some operations that we can do on folders and files.

Check folder exists or not
Well to check the folder you need to use fs.access() and its promise based fsPromises.access() counterpart to check the folder exists and Node.js can access it with its permissions.

Create a new folder
Well we can use fs module to create a folder, we use fs.mkdir() or fs.mkdirsync() or fsPromises.mkdir() to create a new folder.

We will create the file name createdirectory.js and run the code in node.js by below command

To view the file

Download Code



Create

node createfolder.js


once we run above command it will check if the folder exist or not if not then it will create the test folder.
0
0




.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions

Parts of Node.js

Install Node.js Linux

Node.js First Example

Node.js Globals

Node.js DNS






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap