With the NPM registry API, I would like to determine whether a package has types. So far, I have this process, but I'm wondering if there is a better way to check:
- Query for
@types/<package>
(or download theDefinitelyTyped
repository and check there, which is what I do for efficiency) - Download the tarball for the package, unzip it, and check for
types
inpackage.json
I run this process for a few thousand packages.
However, I would like to make the latter check more efficient, given that the NPM website indicates whether a package has types.
Is there a simple way to accomplish this that doesn't require downloading tarballs?