How to use the graceful-fs.unlink function in graceful-fs

To help you get started, we’ve selected a few graceful-fs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nodejs / node-gyp / test / test-addon.js View on Github external
var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) {
    try {
      fs.unlink(testNodeDir)
    } catch (err) {
      t.error(err)
    }

    var logLines = stderr.toString().trim().split(/\r?\n/)
    var lastLine = logLines[logLines.length - 1]
    t.strictEqual(err, null)
    t.strictEqual(lastLine, 'gyp info ok', 'should end in ok')
    t.strictEqual(runHello().trim(), 'world')
  })
  proc.stdout.setEncoding('utf-8')
github hexojs / hexo / test / scripts / post / create.js View on Github external
async.each(posts, function(post, next){
      fs.unlink(post, next);
    }, function(err){
      posts.length = 0;
github MindFreakers / cdn / node_modules / fs-extra / lib / copy / ncp.js View on Github external
function rmFile (file, done) {
    fs.unlink(file, function (err) {
      if (err) return onError(err)
      return done()
    })
  }
github arangodb / arangodb / js / node / node_modules / docco / node_modules / fs-extra / lib / _copy.js View on Github external
function rmFile(file, done) {
    fs.unlink(file, function (err) {
      if (err) {
        return onError(err)
      }
      return done()
    })
  }
github hexojs / hexo / lib / loaders / database.js View on Github external
db.load(dbPath, function(err){
          if (!err) return next();

          hexo.log.e('Database load failed. Deleting database.');
          fs.unlink(dbPath, next);
        });
      });
github onmyway133 / PushNotifications / node_modules / fs-extra / lib / move / index.js View on Github external
fs.link(src, dest, err => {
        if (err) {
          if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') {
            return moveAcrossDevice(src, dest, overwrite, callback)
          }
          return callback(err)
        }
        return fs.unlink(src, callback)
      })
    }
github sx1989827 / DOClever / node_modules / phantomjs-prebuilt / node_modules / fs-extra / lib / move / index.js View on Github external
fs.link(source, dest, function (err) {
        if (err) {
          if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM') {
            moveAcrossDevice(source, dest, clobber, limit, callback)
            return
          }
          callback(err)
          return
        }
        fs.unlink(source, callback)
      })
    }
github davidhealey / waistline / node_modules / npm / node_modules / fs-vacuum / vacuum.js View on Github external
if (!(stat && (stat.isDirectory() || stat.isSymbolicLink() || stat.isFile()))) {
      log(leaf, 'is not a directory, file, or link')
      return cb(new Error(leaf + ' is not a directory, file, or link'))
    }

    if (options.purge) {
      log('purging', leaf)
      rimraf(leaf, function (error) {
        if (error) return cb(error)

        next(dirname(leaf))
      })
    } else if (!stat.isDirectory()) {
      log('removing', leaf)
      unlink(leaf, function (error) {
        if (error) return cb(error)

        next(dirname(leaf))
      })
    } else {
      next(leaf)
    }
  })
github Webstrates / Webstrates / helpers / HttpRequestController.js View on Github external
searchables.forEach(asset => {
					fs.unlink(assetManager.UPLOAD_DEST + asset.filename, () => {});
				});