1.0.4 • Published 8 years ago
fs-extra-enhancer v1.0.4
what is fs-extra-enhancer
fs-extra-enhancer is for enhancing fs-extra.
const fsee = require('fs-extra-enhancer');how to use
async
fsee.emptyDir(dir[, filter], callback)filteris added forfse.emptyDir(dir, callback).Sometimes we don't want to empty all files in dir to avoid errors like
EACCESS, then we can use this function.example:
fsee.emptyDir(dir, { ignored: /\.DS_Store/ }, function(err) { if (err) { throw err; } console.log('done'); })It won't remove
.DS_Storewhen empty dir, which won't causeEACCESSerrors whenemptyDirtried to remove files like.idea/.DS_Store/...(sudois needed).others
same as
fs-extra.
sync
fsee.emptyDirSync(dir[, filter])others
same as
fs-extra.