Simple snippet to make Node's built in modules globally accessible

385 Views

I am very lazy and don't want to type the same fs = require('fs') in every little thing I'm doing and every temporary file that is just a means to an end and will never be used in production. I decided to share this little snippet that iterates Node's internal (built in) modules and globalizes only the valid ones.