npm query

Print an array of dependency objects using CSS-like selectors. More information: https://docs.npmjs.com/cli/commands/npm-query.

npm query ':root > *'

npm query ':root > .{{prod|dev}}'

npm query '#{{package}}'

npm query '#{{package}}@{{semantic_version}}'

npm query ':empty'

npm query ":attr(scripts, [postinstall])" | jq 'map(.name) | join("\n")' -r | xargs -I {} npm uninstall {}

npm query ":type(git)" | jq 'map(.name)' | xargs -I {} npm why {}