node-gamedig/lib/index.js
CosminPerRam 5b01e1be17
Replace deprecated substr with substring (#355)
* Make the QueryRunner more readable

* Remove use of deprecated substr and replace with substring, and some formatting
2023-09-13 17:31:58 +03:00

27 lines
525 B
JavaScript

const QueryRunner = require('./QueryRunner');
let singleton = null;
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);
}
}
module.exports = Gamedig;