Skip to content

Instantly share code, notes, and snippets.

@maraisr
Last active August 4, 2016 11:46
Show Gist options
  • Save maraisr/7926dc9abfc5919c3f9f67debd03c932 to your computer and use it in GitHub Desktop.
Save maraisr/7926dc9abfc5919c3f9f67debd03c932 to your computer and use it in GitHub Desktop.
ncu -g auto install
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(' ')}`);
});
@maraisr
Copy link
Author

maraisr commented Aug 4, 2016

/**
Usage:
ncu -g | node index.js then simply copy and paste the install statement or
ncu -g | node index.js | pbcopy and paste
*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment