How to create multiple file in one folder using NodeJS 2023

This is index.js File    


 const fs=require('fs');



const path=require('path');
const dirPath=path.join(__dirname,'files');
for(i=0; i<5; i++){
    fs.writeFileSync(dirPath+"/hello"+i+".txt","a simple text file created now ");
}




Post a Comment

0 Comments