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

flyweb-koa

v0.0.0

Published

This is an experimental library that modifies [Koa 2](https://github.com/koajs/koa/tree/v2.x) and [Koa 2 Browser](https://github.com/johnhenry/koa-2-browser) to work a bit like [FlyWeb Servers](https://flyweb.github.io/), currently in development at Mozil

Readme

FlyWeb Koa

This is an experimental library that modifies Koa 2 and Koa 2 Browser to work a bit like FlyWeb Servers, currently in development at Mozilla. This allows for changes in control flow that I like, but you may not... so try it out! :). Because it depends on Ko

Note: This depends specifically on the Alpha Version of Koa 2. Check out this guide to get started.

##What it does

Typically with Koa, one first creates a server, adds middleware, and finally then starts a server.

import koa from 'koa';
const port = 80;
const handleSuccess(port) =>{
  console.log(`listening at ${port}`);
  //Other stuff...
}
const handleError = console.error.bind(error);
const main = ()={
  const server = new Koa();
  server.use(/*middleware*/);
  server.listen(port, (error)=>{
    if(error){
      return handleError(error);
    }
    handleSuccess(port);
  });
}
main();

FlyWeb Koa, like FlyWeb, initiates a server and returns a promise resolved with that server, allowing you to add middleware afterwards.

import koa from 'koa';
import flyWebKoa from 'FlyWeb-koa';
const handleSuccess(port) =>{
  console.log(`listening at ${port}`);
  return port;
}
const otherStuff(successResult) =>{
  //Other stuff...
}
const handleError = console.error.bind(error);
const port = 80;
const publishServer = flyWebKoa(koa);
const main = async ()=> {
  const server = await publishServer(port);
  server.use(/*middleware*/);
  return port;
};
main()
  .then(handleSuccess, handleError)
  .then(otherStuff);

The code using FlyWeb Koa may seem more verbose, but it allows you cleanly to separate what happens after the server is started from the server itself.

##What else

In addition, FlyWeb Koa also adds the onfetch, and onwebsocket events from FlyWeb (though it doesn't attach the web socket). It also forces upgrade request to be handled like normal requests.