Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = require('./config');
- function getModule (data) {
- var name;
- // some logic to decide the value of name
- return require('./modules/' + name)(config[name]);
- }
- module.exports = function (payload) {
- .. some logic to manipulate the payload
- var module = getModule(payload);
- .. use the payload
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement