![]() Where filePath is a String that represents path of the file to be deleted. Step 3: To delete file synchronously, use unlinkSync() function. Once an attempt is made to delete the file, callback function is called with error (as argument) if any. Syntax is provided below fs.unlink(filePath, callbackFunction) ![]() Step 2: Delete file asynchronously using unlink() function. We will use unlink() and unlinkSync() functions of this module. Step 1: Include File System module to your Node.js program. Following is a step by step guide to delete a File programmatically in Node.js.
0 Comments
Leave a Reply. |