Skip to content

Instantly share code, notes, and snippets.

@hildjj
Created January 9, 2022 20:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hildjj/7736ebf1e1398e7bd1b36e05fd64ca4b to your computer and use it in GitHub Desktop.
Save hildjj/7736ebf1e1398e7bd1b36e05fd64ca4b to your computer and use it in GitHub Desktop.
Find all of the npm packages by a given author, so you can ensure you are either supporting them or switching to another package
# Run with npm ls --all --long --json --silent 2>/dev/null | jq -f author.jq --arg author <authorName>
# consider adding -g to the npm portion.
[
.. |
select(
objects |
has("author") and ((
.author | strings | contains($author)
) or (
.author | objects | .name | strings | contains($author)
))
) |
{
name: .name,
version:.version,
author:.author,
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment