Is it a good practice to move all of my common defined variables from app.js to another file and then require them in the app.js? If yes, I would like to know how I can include them from another file without having an object name and without accessing each and ever single of them separately.
I know this one is possible:
module.exports = function(app){
var express = require("express");
var fs = require("fs");
var async = require('async');
var AWS = require('aws-sdk');
var session = require('express-session');
};
and then in app.js require them like:
var settings = require("settings.js");
But I don't want to have an object I would like to know if there is anyway I can include them all in my app.js (similar to require in PHP).
Please let me know if you need more clarification.
Thanks