Skip to content

Instantly share code, notes, and snippets.

@lowsky
Last active June 15, 2023 11:42
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 lowsky/403b044f4b5691adb3cbb6a990a8a6a2 to your computer and use it in GitHub Desktop.
Save lowsky/403b044f4b5691adb3cbb6a990a8a6a2 to your computer and use it in GitHub Desktop.

This script list the age of each dependencies

It extracts the "dependencies" from package.json to pipe it into qnm:

It is done via jq ".dependencies" piped into jq "keys" to retrieves the dependency names.

Finally, the xargs utility is used to execute the qnm tool command for each dependency. (The sed utility is used to remove any commas, and the array- brackets)

cat package.json| jq ".dependencies" | jq "keys" | sed -e 's|[],[]||g' | xargs -n 1  npx -y qnm

See qnm tool for details: (Kudos belongs to @ranyitz and friends)

qnm screenshot

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