@kaylum.io/json-graph-ts
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

JSON Graph TS

This is a small TypeScript library for working with json-graph objects in JavaScript/TypeScript.

Features

  • Add nodes and edges
  • disables re-adding existing nodes and edges
  • support for finding nodes according to source/target of edges

Usage

const { JsonGraph } = require("@kaylum.io/json-graph-ts")

const graph = new JsonGraph();

let author = graph.addNode("Stephen King", { "type": "author" })
let book = graph.addNode("The Shining", { "type": "book" })
graph.addEdge(a.id, b.id, "wrote")

console.log(graph.toString())

Package Sidebar

Install

npm i @kaylum.io/json-graph-ts

Weekly Downloads

2

Version

0.2.1

License

MIT

Unpacked Size

735 kB

Total Files

31

Last publish

Collaborators

  • kaylum.io