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

microservice-system-analyzer

v0.13.0

Published

[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Readme

microservice-system-analyzer

JavaScript Style Guide

This software determines the communication links in a system of microservices in order to visualize the topology of the system. The approach is based on analyzing static resources, e.g. REST APIs of infrastucture services and the source code of the microservices. For each source of information, a dedicated importer is responsible. Finally, all information is merged into a complete picture of the system. The approach is more lightweight as it does analyze dynamic communication. This is in contrast to APM solutions suchs as AppDynamics.

The analyzer collects information by

  1. accessing infrastructure services via REST APIs (e.g. Consul and RabbitMQ) and by
  2. parsing the source code of microservices.

Example

This is an example topology created from analyzing a real system. It was created by using the layouting tool yEd on the GraphML export (see GraphML exporter below).

Current Status

The project was initially developed in Node.js 8 and with a system model (referred to as v0 model) that turned out to be not flexible enough. At the moment, the code is being transitioned to TypeScript in small steps and the model is replaced by a more flexible v1 system model. The old v0 system model API that is described in the following sections will remain available until version 1.0 is released.

Architecture

Each importer collects information that provides a view of the system. This information is merged into a complete structure of the system. Exporters can transform the system to different formats. In each component, a unified system model is used to simplify integration.

analyzer architecture

Importers

Spring Boot FeignClients

An importer that searches for @FeignClient annotations in source code to capture synchronous communication links.

RabbitMQ Management

An importer for asynchronous communication links that accesses the RabbitMQ Management API. It requires to follow a schema for naming queues and exchanges.

  • Schema:
    • A sending microservice s must send data to an exchange s, i.e. the exchange must have the same name as the sending microservice.
    • A receiving microservice r must create a queue.
      • The queue must be bound to the exchange s.
      • The queue name must match the following regular expression: r\.\w*.
  • Example:
    • Given two Microservices A and B where B receives events from A.
    • Microservice B has a queue named B.foo which is bound to the exchange A.
    • Microservice A sends data to the exchange A.

Further importers

  • Consul
  • Git-Repositories

Exporters

  • JSON
  • GraphML

Requirements

  • Node.js 8
  • Git CLI

Getting started

Tests

Tests can be run via npm run test.

Configuration

The library is configured by the following environment variables:

  • CONSUL_PATH: URL to Consul HTTP API
  • RABBITMQ_PATH: URL to RabbitMQ Management HTTP API
  • GIT_REPOSITORY_PREFIX: Prefix for Git Repositories, e.g. [email protected]:group/
  • IGNORED_SERVICES: comma separated list of services or part of service names to ignore in analysis
  • SOURCE_FOLDER: location of source files in the local file system which are imported with the Git importer

Example usage of importers and merger

The library offers importers, exporters and a merger that have to be combined. The following code shows an example usage for merging the resulting systems of several importers.

const analyzer = require('microservice-system-analyzer')

const consulImporter = analyzer.importer.consulImporter
const feignImporter = analyzer.importer.feignClientImporter
const rabbitmqImporter = analyzer.importer.rabbitmqManagementImporter

const systemMerger = analyzer.processor.systemMerger
const subSystemTransformer = analyzer.processor.subSystemTransformer

async function getSystem () {
  const consulSystem = await consulImporter.getSystem()
  const rabbitmqSystem = await rabbitmqImporter.getSystem()
  const feignSystem = await feignImporter.getSystemWithLinksInReverse()
  const mergedSystem = systemMerger.mergeSystems([consulSystem, rabbitmqSystem, feignSystem])

  return mergedSystem
}

async function getSystemWithSubSystems () {
  const flatSystem = await getSystem()
  const structuredSystem = subSystemTransformer.transform(flatSystem)

  return structuredSystem
}

Example usage of Git importer

Some importers require source code that is usually available via Git repositories. The following example shows how to use the Git importer to get the source code.

const analyzer = require('microservice-system-analyzer')

const gitImporter = analyzer.importer.gitRepositoryImporter
const configRepository = analyzer.configRepository

const sourcePath = gitImporter.importRepository(serviceName, getRepositoryName(serviceName))
// import is successfull if sourcePath is not null

function getRepositoryName (serviceName) {
  return configRepository.getGitRepositoryPrefix() + serviceName
}

Example usage of GraphML exporter

The code below shows how to use the GraphML exporter on a system returned by a merger or an importer.

const analyzer = require('microservice-system-analyzer')

const graphMLExporter = analyzer.exporter.graphMLExporter

const xml = graphMLExporter.getGraphML(system)

License

Apache License, Version 2.0

Copyright 2017-2018 Andreas Blunk, MaibornWolff GmbH