I am starting a series on node js. Actually I’m not super skilled with node js. So I thought let’s start from zero again and help others with me to learn about it. I saw the ‘the net ninja’ tutorials and took the syllabus from there and make a fusion of my own. I want to help you with my journey, let’s ride together into node js for 30 days…
Day 11 — Creating and Deleting Folders — Learning Node JS In 30 Days [Mini series]
A full series to learn the basics easily of node js
We are on the same fs module
for the creating and deleting folders
we are going to use fs.mkdirSync
to make new folder
I’m creating a new folder called song
by writing fs.mkdirSync(‘song’)
Run it using node app.js
It created a new song folder on the dir
Now we are going to use fs.rmdirSync
to delete the folder
We can delete dir by fs.rmdirSync(path) so we’ll try it
Run it using node app.js
So we created and deleted folder easily using fs.mkdirSync
and fs.rmdirSync
Do you have any questions ?
Originally it published on nerdjfpb blog and graphical version on instagram. you can connect with me in twitter, linkedin or instagram