Skip to content

Instantly share code, notes, and snippets.

@yocontra
Last active January 8, 2016 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yocontra/f08afd78f0ef4c6abaa3 to your computer and use it in GitHub Desktop.
Save yocontra/f08afd78f0ef4c6abaa3 to your computer and use it in GitHub Desktop.
// removes all instances of node and npm from your computer
var fs = require('fs');
var path = require('path');
var walk = require('fs-walk');
var wipeOut = ['node', 'npm'];
function sanicGoFast(p, cb){
walk.files(p, function(dir, file, stat, next) {
if (wipeOut.indexOf(path.basename(file) === -1) return next();
fs.unlink(path.join(dir, file), next);
}, cb);
}
console.log('Making your system great again...');
sanicGoFast('/', function(err){
if (err) return console.error(err);
console.log('Done');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment