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

expressed-example-app

v2.1.1

Published

Advanced Express.js application featuring high-performance routing with custom hooks, declarative route definitions, and integrated queue system for background task processing. Perfect for scalable web applications requiring sophisticated routing and asyn

Readme

Express-Router-BDS Example Application

This is a sample Express.js application demonstrating the usage of the express-router-bds routing system with custom hooks, advanced features, and integrated queue system.

Overview

This example application showcases:

  • High-performance routing with express-router-bds
  • JSON-based route configuration
  • Custom hook system implementation
  • Parameterized route handling
  • Directory-based route loading
  • Integrated queue system with express-queued
  • Declarative route definitions in separate JSON files

Features

  • Modular Route Configuration: Routes defined in JSON files for easy maintenance
  • Custom Hooks: Comprehensive hook system with pre_route_load, post_route_load, before_route_handler, after_route_handler, route_handler_error, and more
  • Parameterized Routes: Support for dynamic routes like /users/:id and /products/:category/:id
  • Integrated Queue System: Background task processing with express-queued
  • Declarative Routes: Separate route files for different functionalities
  • Extensible Architecture: Easy to extend with custom middleware and hooks

Project Structure

express-app/
├── app.js                 # Main application entry point
├── queue-system.js        # Queue system integration
├── hooks-config.js        # Base hook configurations
├── hooks-personalizados.js # Custom hook implementations
├── controllers/
│   ├── mainController.js  # Home, init and queue route handlers
│   ├── productController.js # Product route handlers
│   └── userController.js  # User route handlers
├── routes/
│   ├── main-routes.json   # Main route definitions in JSON format
│   └── queue-routes.json  # Queue-related route definitions
└── node_modules/
    ├── express-router-bds/ # Custom routing system
    └── express-queued/    # Queue system

Available Endpoints

Main Endpoints

  • GET / - Home page with welcome message
  • GET /init - Initialization endpoint
  • GET /users/:id - Get user by ID
  • GET /products/:category/:id - Get product by category and ID
  • GET /test-hook - Test endpoint for hook demonstration

Queue System Endpoints

  • GET /queue-status - Get the status of the queue system
  • GET /start-queues - Start the queue system
  • GET /stop-queues - Stop the queue system
  • POST /process-user - Add a user processing task to the queue
  • POST /process-product - Add a product processing task to the queue
  • POST /send-email - Add an email sending task to the queue

Queue System

The application integrates express-queued for background task processing:

  • Multiple Queues: Dedicated queues for different types of tasks
  • Configurable Concurrency: Control how many tasks execute simultaneously per queue
  • Retry System: Automatic failure handling with configurable retries
  • Priority Management: Assign priorities to tasks
  • Hooks Integration: Customize processing with hooks

Queue Types

  • procesamiento-general - General processing tasks
  • envio-correos - Email sending tasks
  • procesamiento-usuarios - User processing tasks
  • procesamiento-productos - Product processing tasks

Hook System

The application demonstrates several types of hooks:

  • pre_route_load - Executes before loading routes from a file
  • post_route_load - Executes after loading routes from a file
  • before_route_processing - Executes before processing any route
  • route_matched - Executes when a matching route is found
  • before_route_handler - Executes before executing a route handler
  • after_route_handler - Executes after executing a route handler
  • route_handler_error - Executes when a route handler error occurs

Installation

npm install

Usage

Start the server:

npm start

The application will be available at http://localhost:3000

Testing

Test the main endpoints:

curl http://localhost:3000
curl http://localhost:3000/users/123
curl http://localhost:3000/products/electronics/456

Test the queue system:

# Check queue status
curl http://localhost:3000/queue-status

# Add a user processing task
curl -X POST http://localhost:3000/process-user \
  -H "Content-Type: application/json" \
  -d '{"userId": "123", "name": "John Doe", "email": "[email protected]"}'

# Add an email sending task
curl -X POST http://localhost:3000/send-email \
  -H "Content-Type: application/json" \
  -d '{"to": "[email protected]", "subject": "Test", "content": "Test content"}'

License

This project is part of the express-router-bds ecosystem and follows the same licensing terms.