How to use the rmSync function from fs-extra
Find comprehensive JavaScript fs-extra.rmSync code examples handpicked from public code repositorys.
GitHub: GreySole/Spooder
362 363 364 365 366 367 368 369 370 371
let pluginPath = path.join(backendDir, "tmp", pluginDirName); if(!fs.existsSync(pluginPath)){ fs.mkdirSync(pluginPath, {recursive:true}); }else{ fs.rmSync(pluginPath, {recursive:true}); } const childProcess = require("child_process"); childProcess.exec("git clone https://github.com/GreySole/Spooder-Sample-Plugin "+pluginPath,{
3
30
0
+ 17 other calls in file
GitHub: GAMS-dev/miro
653 654 655 656 657 658 659 660 661 662
} catch (err) { mainWindow.send('add-app-progress', -1, newApp.id); mainWindow.setProgressBar(-1); try { if (fs.existsSync(appDirTmp)) { fs.rmSync(appDirTmp, { recursive: true }); } } catch (errRm) { log.error(`Problems removing temporary app directory: ${appDirTmp}. Error message: ${errRm.message}.`); }
1
7
4
+ 5 other calls in file
GitHub: lando/core-next
42 43 44 45 46 47 48 49 50
// try to extract the plugin const {resolved} = await extract(pkg.raw, tmp); Plugin.debug('extracted plugin %o to %o from %o', _id, tmp, resolved); // if we get this far then we can safely move the plugin to dest fs.rmSync(dest, {recursive: true, force: true}); fs.mkdirSync(dest, {recursive: true}); fs.copySync(tmp, dest); Plugin.debug('moved plugin from %o to %o', tmp, dest);
0
1
0
+ 9 other calls in file
GitHub: GetPublii/Publii
390 391 392 393 394 395 396 397 398 399
for (let file of files) { if (file === '.' || file === '..' || file === 'media') { continue; } fs.rmSync(path.join(this.outputDir, file), { recursive: true }); } } else { fs.mkdirSync(this.outputDir); }
341
0
79
+ 4 other calls in file
10 11 12 13 14 15 16 17 18 19 20 21
removeDir(path.join(pages, item)); }); } function removeDir(dir) { fse.rmSync(dir, { recursive: true, force: true }); } function translateDir(directory = docs) { fs.readdirSync(directory).forEach((dir) => {
0
5
1
+ 2 other calls in file
232 233 234 235 236 237 238 239 240 241 242
*/ function deleteElectronBinaries() { const preBuildsFolder = path.join(__dirname, 'node_modules', 'zeromqold', 'prebuilds'); glob.sync('**/electron.napi.*.node', { sync: true, cwd: preBuildsFolder }).forEach((file) => { console.log(`Deleting ${file}`); fs.rmSync(path.join(preBuildsFolder, file), { force: true }); }); } async function deleteZMQBuildFolder() {
0
4
1
+ 21 other calls in file
59 60 61 62 63 64 65 66 67 68
const rows = db.prepare(selectQ).all(); for (const row of rows) { // Remove temporary uploads const tmpPartPaths = `${PART_PREFIX}${row.id}`; console.log(`Removing ${tmpPartPaths}`); fs.rmSync(tmpPartPaths, {recursive: true, force: true}); // Remove cached artifacts if any const cacheFile = path.join(CACHE_PATH, row.id.toString()); console.log(`Removing ${cacheFile}`); fs.rmSync(cacheFile, {recurse: true, force: true});
6
30
1
+ 5 other calls in file
495 496 497 498 499 500 501 502 503 504 505
} function removeTmpDir() { try { if (tmpDir !== null) { fs.rmSync(tmpDir, { recursive: true }); tmpDir = null; } } catch(e) { console.error(`Failed to remove temporary directory "${tmpDir}". Please manually remove it.`);
0
0
1
+ 14 other calls in file
GitHub: saby/builder
59 60 61 62 63 64 65 66 67
logger.info(`Created lockfile ${lockFilePath}`); const onExitHandler = () => { if (fs.existsSync(lockFilePath)) { fs.rmSync(lockFilePath, { force: true }); logger.info(`Removed lockfile ${lockFilePath}`); } };
0
0
0
+ 3 other calls in file
fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)