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

wongle

v0.1.0

Published

A Middleware Based TCP Server

Readme

Wongle

Have you ever needed a TCP server that can be configured via middleware, that might need to interchange synchronous and asynchronous actions on the data stream without worrying about special processing for either?

Wanted to write TCP middleware that returns promises, uses generators or async/await, or just does its thing and carries on?

No?

Too bad, here's a TCP server designed to do all of those things that you just read.

Installation

Wongle hasn't been published to NPM just yet, a super useful middleware is still being written that will be bundled with it. It does stream-interrupt buffering based on supplied patterns, and it's really cool.

Usage

You can check out src/examples/basic to see a working server that showcases some of the middleware types. Here's a theoretical example:

const Server = require('wongle').TcpServer

const server = new Server(2000) // 2 second middleware timeout

server.use(async packet => {
  const message = packet.data.toString() // packet.data is a buffer containing the current packet's payload
  const userData = await fetchUserData(message)
  packet.user = userData
})

server.use((packet, next) => {
  console.log(packet.userData)
  next()
})

server.listen(3123)

The example does a couple of things:

  • Imports the TcpServer
  • Creates a server with a 2 second timeout for middleware that just hang (Default timeout is 1 minute)
  • Tells the server to use an async middleware when it receives a data packet, that takes the data and uses it to fetch some sort of user data. The data is then added to the packet so that future middleware can access it
  • Adds a second middleware that logs the user data and then (since it's synchronous) calls the next middleware. Passing false to the next call would skip any subsequent middleware, or not calling next would cause the request to hang for the duration of the timeout specified when creating the server and then skip the following middleware
  • Listens on port 3123 for TCP connections

API

Actual docs coming soon