Skip to content

Instantly share code, notes, and snippets.

@DrizzlyOwl
Last active January 19, 2022 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DrizzlyOwl/a27aeebfa7e66d8ec806220b91231100 to your computer and use it in GitHub Desktop.
Save DrizzlyOwl/a27aeebfa7e66d8ec806220b91231100 to your computer and use it in GitHub Desktop.
Parse composer outdated into a markdown table
import json,sys;
a = json.load(sys.stdin);
packages = a['installed'];
num_packages = len(packages);
are_available_updates = bool(num_packages);
if are_available_updates:
print("There are "+str(num_packages)+" package updates available");
print("\n");
print("|Name|Version|Latest|");
print("|---|---|---|");
for x in packages:
print("|"+x['name']+"|"+x['version']+"|"+x['latest']+"|");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment