{"id":1990,"date":"2013-12-06T20:44:34","date_gmt":"2013-12-07T02:44:34","guid":{"rendered":"http:\/\/www.wiredprairie.us\/blog\/?p=1990"},"modified":"2013-12-06T20:44:35","modified_gmt":"2013-12-07T02:44:35","slug":"how-to-list-all-dependents-of-a-node-package","status":"publish","type":"post","link":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1990","title":{"rendered":"How to list all dependents of a Node package"},"content":{"rendered":"

You can use the web npm web site as it lists the dependents for any given package. <\/p>\n

Like coffee-script for example:<\/p>\n

http:\/\/npmjs.org\/browse\/depended\/coffee-script<\/code><\/pre>\n

Or, you could get JSON results for the same query (using curl<\/code>) (just substitute the name of the package with "sql" in the example:<\/p>\n

> curl -g 'http:\/\/registry.npmjs.org\/-\/_view\/dependedUpon?group_level=2&startkey=["sql"]&endkey=["sql","ZZZZZZZZZZZZZ"]&skip=0&limit=1000'<\/code><\/pre>\n

Results:<\/p>\n

{"rows":[\n{"key":["sql","anydb-sql"],"value":1},\n{"key":["sql","dbal"],"value":1},\n{"key":["sql","ectypes-downstairs"],"value":1},\n{"key":["sql","fixr"],"value":1},\n{"key":["sql","fixr-compiled"],"value":1},\n{"key":["sql","forerunner-postgres-store"],"value":1}\n{"key":["sql","pg-dal"],"value":1},\n{"key":["sql","relational"],"value":1},\n{"key":["sql","sequelize"],"value":1},\n{"key":["sql","sql-generate"],"value":1},\n{"key":["sql","sqlbox"],"value":1},\n{"key":["sql","triplie"],"value":1},\n{"key":["sql","voltron-postgres-adapter"],"value":1},\n{"key":["sql","worm"],"value":1}\n]}<\/code><\/pre>\n

The second value in the key array is the name of the package dependent on the sql<\/code> package.<\/p>\n

This of course only will find other published packages, and doesn’t help find applications, etc. that are using a specific package.<\/p>\n","protected":false},"excerpt":{"rendered":"

You can use the web npm web site as it lists the dependents for any given package. Like coffee-script for example: http:\/\/npmjs.org\/browse\/depended\/coffee-script Or, you could get JSON results for the same query (using curl) (just substitute the name of the package with "sql" in the example: > curl -g ‘http:\/\/registry.npmjs.org\/-\/_view\/dependedUpon?group_level=2&startkey=["sql"]&endkey=["sql","ZZZZZZZZZZZZZ"]&skip=0&limit=1000’ Results: {"rows":[ {"key":["sql","anydb-sql"],"value":1}, {"key":["sql","dbal"],"value":1}, {"key":["sql","ectypes-downstairs"],"value":1}, […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4],"tags":[120,102,124],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pd5QIe-w6","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1754,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1754","url_meta":{"origin":1990,"position":0},"title":"Nest Thermostat API using Node JS and Nest API Update","date":"October 9, 2012","format":false,"excerpt":"I\u2019ve been asked by a few people for more details on the API Nest Labs uses for their thermostats, especially regarding setting data (and not just polling). The API uses mostly JSON formatted data POSTed to their web servers. Authentication To authenticate, POST the username and password, encoded as form\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1442,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1442","url_meta":{"origin":1990,"position":1},"title":"Nest Thermostat API\/Protocol","date":"January 8, 2012","format":false,"excerpt":"While Nest Labs hasn\u2019t released a formal (documented & supported) API, I thought I\u2019d do a bit of digging to see how they\u2019re using the network and what might be achievable. A few things are going on, the majority as you\u2019d probably expect. The web interface is using a long\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2012\/01\/image_thumb7.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1565,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1565","url_meta":{"origin":1990,"position":2},"title":"Knockout.JS: Dictionary\/Index and ObservableArray, Part 2","date":"March 10, 2012","format":false,"excerpt":"Ryan suggested an alternative in a comment (and corresponding jsFiddle) to the technique that I\u2019d used in my previous Knockout.JS post. Following his suggestion, I made a few tweaks to my original function (and renamed it yet again): ko.observableArray.fn.withIndex = function (keyName) { var index = ko.computed(function () { var\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1563,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1563","url_meta":{"origin":1990,"position":3},"title":"Knockout.JS: AsDictionary","date":"March 9, 2012","format":false,"excerpt":"I frequently find that I have an array of objects in JavaScript that I want to display in a particular order and also have the ability to quickly locate an object by an ID or a key (and not use the indexOf function). As my recent project is using Knockout.JS,\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2012\/03\/image3.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":741,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/741","url_meta":{"origin":1990,"position":4},"title":"How to set Internet Explorer 8 View Source Tool\/Editor","date":"March 22, 2009","format":false,"excerpt":"IE8 includes a new syntax highlighting View Source tool similar to what is available in other web browsers. However, you may not want to use the built-in, view-only tool. It\u2019s easy to change. 1) Start Internet Explorer 8 if it isn\u2019t already started. Within IE8, click the Tools menu, then\u2026","rel":"","context":"In "General"","img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2009\/03\/image7.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1705,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1705","url_meta":{"origin":1990,"position":5},"title":"WinRT\/Xaml\/AKA Metro DataTemplate selection based on Data Types","date":"August 20, 2012","format":false,"excerpt":"You may have noticed that WinRT does not have automatic resolution of a DataTemplate based on the data type of object added to an ItemsControl. While unfortunate as this behavior is quite handy, it\u2019s not too difficult to replicate the functionality using a DataTemplateSelector. WPF for example, could do something\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/1990"}],"collection":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/comments?post=1990"}],"version-history":[{"count":1,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/1990\/revisions"}],"predecessor-version":[{"id":1991,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/1990\/revisions\/1991"}],"wp:attachment":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/media?parent=1990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/categories?post=1990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/tags?post=1990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}