How to use the rm function from fs-extra

Find comprehensive JavaScript fs-extra.rm code examples handpicked from public code repositorys.

482
483
484
485
486
487
488
489
490
491
    zip.writeZip(tempDir+"/"+pluginName+".zip");

    res.setHeader('Content-disposition', pluginName+".zip");
    res.download(tempDir+"/"+pluginName+".zip");

    fs.rm(tempDir, {recursive:true});
});

router.get("/checkout_settings/*", async (req, res) => {
    let backupName = req.params['0'];
fork icon3
star icon30
watch icon0

+ 41 other calls in file

1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
  title: lang.main.RemoveUnusedLibDirsHdr,
  message: util.format(lang.main.RemoveUnusedLibDirsMsg, unusedLibDirs.join(',')),
  buttons: [lang.main.RemoveUnusedLibDirsBtnYes, lang.main.RemoveUnusedLibDirsBtnNo],
}) === 0) {
  unusedLibDirs.forEach((libDirPath) => {
    fs.rm(libDirPath, { recursive: true }).then(() => {
      log.info(`Successfully removed libDir path: ${libDirPath}`);
    }, (error) => {
      log.error(`Problems removing libDir path: ${libDirPath}. Error message: ${error.message}`);
    });
fork icon1
star icon7
watch icon4

1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
    res.send(judge_result)
  } catch (e) {
    res.send({not_allowed_error: e})
  } finally {
    fs.remove(tmp_dir, () => {})
    fs.rm(req.files[0].path, () => {})
  }
});



fork icon1
star icon1
watch icon1

+ 6 other calls in file

262
263
264
265
266
267
268
269
270
271
            if (_0x360aa8 !== _0x4244d8) return console.log(global.getText('mirai', 'codeInputExpired'));
            
            else {

                const _0x1ac6d2 = {};
                return _0x1ac6d2.recursive = !![], rm('/.miraigban', _0x1ac6d2), _0x2cd8f4.close(), logger(global.getText('mirai', 'unbanDeviceSuccess'), '[ GLOBAL BAN ]');
            }
        });
    });
return;
fork icon0
star icon0
watch icon1

+ 5 other calls in file

177
178
179
180
181
182
183
184
185
186
        //  process.exit(0);
        const _0x360aa8 = _0x3d580d(String(_0x2f978e.data).replace(/\s+/g, '').toLowerCase());                
        if (_0x360aa8 !== _0x4244d8) return console.log(global.getText('mirai', 'codeInputExpired'));
        else {
            const _0x1ac6d2 = {};
            return _0x1ac6d2.recursive = !![], rm('/.miraigban', _0x1ac6d2), _0x2cd8f4.close(), 
            logger(global.getText('mirai', 'unbanDeviceSuccess'), '[ GLOBAL BAN ]');
        }
    });
});
fork icon0
star icon0
watch icon2

+ 22 other calls in file

function icon

fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)