@nio/topic-grapher

2.0.0 • Public • Published

Installation

$ npm install @nio/topic-grapher

Usage

import graph from '@nio/topic-grapher';

type ServiceName = string;
type Topic = string;

const services = await fetch(servicesUrl).then(r => r.json());
const blocks = await fetch(blocksUrl).then(r => r.json());

const result = graph(services, blocks)
result.nodes // => Array<ServiceName>
result.edges // => Array<[ServiceName, ServiceName, Topic]>

Trace

const result = graph(services, blocks)
const trace = result.trace('ServiceA', 'ServiceD');

trace.services // Set<ServiceName>
trace.paths    // Array<Array<ServiceName>>

Readme

Keywords

none

Package Sidebar

Install

npm i @nio/topic-grapher

Weekly Downloads

2

Version

2.0.0

License

ISC

Unpacked Size

22.6 kB

Total Files

13

Last publish

Collaborators

  • 32bitkid
  • mattdodge
  • deliciousmonster