diff --git a/README.md b/README.md index 21e4fe6..b480d8e 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,15 @@ See the [GAMES_LIST.md](GAMES_LIST.md) file for the currently supported titles, ## Usage from Node.js Install using your favorite package manager: `npm install gamedig`, then use! ```js -import GameDig from 'gamedig'; +import { GameDig } from 'gamedig'; GameDig.query({ type: 'minecraft', - host: 'mc.example.com' + host: 'mc.hypixel.net' }).then((state) => { console.log(state); }).catch((error) => { - console.log("Server is offline"); + console.log(`Server is offline, error: ${error}`); }); ``` Confused on how this works, or you want to see more? Checkout the [examples](/examples) folder! diff --git a/examples/simple.js b/examples/simple.js index a0c52c1..31295db 100644 --- a/examples/simple.js +++ b/examples/simple.js @@ -3,7 +3,9 @@ import { GameDig } from '../lib/index.js' GameDig.query({ type: 'minecraft', - host: 'mc.hypixel.net' + 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) => {