Skip to content

This is a Node.js module that allows to get Minecraft server information from various API endpoints.

Notifications You must be signed in to change notification settings

vCesar1mx/insemi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INSEMI (INFORMATION SERVER MINECRAFT)

This is a Node.js module that allows to get Minecraft server information from various API endpoints.

Example of usage

const fetchData = require('insemi');

async function main() {
    try {
        // Specify the required options you want to get from the Minecraft API.
        // Available options: ['online', 'maxplayers', 'version', 'favicon', 'response']
        const requiredOptions = ['online'];
        // fetchData(requiredOptions, server_ip, server_port);
        const minecraftData = await fetchData(requiredOptions, 'mc.haliacraft.com', '25565');
        console.dir(minecraftData);
    } catch (error) {
        console.error(`Error retrieving data from Minecraft API: ${error.message}`);
    }
}

main();
Installation
You can install this module through npm:

npm install insemi
Usage
fetchData(required)
Main function to obtain data from the Minecraft server.

required (Array): An array of options to get from the Minecraft API.
Options: ['online', 'maxplayers', 'version', 'favicon', 'response']
Returns an object with the requested Minecraft server data.


Example

const fetchData = require('insemi');

async function main() {
    try {
        // Specify the required options you want to get from the Minecraft API.
        // Available options: ['online', 'maxplayers', 'version', 'favicon', 'response']
        const requiredOptions = ['online'];
        // fetchData(requiredOptions, 'mc.haliacraft.com', '25565');
        // fetchData(requiredOptions, server_ip, server_port);
        const minecraftData = await fetchData(requiredOptions, 'mc.haliacraft.com', '25565');
        console.dir(minecraftData);
    } catch (error) {
        console.error(`Error retrieving data from Minecraft API: ${error.message}`);
    }
}

main();

Disclaimer: This module uses data from external sources and is subject to changes in those sources. The availability and accuracy of the data cannot be guaranteed.

About

This is a Node.js module that allows to get Minecraft server information from various API endpoints.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published