Skip to content

Instantly share code, notes, and snippets.

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 AJamesPhillips/c7cb45c9f3533c86537b51fb5056392f to your computer and use it in GitHub Desktop.
Save AJamesPhillips/c7cb45c9f3533c86537b51fb5056392f to your computer and use it in GitHub Desktop.
Rough scan of node dependencies for lesser used packages
import requests
import time
THRESHOLD = 1000000
packages = ["babel-core","babel-loader","babel-plugin-transform-flow-strip-types","babel-plugin-transform-object-rest-spread","babel-preset-es2015","babel-preset-react","babel-register","chai","chai-enzyme","cheerio","codecov","css-loader","enzyme","expect","file-loader","flow-bin","json-loader","mocha","node-sass","nyc","react-addons-test-utils","sass-loader","style-loader","url-loader"]
for package in packages:
url = "https://api.npmjs.org/downloads/range/2018-11-12:2018-12-09/" + package
resp = requests.get(url)
data = resp.json()
days = data['downloads']
total = sum([day['downloads'] for day in days])
if (total < THRESHOLD):
print(package, total)
time.sleep(0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment