Created
January 4, 2019 00:42
-
-
Save AJamesPhillips/c7cb45c9f3533c86537b51fb5056392f to your computer and use it in GitHub Desktop.
Rough scan of node dependencies for lesser used packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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