mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 07:07:33 +00:00
feat: add simple example
This commit is contained in:
parent
3a1950133d
commit
1b0930ee75
2 changed files with 13 additions and 5 deletions
11
examples/simple.js
Normal file
11
examples/simple.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import GameDig from '../lib/index.js'
|
||||
// Instead of '../lib/index.js' you would have here 'gamedig'.
|
||||
|
||||
GameDig.query({
|
||||
type: 'minecraft',
|
||||
host: 'mc.hypixel.net'
|
||||
}).then((state) => {
|
||||
console.log(state)
|
||||
}).catch((error) => {
|
||||
console.log(`Server is offline, error: ${error}`)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue