astur / check-npm-dependents Goto Github PK
View Code? Open in Web Editor NEWChecks how many dependents has npm package.
License: MIT License
Checks how many dependents has npm package.
License: MIT License
I'm using this to sort through hundreds of thousands of NPM packages, and it will give a bad name error for a package in one run but resolve properly in another. Any ideas why this might be happening?
It got through 40k packages before starting to do this.
There are two closely related, but separate steps that this package currently performs all in one go:
Lines 5 to 6 in 126eeca
Lines 7 to 10 in 126eeca
The latter is what I am most interested in having an abstraction for. HTTP requests, on the other hand, are unfortunately a very leaky abstraction. I would prefer to have control over retries, caching semantics, etc. BYOC (Bring Your Own Client), if you will.
I imagine this being implemented as a .parse(html)
method or similar.
When things go wrong, this package currently returns -1.
Line 6 in 126eeca
Line 9 in 126eeca
Since these represent unrecoverable errors, I would like an error to be thrown instead. Otherwise, I will have to write something like this around every invocation to avoid running the business logic when the data is unavailable:
if (dependents === -1) {
throw new Error(`Unable to determine dependents for package: "${name}"`);
}
// ... business logic
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.