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

r-agency-mesh

v1.435.0

Published

My owen mesh graphql server

Downloads

3,251

Readme

Mesh Server

Overview

Mesh Server is a powerful, modular GraphQL server framework built with TypeScript. It provides a flexible architecture for building scalable backend applications with support for GraphQL, REST APIs, WebSockets, and more.

Features

  • GraphQL API: Built-in GraphQL server with schema generation
  • Plugin System: Extensible architecture with plugin support
  • Multiple Communication Protocols: HTTP, GraphQL, WebSockets
  • Database Integration: Support for PostgreSQL and MySQL through TypeORM
  • Authentication: Built-in authentication and authorization
  • Caching: Integrated caching mechanisms
  • Task Scheduling: Cron job support for scheduled tasks
  • Event System: Comprehensive event management
  • Media Handling: Tools for managing media files
  • Performance Monitoring: Built-in performance tracking

Installation

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • PostgreSQL or MySQL (depending on your configuration)

Steps

  1. Clone the repository:

    git clone <repository-url>
    cd mesh/server
  2. Install dependencies:

    npm install
  3. Configure environment variables:

    • Create a .env file in the root directory
    • Add required environment variables (see Configuration section)
  4. Build the project:

    npm run build-dev
  5. Start the development server:

    npm run dev

Configuration

Mesh Server uses a combination of environment variables and configuration files:

Environment Variables

Create a .env file in the root directory with the following variables:

# Server Configuration
HTTP_PORT=3000
GRAPHQL_PORT=4000
WEBSOCKET_PORT=5000
GRAPHQL_PATH=/graphql

# Database Configuration
DB_TYPE=postgres  # or mysql
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=username
DB_PASSWORD=password
DB_DATABASE=mesh

# Other Configuration
NODE_ENV=development

Configuration Files

The mesh.config.yml file contains additional configuration options:

server:
  http-port: 3000
  graphql-port: 4000
  websocket-port: 5000
  graphql-path: /graphql
  http-request-limit: 50mb
  graphql-request-limit: 50mb

Usage

Starting the Server

Development mode:

npm run dev

Production mode:

npm run start-prod

Using Forever (for production):

npm run start

Creating a GraphQL API

  1. Define your GraphQL schema in the appropriate directory
  2. Create resolvers for your schema
  3. The server will automatically generate the necessary code

Architecture

Mesh Server follows a modular, plugin-based architecture:

Core Components

  • Bootstrap: Initializes and starts the server
  • MeshConfig: Manages configuration
  • PluginManager: Handles plugin registration and execution
  • EventManager: Manages event emission and handling
  • GraphQlSchemaBuilder: Generates GraphQL schema

Key Directories

  • src/core: Core framework components
    • async-worker: Asynchronous task processing
    • auth: Authentication and authorization
    • boot: System initialization
    • database: Database access and management
    • graphql: GraphQL implementation
    • plugin: Plugin system
    • websocket: WebSocket implementation
    • rest-api: REST API implementation
    • event-manager: Event handling
    • helper: Utility functions

API Documentation

GraphQL API

The GraphQL API is available at the configured endpoint (default: /graphql). You can use tools like GraphQL Playground or Apollo Studio to explore the API.

WebSocket API

WebSocket connections are available on the configured port (default: 5000).

Development

Available Scripts

  • npm run build-dev: Build for development
  • npm run build-prod: Build for production
  • npm run dev: Start development server with hot reloading
  • npm run lint: Run ESLint
  • npm run lint:fix: Fix ESLint issues
  • npm run format: Format code with Prettier
  • npm run test: Run tests

Adding Plugins

Plugins can be added to extend the functionality of the server:

import { startServer } from './index';
import { MyCustomPlugin } from './plugins/my-custom-plugin';

startServer({
  rootDir: __dirname,
  loadGlobalEnv: true,
  plugins: [new MyCustomPlugin()],
});

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -am 'Add my feature'
  4. Push to the branch: git push origin feature/my-feature
  5. Submit a pull request

License

ISC License