Yes, you can use the "dependedUpon" view in the couchdb. For example, to find all the packages that depend on "request": http://isaacs.iriscouch.com/registry/_design/app/_view/dependedUpon?startkey=[%22request%22]&endkey=[%22request%22,{}]&group_level=2
That's what the npmjs.org site uses. Note that you can always dive into the code to find out how it does stuff: https://github.com/isaacs/npm-www On Sat, May 4, 2013 at 1:37 PM, Gregg Caines <[email protected]> wrote: > I'm actually looking for the opposite... the dependants, not the > dependencies. For a given package x, it's the list of all the packages that > depend on x. > > G > > > On Sat, May 4, 2013 at 1:33 PM, Martin Cooper <[email protected]> wrote: >> >> The simplest way is to grab the package metadata from the registry with >> this URL: >> >> http://registry.npmjs.org/<package>/latest >> >> That will get you a JSON version of the same object you see with 'npm view >> <package>', at which point you can just pluck out the 'dependencies' object. >> >> -- >> Martin Cooper >> >> >> >> >> On Sat, May 4, 2013 at 12:52 PM, Gregg Caines <[email protected]> wrote: >>> >>> Hey all, does anyone know if npm has an API (or couchdb view) for getting >>> the list (or just the count) of dependent packages of a given package ? I >>> suspect it does since npmjs.org has the info. >>> >>> I know there's an npm mailing list, but it mysteriously won't let me >>> post. Thanks! >>> >>> G >>> >>> -- >>> -- >>> Job Board: http://jobs.nodejs.org/ >>> Posting guidelines: >>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >>> You received this message because you are subscribed to the Google >>> Groups "nodejs" group. >>> To post to this group, send email to [email protected] >>> To unsubscribe from this group, send email to >>> [email protected] >>> For more options, visit this group at >>> http://groups.google.com/group/nodejs?hl=en?hl=en >>> >>> --- >>> You received this message because you are subscribed to the Google Groups >>> "nodejs" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected]. >>> >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >> >> >> -- >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/nodejs?hl=en?hl=en >> >> --- >> You received this message because you are subscribed to a topic in the >> Google Groups "nodejs" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/nodejs/_H8sH6qWozs/unsubscribe?hl=en. >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
