mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-16 08:48:32 +01:00
8192ed07e0
* feat: export games and protocols besides GameDig * fix: revert ProtocolResolver rename * fix: imports on the attempt tools * docs: update changelog to note exports
23 lines
456 B
JavaScript
23 lines
456 B
JavaScript
import QueryRunner from './QueryRunner.js'
|
|
|
|
let singleton = null
|
|
|
|
export class GameDig {
|
|
constructor (runnerOpts) {
|
|
this.queryRunner = new QueryRunner(runnerOpts)
|
|
}
|
|
|
|
async query (userOptions) {
|
|
return await this.queryRunner.run(userOptions)
|
|
}
|
|
|
|
static getInstance () {
|
|
if (!singleton) { singleton = new GameDig() }
|
|
|
|
return singleton
|
|
}
|
|
|
|
static async query (...args) {
|
|
return await GameDig.getInstance().query(...args)
|
|
}
|
|
}
|