minecraft-server-ping
    Preparing search index...

    Function srvRecordResult

    • Resolves the first SRV record for the given service name.

      Parameters

      • srv: string

        The service name to resolve.

      Returns Promise<IResult<SrvRecord, ErrnoException>>

      A promise of Result that resolves to the first SRV record, or Err if no records were found.

      const res = await srvRecordResult('_minecraft._tcp.example.com');
      if (res.isOk) {
      console.log(res.ok()); // { name: 'example.com', port: 25565, priority: 0, weight: 5 }
      } else {
      console.error(res.err());
      }