Test esbuild to generate ESModule and CommonJS

This commit is contained in:
Guilherme Werner 2024-01-27 11:46:54 -03:00
parent 46db10fcc7
commit 4764ec2e64
6 changed files with 689 additions and 7 deletions

View file

@ -1,13 +0,0 @@
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}`)
})