Skip to content

Instantly share code, notes, and snippets.

@richsilv
Last active August 29, 2015 14:02
Show Gist options
  • Save richsilv/b5e41fbd6e66cc135a60 to your computer and use it in GitHub Desktop.
Save richsilv/b5e41fbd6e66cc135a60 to your computer and use it in GitHub Desktop.
Some simple utilities for interrogating a Meteor.js website in bookmarklet format.
javascript: (function() {
var getCollections = function() {
var collections = [];
for (var item in window) {
if (window[item] && window[item]['_collection']) collections.push(item);
}
return collections;
};
var getSubscriptions = function() {
var thisSub, subs = {};
for (sub in Meteor.connection._subscriptions) {
thisSub = Meteor.connection._subscriptions[sub];
if (!subs[thisSub.name]) {
subs[thisSub.name] = [thisSub.params];
} else {
subs[thisSub.name].push(thisSub.params);
}
}
return subs;
};
Meteor.Snippet = {
getCollections: getCollections,
getSubscriptions: getSubscriptions
}
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment