UNPKG

gamedig

Version:

Query for the status of any game server in Node.JS

8 lines (5 loc) 238 B
import * as protocols from '../protocols/index.js' export const getProtocol = (protocolId) => { if (!(protocolId in protocols)) { throw Error('Protocol definition file missing: ' + protocolId) } return new protocols[protocolId]() }