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

@yawaramin/re-web

v0.8.0

Published

OCaml/ReasonML web framework

Readme

ReWeb - a type-safe ergonomic ReasonML and OCaml web framework (WIP)

npm Build Status Test Status

ReWeb is a web framework based on several foundations:

  • The amazing work of the people behind Httpaf, H2, Esy, and others
  • The core idea of 'Your server as a function' by Marius Eriksen which was also the idea behind Twitter's Finagle web stack
  • Jasim Basheer's essay 'Rails on OCaml' which identifies the need for an ergonomic, Rails-like web framework that still preserves the type safety benefits of OCaml.

ReWeb's main concepts are:

  • Services: a service is a function from a request to a promise of response (i.e. an asynchronous function).
  • Filters: a filter is a function that takes a service as input and returns a service as output. It can be inserted into the 'request pipeline' and manipulate the request before the service finally handles it.
  • Server: a server is a function that takes a route (pair of HTTP method and path list) as input and returns a service as output.
  • Type-safe request pipeline: requests have a type parameter that reveals their 'context' i.e. some data that's stored inside them. Filters and services must change requests correctly and in the right order, or the compiler will present type errors.

Notice that all the main concepts here are just functions. They are all composeable using just function composition. Services can call other services. Filters can slot together by calling each other. Servers can delegate smaller scopes to other servers. See bin/Main.re for examples of all of these.

Documentation

Examples

Fullstack Reason

Check out the demo repo which shows a fullstack Reason setup with ReWeb and ReasonReact, with code sharing: https://github.com/yawaramin/fullstack-reason/

This repo can be cloned and used right away for a new project.

Bin directory

Finally, check out the example server in the bin/ directory. The Main.re file there has extensive examples of almost everything ReWeb currently supports.

Run the example server:

$ esy bin

Send some requests to it:

$ curl localhost:8080/hello
$ curl localhost:8080/auth/hello
$ curl --user 'bob:secret' localhost:8080/auth/hello

Go to http://localhost:8080/login in your browser, etc.

Try

You need Esy, you can install the beta using npm:

$ npm install --global esy@latest

Then run the esy command from this project root to install and build dependencies.

$ esy

Now you can run your editor within the environment (which also includes merlin):

$ esy $EDITOR
$ esy vim

Alternatively you can try vim-reasonml which loads esy project environments automatically.

After you make some changes to source code, you can re-run project's build again with the same simple esy command.

$ esy

Generate documentation:

$ esy doc
$ esy open '#{self.target_dir}/default/_doc/_html/index.html'

Shell into environment:

$ esy shell

Run the test suite with:

$ esy test

Warning

ReWeb is experimental and not for production use! I am still ironing out the API. But (imho) it looks promising for real-world usage.