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 🙏

© 2025 – Pkg Stats / Ryan Hefner

raknet-node

v0.5.0

Published

Nodejs bindings to rust-raknet native library.

Readme

raknet-node

Build Status NPM version ChatOnDiscord

Nodejs bindings to rust-raknet native library.

Install

npm install raknet-node

Prebuilds are provided for 64-bit Windows 10, Linux and OSX. If a prebuild does not work, please create an issue.

Build

napi build --release

Usage

Compatible node-raknet-native

raknet-node provides the same set of interfaces as node-raknet-native, which you can use in a similar way. But they still have some differences. For example we have to require the first byte of the packet to be 0xfe.

const { Client, Server, PacketPriority, PacketReliability } = require('raknet-node')
// The third paramater is for game type, you can specify 'minecraft' or leave it blank for generic RakNet
const client = new Client('127.0.0.1', 19130)
// hostname, port, serverOptions
const server = new Server('0.0.0.0', 19130)
server.listen()
client.connect()
client.on('encapsulated', (buffer) => {
  console.assert(buffer.cmp(Buffer.from([0xfe ,1, 2, 3])))
})

server.on('openConnection', (client) => {
  client.send(Buffer.from([0xfe ,1, 2, 3]), PacketPriority.HIGH_PRIORITY, PacketReliability.UNRELIABLE, 0)
})

Asynchronous usage

The RaknetClient and RaknetServer classes are JS wrappers for the internal RaknetSocket and RaknetListener classes implemented in Rust in src/. All methods use asynchronous wrappers.

const raknet = require('raknet-node')
const assert = require('assert');

async function main(){
	address = "127.0.0.1:19132"
	server = await raknet.RaknetServer.bind(address)
	console.log("bind to : " + address)
	
	client1 = await raknet.RaknetClient.connect(address)

	console.log("connect to : " + address + " success")

	client2 = await server.accept()

	await client1.send(Buffer.from([0xfe ,1, 2, 3]))
	await client2.send(Buffer.from([0xfe ,1, 2, 3]))

	buf1 = await client1.recv()
	buf2 = await client2.recv()

	assert(buf1.compare(buf2) == 0)

	return "finished"
}

main()
 .then(console.log)
 .catch(console.error)

Lisence

MIT - https://github.com/b23r0/raknet-node/blob/main/LICENSE