@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>>

/@nio/topic-grapher/

    Package Sidebar

    Install

    npm i @nio/topic-grapher

    Weekly Downloads

    0

    Version

    2.0.0

    License

    ISC

    Unpacked Size

    22.6 kB

    Total Files

    13

    Last publish

    Collaborators

    • 32bitkid
    • mattdodge
    • deliciousmonster