简体   繁体   中英

NPM API for listing all dependencies of a component

If you visit https://registry.npmjs.org/randomstring you can get information about the package randomstring like the version, etc. But this does not give you the list of its dependencies.

I know there are CLI commands and modules to list the dependencies of a package, but is there an API? Preferably, you get all the deps, including deps of the deps.

Just to clarify, I want the API to return the deps of the deps too. Not just the deps of the original package.

In the 'version' field you have all the versions deployed on npm. If you take a look at version 1.1.5 (the latest) there's the dependency field you are looking for (array-uniq as dependency, and mocha as devdependency).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM