Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var config = require('./config');
  2. function getModule (data) {
  3.     var name;
  4.     // some logic to decide the value of name
  5.     return require('./modules/' + name)(config[name]);
  6. }
  7.  
  8. module.exports = function (payload) {
  9.     .. some logic to manipulate the payload
  10.    
  11.     var module = getModule(payload);
  12.  
  13.     .. use the payload
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement