Use fs-extra with CommonJS
masterIn CommonJS environments, fs-extra is a drop-in replacement for the native fs module. All native fs methods are attached to fs-extra, and all fs methods return promises if a callback is not provided.
Note: The deprecated constants fs.F_OK, fs.R_OK, fs.W_OK, and fs.X_OK are not exported on Node.js v24.0.0+. Please use their fs.constants equivalents instead.
const fse = require('fs-extra')