4 ms·
Seems like a good idea to add outside of meteor projects too. Maybe an extension for Chrome dev tools that lists global variables loaded per page?
by scottrblock 14y ago
Seems like a good idea to add outside of meteor projects too. Maybe an extension for Chrome dev tools that lists global variables loaded per page?
- wavesounds 14y agoThis will give you a list of globals in browser for(var i in window){ if(typeof window[i]=="object"){console.log(i);} } But I think op wanted variables server side as well
- glesperance 14y agoI think it would be good to have that on both the client and the server. Also, as simple as this might be, making it a de-facto standard (on meteor) would be a good thing since it would be a tool that we can count on, all the time. There are too many browsers IMO to make an extension a viable option. Whitelisting variables would be good as well ; that way we do not get alerted if it is something we expect to be global.
- wavesounds 14y agoCreate a collection called MyVars and add this to your Server.js file: Meteor.setInterval(function(){ for(var i in global){ if(MyVars.find({name:i}).count()==0){ MyVars.insert({name:i}); console.log("New Public Variable: ", i); } } }, 5000); Thanks for the fun challenge :-)