Git Product home page Git Product logo

mumble-pinger's Introduction

Mumble Pinger

A Node.js tiny dependency-free implementation of the Mumble ping protocol.

Prerequisites

  • Node.js 10+

Installing

npm install mumble-pinger

Usage

Example

Basic example with default parameters:

const create = require('mumble-pinger');
const pinger = create();

(async () => {

  try {
    let response = await pinger.ping('my-mumble-server.com', 1234);
    console.log(response);

  } catch (error) {
    console.log(error);

  } finally {
    pinger.close();
  }

})();

Creation

There are a few params which can be passed to creation process:

const create = require('mumble-pinger');
const pinger = create({
  // max time to wait for server response. In milliseconds
  timeout: 6000,
  // allow a pinger to write some warns to console
  silent: false
});

Ping

pinger.ping(
  'my-mumble-server.com', // server ip or hostname
  1234 // server port
  5000 // [optional] override promise timeout for this request
);

Response

A successful ping promise resolves with object like that:

{ 
  version: 66056,
  // current online
  currentUsers: 0,
  // max server capacity
  maxUsers: 100,
  // bytes per second
  bandwidth: 196608 
}

License

This project is licensed under the MIT License

mumble-pinger's People

Contributors

maxsinev avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.