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

nexus-nf

v0.5.2

Published

NexusNF is a lightweight and simple framework for building NATS microservices with TypeScript

Readme

Nexus NF



Nexus NF or Nexus NATS Framework is a lightweight and easy-to-use framework for building NATS microservices using TypeScript. Nexus utilizes NATS's built-in service API to register services, endpoint groups and endpoints.

⚠️ Project Status: Nexus NF is currently in active development. Stability is a major focus, but breaking changes and bugs may occur. Please provide feedback and report issues on GitHub.

Features

  • Flexibility: Nexus NF does not impose or enforce a specific design pattern, giving you the flexibility to build services in your own way.
  • TypeScript Support: Full type-safety included.
  • Data Validation: Built-in support for data validation with Zod schemas.
  • NATS Service Integration: Build on the NATS service API and request-response patterns, offering discovery, monitoring and load balancing out of the box.
  • Standardized Responses: Consistent response format for both successful messages and errors.

Installation

Use the project generator to quickly set-up and install a Nexus NF project.

npx create-nexus-service

Implementation

import { connect } from 'nats';
import { NexusApp, ControllerBase, Endpoint } from 'nexus-nf';
import { z } from 'zod';

// Define a schema
const addSchema = z.object({
    a: z.number(),
    b: z.number(),
});

// Create a controller
class MathController extends ControllerBase {
    constructor() {
        super('math', { queue: 'math-queue' });
    }

    @Endpoint('add', { schema: addSchema })
    async add(data: z.infer<typeof addSchema>) {
        return { result: data.a + data.b };
    }

    @Endpoint('multiply')
    async multiply(data: { a: number; b: number }) {
        return { result: data.a * data.b };
    }
}

// Initialize and run
async function main() {
    const nc = await connect({ servers: 'nats://localhost:4222' });

    const service = await nc.services.add({
        name: 'math-service',
        version: '1.0.0',
    });

    const app = new NexusApp(nc, service);
    app.registerController(new MathController());
}

main();

Making Requests

nats request "math.add" '{"a": 5, "b": 3}'
{ "error": false, "data": { "result": 8 } }

Response Format

All endpoints return standardized responses:

Success:

{
    "error": false,
    "data": { "result": 8 }
}

Error:

{
  "error": true,
  "message": "Bad Request: Validation failed.",
  "code": "400",
  "details": [...]
}

Documentation

For complete documentation, visit the documentation site.

Contribution Guide

  • Fork the repository on GitHub.
  • Clone your forked repository: `git clone
  • Create a feature branch: git checkout -b feature/my-awesome-feature
  • Install dependencies: npm install
  • Make your changes.
  • Run tests: npm test
  • Commit and push your changes to your fork.
  • Open a Pull Request to the main branch of the original repository.

Links