To use rmsync()
function from fs-extra
library, you can follow the below steps:
Install fs-extra
library by running the following command in your terminal:
npm install fs-extra
Require fs-extra
library in your javascript code:
const fse = require('fs-extra');
Use rmsync()
function to remove a directory recursively:
index.tsx134 chars5 lines
In this code, rmsync()
function takes two arguments:
This function removes the directory and all its content recursively, and it returns an error if the operation fails.
I hope this helps!
gistlibby LogSnag