How to use the nativeSync function from rimraf

Find comprehensive JavaScript rimraf.nativeSync code examples handpicked from public code repositorys.

8
9
10
11
12
13
14
15
16
17
18
// utils
const cleanSnapshotsDir = (options) => {
    const snapshotsDir = options.snapshotsDir;
    if (fs.existsSync(snapshotsDir)) {
        console.log(`${EC.cyan('[clean]')} remove chromium snapshots dir: ${EC.magenta(snapshotsDir)} ...`);
        rimraf.nativeSync(snapshotsDir);
    }
};


const cleanStatsFile = (options) => {
fork icon8
star icon48
watch icon0

+ 7 other calls in file

35
36
37
38
39
40
41
42
43
44
45
46
}


const nycOutputFolder = '.nyc_output'
if (fs.existsSync(nycOutputFolder)) {
  debug('deleting the existing folder %s', nycOutputFolder)
  rimraf.nativeSync(nycOutputFolder)
}


if (!fs.existsSync(nycOutputFolder)) {
  debug('creating folder %s', nycOutputFolder)
fork icon1
star icon8
watch icon0

+ 4 other calls in file

1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
},

rmSync(f, option = {}) {
    let ok = true;
    try {
        rimraf.nativeSync(f, option);
    } catch (err) {
        console.error(err);
        ok = false;
    }
fork icon0
star icon1
watch icon1

+ 2 other calls in file