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

database-aggregator

v3.1.4

Published

A database aggregator

Readme

database-aggregator

General principle

The database aggregator collects data from various sources and puts them into a mongoDB database. It doesn't do anything out of the box, you have to configure the sources and aggregations scripts yourself.

Install

Install database-aggregator globally:

npm install -g database-aggregator

Start database aggregator

DEBUG=aggregator:* DATABASE_AGGREGATOR_HOME_DIR=/path/to/homedir/ database-aggregator

Scripts

The database aggregator is composed of two main parts. The first is a scheduler which launches child process to execute synchronization and aggregation tasks. The other is an HTTP API to read data from the database and the act on the scheduler.

HTTP API

The HTTP API provides

  1. an API for simple read-only requests against the mongoDB source and aggregation databases
  2. An API to read synchronization processes status and logs
  3. an API to manage processes in the queue

HTTP API Documentation

Environment variables

DEBUG sets the level of information to log in the console. There are 4 levels of debug: trace, debug, warn, error. Examples:

DEBUG=aggregator:* # activate all debug levels
DEBUG=aggregator:warn,aggregator:error # activate warn and error debug levels

DATABASE_AGGREGATOR_HOME_DIR sets the configuration directory where the configuration is located

Additional configuration should be set in the home directory. See how to write the configuration directory

Scheduler

The scheduler scripts reads the configuration files and schedules the source and aggregation scripts. Each source synchronization and aggregation is launched in a new child process. The scheduler keeps track of the status of each process and logs the information in the MongoDB database. The logged information is available to end users via the HTTP API. Read here about how to write configuration files

image Edit diagram

Testing

Setup environment with Docker (for runnings tests)

docker pull mongo
docker create -p 27017:27017 --name mongo mongo
docker start mongo

Run tests

npm test

License

MIT