Hacker News new | past | comments | ask | show | jobs | submit login

This 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




I 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.


Create 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 :-)




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: