mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-16 08:48:32 +01:00
38ddfd61f3
* Add support to CommonJS * Fixes * Update CHANGELOG.md
13 lines
487 B
JavaScript
13 lines
487 B
JavaScript
import { GameDig } from '../lib/index.js'
|
|
// Instead of '../lib/index.js' you would have here 'gamedig'.
|
|
|
|
GameDig.query({
|
|
type: 'minecraft',
|
|
host: 'mc.hypixel.net',
|
|
port: 25565, // lets us explicitly specify the query port of this server
|
|
givenPortOnly: true // the library will attempt multiple ports in order to ensure success, to avoid this pass this option
|
|
}).then((state) => {
|
|
console.log(state)
|
|
}).catch((error) => {
|
|
console.log(`Server is offline, error: ${error}`)
|
|
})
|