Skip to content

Instantly share code, notes, and snippets.

@contra contra/no.js
Last active Jan 8, 2016

Embed
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);
console.log('Done');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.