nci
Version:
Flexible, open source continuous integration server written in node.js
23 lines (16 loc) • 458 B
JavaScript
;
var BaseNode = require('./base').Node;
exports.BaseNode = BaseNode;
var constructors = {
local: require('./local').Node
};
exports.register = function(type, constructor) {
constructors[type] = constructor;
};
exports.createNode = function(params) {
if (params.type in constructors === false) {
throw new Error('Unknown node type: ' + params.type);
}
var Constructor = constructors[params.type];
return new Constructor(params);
};