How to use the rimraf.bind function in rimraf

To help you get started, we’ve selected a few rimraf 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 sebpiq / rhizome / test / browser / websocket-server.js View on Github external
var config = req.body
        , asyncOps = [
          wsServer.stop.bind(wsServer)
        ]
      
      if (connections.manager)
        asyncOps.push(connections.manager.stop.bind(connections.manager))
      
      // See https://github.com/websockets/ws/pull/605
      if (wsServer._wsServer) {
        wsServer._wsServer._server.removeAllListeners('upgrade')
        wsServer._wsServer._server.removeAllListeners('error')
        wsServer._wsServer._server.removeAllListeners('listening')
      }
      
      if (config.store) asyncOps.push(rimraf.bind(rimraf, config.store))
      
      async.series(asyncOps, (err) => {
        if (err) throw err
        setTimeout(() => res.end(), 10)
      })
    })
github uber-archive / idl / test / lib / test-cluster.js View on Github external
function updateRemote(name, files, callback) {
    var self = this;

    var remoteDir = path.join(self.remotesDir, name);

    series([
        rimraf.bind(null, path.join(remoteDir, 'idl')),
        createFixtures.bind(null, remoteDir, files),
        git('add --all .', {
            cwd: remoteDir
        }),
        git('commit -am "update files"', {
            cwd: remoteDir
        })
    ], callback);
};
github gulpjs / gulp / test / dest.js View on Github external
describe('gulp.dest()', function() {
  beforeEach(rimraf.bind(null, outpath));
  afterEach(rimraf.bind(null, outpath));

  it('should return a stream', function(done) {
    var stream = gulp.dest(path.join(__dirname, './fixtures/'));
    expect(stream).toExist();
    expect(stream.on).toExist();
    done();
  });

  it('should return a output stream that writes files', function(done) {
    var instream = gulp.src('./fixtures/**/*.txt', { cwd: __dirname });
    var outstream = gulp.dest(outpath);
    instream.pipe(outstream);

    outstream.on('error', done);
    outstream.on('data', function(file) {
github gulpjs / gulp / test / watch.js View on Github external
describe('gulp.watch()', function() {
  beforeEach(rimraf.bind(null, outpath));
  beforeEach(mkdirp.bind(null, outpath));
  afterEach(rimraf.bind(null, outpath));

  it('should call the function when file changes: no options', function(done) {
    var tempFile = path.join(outpath, 'watch-func.txt');

    createTempFile(tempFile);

    var watcher = gulp.watch('watch-func.txt', { cwd: outpath }, function(cb) {
      watcher.close();
      cb();
      done();
    });

    updateTempFile(tempFile);
  });
github componentjs / resolver.js / test / installs.js View on Github external
it('should fetch master for * when no tags available', co(function* () {
    yield rimraf.bind(null, components);

    var tree = yield* resolve({
      dependencies: {
        'timaschew/component-asterisk-no-tags': '*'
      }
    }, {
      install: true,
    })

    var out = join(components, 'timaschew', 'component-asterisk-no-tags', 'master')
    fs.statSync(join(out, 'index.js'))
    var json = require(join(out, 'component.json'))
    json.version.should.eql('0.0.2')
  }))
github Level / leveldown / test / benchmarks / index.js View on Github external
, rmdb = function (engine, db, location, callback) {
      engine.closeDb(db, rimraf.bind(null, location, callback))
    }
github uber / npm-shrinkwrap / sync / purge-excess.js View on Github external
var tasks = excessFiles.map(function (file) {
            var filePath = path.join(dir, file);
            console.log('removing', filePath);
            return rimraf.bind(null, filePath);
        });
github mobify / nightwatch-commands / selenium / installation / install.js View on Github external
function setup(cb) {
  async.series([
    rimraf.bind(null, conf.selenium.path),
    rimraf.bind(null, path.dirname(conf.chromeDriver.path)),
    mkdirp.bind(null, path.dirname(conf.selenium.path)),
    mkdirp.bind(null, path.dirname(conf.chromeDriver.path))
  ], cb);
}
github shinnn / location-origin.js / gulpfile.js View on Github external
return gulp.src('*.js')
    .pipe($.jscs(pkg.jscsConfig))
    .pipe($.jshint())
    .pipe($.jshint.reporter(stylish))
    .pipe($.jshint.reporter('fail'));
});

gulp.task('lint:json', function() {
  return gulp.src('*.json')
    .pipe($.jsonlint())
    .pipe($.jsonlint.reporter());
});

gulp.task('lint', ['lint:scripts', 'lint:json']);

gulp.task('clean', rimraf.bind(null, 'dist'));

gulp.task('build', ['lint'], function() {
  return gulp.src(['src/*.coffee'])
    .pipe($.coffeelint())
    .pipe($.coffeelint.reporter())
    .pipe($.coffee())
    .pipe($.rename(pkg.main))
    .pipe($.size({showFiles: true}))
    .pipe(gulp.dest(''));
});

gulp.task('watch', function() {
  gulp.watch('src/*.coffee', ['coffee']);
  gulp.watch(['*.{js,json}', '.jshintrc'], ['lint']);
});
github mobify / nightwatch-commands / selenium / installation / install.js View on Github external
function setup(cb) {
  async.series([
    rimraf.bind(null, conf.selenium.path),
    rimraf.bind(null, path.dirname(conf.chromeDriver.path)),
    mkdirp.bind(null, path.dirname(conf.selenium.path)),
    mkdirp.bind(null, path.dirname(conf.chromeDriver.path))
  ], cb);
}

rimraf

A deep deletion module for node (like `rm -rf`)

ISC
Latest version published 7 months ago

Package Health Score

81 / 100
Full package analysis