npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

minecraft-smp

v0.1.0

Published

A lightweight, full-featured TypeScript library for the Minecraft Server Management Protocol

Readme

minecraft-smp

A lightweight, fully-featured TypeScript client for the Minecraft Server Management Protocol (MSMP) introduced in 25w35a.

Features

  • Compatibility

    Compatible with both Node.js and web browsers.

  • Automatic Reconnection

    Handles broken connections gracefully by automatically attempting to reconnect with configurable backoff.

  • Request / Response Handling

    Supports sending requests (e.g., rpc.discover, minecraft:players, minecraft:allowlist/add) with response handling built-in.

  • Full Protocol Coverage

    • Supports all namespaced methods: rpc.discover, minecraft:players, minecraft:allowlist, minecraft:operators, minecraft:server, minecraft:serversettings, minecraft:gamerules, etc.
    • Supports all notification events such as notification:players, notification:gamerules.

Getting Started

Installation

npm install minecraft-smp
# or
pnpm add minecraft-smp
# or
yarn add minecraft-smp

Initialization Example

import Client from 'minecraft-smp';

const client = new Client('ws://localhost:25585', {
	autoReconnect: true,
	reconnectInterval: 3_000,
});

await client.connect();

const schema = await client.request('rpc.discover');

console.log('API Schema:', schema);

Usage Examples

Discovering API Schema

const schema = await client.request('rpc.discover');

console.log('API Schema:', schema);

Adding a Player to Allowlist

const players = [{ id: '853c80ef-3c37-49fd-aa49-938b674adae6' }, { name: 'Steve' }];

const result: Player[] = await client.Allowlist.add(players);

console.log('Allowlist updated:', result);

Send System Message to All Players

// Get All Players on the Server
const players = await client.Players.get();

const message: Message = {
	literal: 'Hello World',
	translatable: '%1$s World',
	translatableParams: ['Hi'],
};

// using MessageBuilder
const message = new MessageBuilder()
	.setColor('Green')
	.setFormat('Bold')
	.setFormat('Italic')
	.addText('Hello ')
	.addText('World', { color: 'Aqua', formats: ['Bold', 'Underline'] });

// Send System Message
await client.Server.sendSystemMessage({
	receivingPlayers: players,
	message: message,
	overlay: true,
});

Handling Notifications

// Player Joined the Server
client.onNotification('notification:players/joined', (player) => {
	const { id, name } = player;

	console.log(`Player joined: ${name} (${id}) joined the server`);
});

// Player Left the Server
client.onNotification(NotificationEvents.PlayerLeft, (player) => {
	const { id, name } = player;

	console.log(`Player left: ${name} (${id}) left the server`);
});

Configuration Options

  • autoReconnect (boolean): Enable/disable automatic reconnection. Default: false
  • reconnectInterval (number): Delay between reconnect attempts (ms). Default: 5000
  • maxReconnectAttempts (number): Number of max reconnection attempts. Default: 10
  • requestTimeout (number): Maximum time in milliseconds to wait for a response to a request before rejecting. Default: 30000

Example:

const client = new Client('ws://...', {
	autoReconnect: true,
	reconnectInterval: 5_000,
	maxReconnectAttempts: 10,
	requestTimeout: 30_000,
});

TODO

  • [ ] Tests