How to create files and directories with Node.js [15 of 26]

Play How to create files and directories with Node.js [15 of 26]

The Discussion

  • User profile image
    chety1
    Hi,

    Instead of unlink the file I think we can give flag attribute in third parameter like below. Is that right or am i misunderstanding something ?

    await fs.writeFile(path.join(salesTotalDir, 'report.json'), '', {
    flag: 'w',
    });

Add Your 2 Cents