Last active
August 4, 2016 11:46
-
-
Save maraisr/7926dc9abfc5919c3f9f67debd03c932 to your computer and use it in GitHub Desktop.
ncu -g auto install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var readline = require('readline'); | |
var rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
terminal: false | |
}); | |
var lines = []; | |
rl.on('line', line => { | |
if (/([a-z\-\_]+)\s/.test(line)) { | |
lines.push(line.match(/([a-z\-\_]+)\s/)[1]); | |
} | |
}); | |
rl.on('close', v => { | |
console.log(`npm i -g ${lines.join(' ')}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/**
Usage:
ncu -g | node index.js
then simply copy and paste the install statement orncu -g | node index.js | pbcopy
and paste*/