node-minecraft-pinger icon indicating copy to clipboard operation
node-minecraft-pinger copied to clipboard

A promise based minecraft pinger in Node.js

minecraft-pinger

js-standard-style license

A promise-based minecraft pinger in Node.js

TODOs

  • [x] Calculate latency in milliseconds
  • [x] Resolve SRV dns entry
  • [ ] Able to ping servers prior version 1.6

Example

const pinger = require('minecraft-pinger')

// Promise
pinger.pingPromise('localhost', 25565)
  .then(console.log)
  .catch(console.error)

// Async
pinger.ping('localhost', 25565, (error, result) => {
  if (error) return console.error(error)
  console.log(result)
})

License

MIT