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

flow-server-framework

v1.0.0

Published

A minimalist modular framework for Node.js applications

Readme

Flow Server Framework

A lightweight, modular framework for building Node.js applications with a clean architecture.

Features

  • Modular Design: Core components are designed to be independent and reusable
  • Lifecycle Management: Consistent initialization, startup, and shutdown processes
  • Service Container: Simple dependency injection system
  • Event System: Built-in event emission and subscription
  • HTTP Support: Basic HTTP server with routing and middleware
  • Configuration: Flexible configuration management

Core Components

  • Flow: The main application container that manages the lifecycle
  • Engine: Abstract base class for all engines (like HTTP, WebSocket, etc.)
  • HttpEngine: HTTP server implementation with routing and middleware
  • ServiceManager: Dependency injection container
  • Config: Configuration management system

Installation

npm install flow-server-framework

Quick Start

const { createFlow, HttpEngine } = require('flow-server-framework');

// Create a new Flow instance
const flow = createFlow({
  config: {
    app: {
      name: 'My App',
      version: '1.0.0'
    },
    http: {
      port: 3000
    }
  }
});

// Create and register HTTP engine
const httpEngine = new HttpEngine({
  port: flow.config.get('http.port')
});

// Add routes
httpEngine.get('/', (ctx) => {
  ctx.res.setHeader('Content-Type', 'application/json');
  ctx.res.end(JSON.stringify({
    app: flow.config.get('app.name'),
    version: flow.config.get('app.version'),
    message: 'Hello from Flow Server Framework!'
  }));
});

// Register engine with Flow
flow.registerEngine('http', httpEngine);

// Start the application
flow.start()
  .then(() => {
    console.log('Application started successfully');
  })
  .catch((err) => {
    console.error('Failed to start application:', err);
  });

Extending the Framework

Flow Server Framework is designed to be extended. You can create custom engines, services, and middleware to enhance its functionality.

Creating a Custom Engine

const { Engine } = require('flow-server-framework');

class MyCustomEngine extends Engine {
  async _init() {
    // Initialization logic
    console.log('Custom engine initialized');
  }

  async _start() {
    // Start logic
    console.log('Custom engine started');
  }

  async _stop() {
    // Stop logic
    console.log('Custom engine stopped');
  }
}

Plugin System

Flow Server Framework includes a powerful plugin system that follows the "pif paf hopla" philosophy:

  • Pif: Auto-discovery of plugins in designated directories
  • Paf: Auto-configuration of plugins based on application settings
  • Hopla: Auto-adaptation to different environments and configurations

Plugins can extend the framework's functionality without modifying its core code. For detailed information about the plugin system, see PLUGINS.md.

Basic Plugin Example

// flow-server-plugin-example/src/index.js
class ExamplePlugin {
  constructor(options = {}) {
    this.options = {
      greeting: 'Hello from Example Plugin!',
      ...options
    };
  }

  init(flow) {
    // Register with service manager
    flow.services.set('examplePlugin', this);
    
    // Add a route if HTTP engine is available
    const httpEngine = flow.getEngine('http');
    if (httpEngine) {
      httpEngine.get('/example', (ctx) => {
        ctx.res.setHeader('Content-Type', 'application/json');
        ctx.res.end(JSON.stringify({
          message: this.options.greeting
        }));
      });
    }
    
    return this;
  }
}

module.exports = function createExamplePlugin(options = {}) {
  return new ExamplePlugin(options);
};

License

MIT