Skip to content

Instantly share code, notes, and snippets.

@chfritz
Created August 4, 2015 03:54
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 chfritz/63dbf792d22563e5d0c0 to your computer and use it in GitHub Desktop.
Save chfritz/63dbf792d22563e5d0c0 to your computer and use it in GitHub Desktop.
A script for checking the two-step package dependencies of a meteor project, i.e., the package dependencies of direct dependencies (as seen in `meteor list`).
meteor list | grep ^[a-z] | tr -s ' ' | cut -d ' ' -f1,2 | tr -d '\*\+' | tr ':' '_' \
| while read X Y; do \
cat ~/.meteor/packages/$X/$Y/web.browser.json \
| xargs -0 node -e "X = JSON.parse(process.argv[1]); \
X.uses.forEach(function(d) { \
console.log(\"$X\", \"$Y\", d.package, d.constraint); \
})"; \
done | sort
@chfritz
Copy link
Author

chfritz commented Dec 24, 2020

Similarly, to just check which package is mentioning a certain dependency, e.g., jquery:

for n in `grep -v '#' .meteor/packages  | cut -d '@' -f 1 | xargs | sed 's/\:/_/g'`; do echo $n; grep jquery ~/.meteor/packages/$n/*/*.json; done

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