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

kuali-service-registry

v1.0.2

Published

A service registry with helpers to include optional service overrides.

Downloads

25

Readme

kuali-service-registry

A service registry with helpers to include optional service overrides.

Installation

npm install kuali-service-registry

Usage

// Yes, this is a singleton with shared state, more on that later
const registry = require('kuali-service-registry')

registry
  .setService('userMiddleware', (req, res, next) => {
    req.user = getUser()
  })
  .setService('myConfig', {
    port: '3000'
  })
  .registerModuleServices('some-node-module', require)

const { userMiddleware, myConfig } = registry.services

Note: The default export is a singleton so that you can require('kuali-service-registry') in any file in your application and have a shared registry. If you'd like to configure your own, you can pull in the class and create your own ServiceRegistry:

const { ServiceRegistry } = require('kuali-service-registry')

const registry = new ServiceRegistry()

API

new ServiceRegistry(options)

Creates a service registry, which keeps track of the registered services. returns a registry

  • options.logger {Object} - A logger to use when errors occur. It must have two properties that are both functions: info and warn.
  • options.debug {Boolean} - Set to true to output additional error information when an error loading a registry module occurs.

registry.configure(options)

Configures the registry with the given options. Note that you should only call this once as it will override the options with the defaults of the omitted options. For example:

const registry = require('kuali-service-registry')

registry.configure({ logger: console }) // Sets the logger to console, and debug to default
registry.configure({ debug: true }) // Sets the debug to true, and the logger to the default value

The options are the same options in the constructor.

registry.setService(serviceName, service)

Registers a service with the service registry. Returns the registry (for chaining).

  • serviceName {string} - The name to register the service under
  • service {*} - Anything you want to register to that service key. It can be literally anything, or nothing.

registry.registerModuleServices(modulePath, parentRequire)

Gives registry control over to a give module. Returns the registry (for chaining).

  • modulePath {string} - Should be an absolute path to a module, or just the module name if it's a module that is located in your project's node_modules.
  • parentRequire {Function} - You need to pass in the require function that you use in your context, so that it is able to include modules that you have access to, but this module does not.

The module should export a function registerServices that takes one argument, which is this registry. The idea is that this other module will register it's own or override or extend the existing services. If the module does not exist, it will print out a warning.

registry.removeService(serviceName)

Removes a give service. Returns the registry (for chaining).

  • serviceName {string} - The service to remove.

registry.services

The object who's keys are the service names that are currently registered.