Skip to content

Instantly share code, notes, and snippets.



Last active Jan 8, 2016
What would you like to do?
// 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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment