I have a resource loader JS file running on a nodejs server. I want to drop in a bunch of resource js files that the resource loader will load into an array on initialization.
// resource loader js file
var Resources = (function () {
var resources = {};
function Resources(){
... loading code here
// example of use after loading
resources[key].doStuff();
}
})();
module.exports.Resources = Resources;
In the same directory the developer can just drop in new resource.js files as needed.
// resource file
var ResourceA = (function () {
function ResourceA(){
... loading code here
// example of use after loading
ResourceA.prototype.doStuff= function () {
// do stuff
};
})();