gf

factory class for your app.

Global variables Factory module.

$ npm install gf
  • in startup script:
 
var factory = require('gf').instance();
 
factory.set('mysql', mysql);
factory.set('errorlog', errorlog);
 
  • in any other scripts:
var factory = require('gf').instance();
 
factory.get('mysql').query('SHOW DATABASES', function (edata) {
  console.log(data);
});

MIT