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

roufs

v0.0.2

Published

Roufs is a lightweight filesystem routing package for express and koa

Downloads

1

Readme

Roufs: Simplified Routing for Node.js

Roufs (pronounced "roofs") is a straightforward and practical routing solution for Node.js API frameworks, inspired by the routing approach used in Next.js. This module is designed to work seamlessly with Express.js, but it can be easily adapted for use with other popular frameworks as well.

Features

  • Automatic route mapping
  • Supports parameterized routes
  • Minimal configuration required

Getting Started

To get started with Roufs in an express project, follow these steps:

  1. Install Roufs:

    npm install roufs
  2. Create your route handler modules in the desired directory structure. For example:

        -   ./routes
        ├── index.js
        ├── authors
        │   ├── GET.js
        │   └── POST.js
        └── books
            ├── index.js
            └── [bookid].js
  3. Integrate Roufs into your Express.js server in your index.js file:

    
        const express = require("express");
        const roufs = require("roufs");
        const app = express();
    
        // Specify the path to your route handler modules
        app.use(roufs('./routes'));
    
        app.listen(5001, () => {
            console.log("Server is up and running on port 5001!");
        });

Defining Routes

Define your route handlers in separate modules within the ./routes directory (relative to root of project). You can use simple functions or objects with HTTP method-specific functions to define your handlers. For example:

// Example 1: ./routes/authors/GET.js
module.exports = (req, res) => res.send("Response");

// Example 2: ./routes/books/index.js
module.exports = {
    GET: (_, res) => res.send("GET:/books"),
    POST: (_, res) => res.send("POST:/books")
}

// Example 3: ./routes/books/[bookid].js
module.exports = {
    GET: (req, res) => res.send(req.params), // params = { bookid: "path-param" }
};

Dynamic Routes

Roufs supports dynamic routes. You can create parameterized routes like /books/[bookid], and the module will handle them automatically.

How Roufs Works

Roufs uses a clever mechanism to traverse your route directory structure and dynamically match incoming requests to their corresponding handlers. It simplifies route management by abstracting away the complexities.

Contributing

If you'd like to contribute to Roufs or have any questions, feel free to reach out. Your contributions and feedback are welcome.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Please make sure to replace `"my-project"` with the actual name of your project and adjust the content as needed. Additionally, consider adding a license file (`LICENSE`) to your project directory and specifying the appropriate license for your module.