@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
nonePackage Sidebar
Install
Weekly Downloads