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 🙏

© 2024 – Pkg Stats / Ryan Hefner

0http-bun

v1.0.4

Published

0http for Bun

Downloads

61

Readme

Introduction

Experimental, bun-based HTTP framework inspired by 0http

Performance Benchmarks

MacBook Pro (13-inch, 2020)

Usage

const http = require('0http-bun')

const { router } = http({
  port: 3000
})
router.use((req, next) => {
  req.ctx = {
    engine: 'bun'
  }

  return next()
})
router.get('/:id', async (req) => {
  return Response.json(req.params)
})
router.post('/', async (req) => {
  return new Response('POST')
})
router.delete('/:id', async (req) => {
  return Response.json(req.params, {
    status: 200
  })
})

export default router

Benchmarks

0http-bun (bun v0.2.2)

% wrk -t4 -c50 -d10s --latency http://127.0.0.1:3000/hi
Running 10s test @ http://127.0.0.1:3000/hi
  4 threads and 50 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   463.26us   99.23us   4.28ms   96.62%
    Req/Sec    25.98k     1.10k   27.48k    76.73%
  Latency Distribution
     50%  442.00us
     75%  466.00us
     90%  485.00us
     99%    0.91ms
  1044377 requests in 10.10s, 127.49MB read
Requests/sec: 103397.66
Transfer/sec:     12.62MB

0http (node v18.2.0)

% wrk -t4 -c50 -d10s --latency http://127.0.0.1:3000/hi
Running 10s test @ http://127.0.0.1:3000/hi
  4 threads and 50 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     0.98ms  251.77us  13.04ms   95.09%
    Req/Sec    12.31k   771.37    16.96k    95.29%
  Latency Distribution
     50%    0.95ms
     75%    0.96ms
     90%    0.98ms
     99%    1.88ms
  493899 requests in 10.10s, 63.59MB read
Requests/sec:  48893.32
Transfer/sec:      6.29MB

express (node v18.2.0)

% wrk -t4 -c50 -d10s --latency http://127.0.0.1:3000/hi
Running 10s test @ http://127.0.0.1:3000/hi
  4 threads and 50 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.99ms    0.90ms  20.31ms   89.52%
    Req/Sec     2.42k   154.52     2.66k    82.25%
  Latency Distribution
     50%    4.67ms
     75%    4.83ms
     90%    6.03ms
     99%    8.43ms
  96296 requests in 10.01s, 21.95MB read
Requests/sec:   9622.74
Transfer/sec:      2.19MB

Support / Donate 💚

You can support the maintenance of this project:

  • PayPal: https://www.paypal.me/kyberneees