Skip to content

Instantly share code, notes, and snippets.

@kgust
Last active October 12, 2023 18:19
Show Gist options
  • Save kgust/2e64ed67151159a035c2 to your computer and use it in GitHub Desktop.
Save kgust/2e64ed67151159a035c2 to your computer and use it in GitHub Desktop.
Using jq to parse composer.lock
<composer.lock jq '.packages[] | [.name, .version]' | less
@BrianHenryIE
Copy link

Get all information for one package:

jq '."packages-dev"[] | select(.name=="10up/wp_mock")' composer.lock

Get current installed version for one package:

jq '."packages-dev"[] | select(.name=="johnpbloch/wordpress") | .version' composer.lock

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