Skip to content

Instantly share code, notes, and snippets.

@cbergau
Created January 7, 2020 17:40
Show Gist options
  • Save cbergau/96dad716bf61485d5e8ce6f9376bc123 to your computer and use it in GitHub Desktop.
Save cbergau/96dad716bf61485d5e8ce6f9376bc123 to your computer and use it in GitHub Desktop.
StringBuilder sb = new StringBuilder();
try {
String line;
Process p = Runtime.getRuntime().exec("npm outdated --json");
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
sb.append(line);
}
input.close();
}
catch (Exception err) {
err.printStackTrace();
}
System.out.println(sb.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment