How to use the removeAsync function from fs-extra
Find comprehensive JavaScript fs-extra.removeAsync code examples handpicked from public code repositorys.
38 39 40 41 42 43 44 45 46 47
onStdout('Made staging dir'); stagedSketchDir = path.join('/opt/openrov/firmware/staged/', sketchName); // Remove existing sketch folder if it exists return fs.removeAsync(stagedSketchDir) .then(function() { // Copy the sketch folder to the staging sketch dir return fs.copyAsync(options.sketchDir, stagedSketchDir);
94
63
33
+ 3 other calls in file
103 104 105 106 107 108 109 110 111 112
.then(() => { evt.options.pathDist = optimizedPath; // eslint-disable-line return evt; }) // delete generated handler we copied above .finally(() => fs.removeAsync(generatedHandler)); } } return Promise.resolve(evt);
28
68
12
+ 3 other calls in file
173 174 175 176 177 178 179 180 181 182
zipPath = await downloadAsync(url, downloadDir, filename, description) await extractZipAsync(zipPath, destPath, description) } catch (e) { log(`Downloading failed, retrying ${url}, reason: ${e}`) try { await fs.removeAsync(zipPath) } catch (e) { console.error(e.stack) } if (retryCount === MAX_RETRY) {
356
0
2
+ 3 other calls in file
GitHub: gpf0710/poi
178 179 180 181 182 183 184 185 186 187
await downloadExtractZipAsync(flash_url, downloadDir, `flash-${platform}.zip`, flashDir, 'flash plugin') } const compress7zAsync = async (files, archive, options) => { try { await fs.removeAsync(archive) } catch (e) { console.error(e.stack) } await (new n7z()).add(archive, files, options)
356
0
1
+ 5 other calls in file
56 57 58 59 60 61 62 63 64 65
function InstallFile(baseDir, file) { var src = path.resolve(path.join(baseDir, 'files', file.src)); return fs.copyAsync(src, path.join(file.dest, path.basename(file.src))); } function UninstallFile(file) { return fs.removeAsync(path.join(file.dest, path.basename(file.src))); } function ExecuteScript(baseDir, script) { return Promise.try(function () { var src = path.resolve(path.join(baseDir, 'scripts', script.name));
94
63
33
173 174 175 176 177 178 179 180 181
Path.join(__dirname, 'requirements.py'), requirementsPy); }).bind(this) .then(_.partial(this.preinstall, wrapperDir, this.libSubDir, runtime)).bind(this) .then(_.partial(this.install, wrapperDir, this.libSubDir, runtime)).bind(this) .then(_.partial(this.postinstall, wrapperDir, this.libSubDir, runtime)).bind(this) //.then(() => { return Fse.removeAsync(requirementsPy); }).bind(this) //.then(_.partial(this.hard_remove, [requirementsPy])).bind(this) .then(BbPromise.resolve, _.partial(this.catchIgnorableError, undefined)); };
16
25
3
+ 5 other calls in file
72 73 74 75 76 77 78 79 80 81
.then(funcs => uniqBy(funcs, f => f.module)) .map(f => { this.serverless.cli.log( `Removing Python requirements helper from ${f.module}...` ); return fse.removeAsync( path.join(this.servicePath, f.module, 'unzip_requirements.py') ); }); } else {
274
0
14
+ 3 other calls in file
19 20 21 22 23 24 25 26 27 28
} function deleteChapter (basePath, args) { const path = loc.chapterPath(basePath, args.mangaName, args.chapterNum) return fse.removeAsync(path) } function deleteManga (basePath, args) { const path = loc.mangaPath(basePath, args.mangaName)
2
12
5
+ 3 other calls in file
GitHub: amfe/adam-cli
10 11 12 13 14 15 16 17 18 19
module.exports = function (conf) { // clean 不能保证传入的 conf 一定正确,所以需要无依赖的获取一遍 ~/.adam 的路径 var HOME = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE; var ADAM_HOME = path.join(HOME, '.adam'); fse.removeAsync(ADAM_HOME) .then(function () { helper.print('Success', 'Adam\'s directory is removed now.'); }) .catch(function (ret) {
2
9
9
78 79 80 81 82 83 84 85 86 87 88 89
} function destroyLoopMount(dir) { return sbutil.execFilePromise('umount', [dir]) .then(function () { return fs.removeAsync(dir); }); } exports.mountLoopFile = mountLoopFile;
2
1
0
110 111 112 113 114 115 116 117 118 119
try { zipPath = await downloadAsync(url, downloadDir, filename, description); await extractZipAsync(zipPath, destPath, description); } catch (e) { log(`Downloading failed, retrying ${url}, reason: ${e}`); await fs.removeAsync(zipPath); } }; const installFlashAsync = async (platform, downloadDir, flashDir) => {
0
0
2
+ 7 other calls in file
GitHub: 07souravkunda/cypress
99 100 101 102 103 104 105 106 107 108
return fs.accessAsync(appPath) .then(() => { debug('appPath exists %s', appPath) // clear out the existing symlink return fs.removeAsync(dest) }).then(() => { const symlinkType = paths.getSymlinkType() debug('making symlink from %s to %s of type %s', appPath, dest, symlinkType)
0
0
0
fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)