@devneko/graph-ts
TypeScript icon, indicating that this package has built-in type declarations

0.1.8 • Public • Published

graph-ts

in-memory graph database written in typescript.

Features

  • Basic graph structure inspired by Gremlin.
  • Gremlin like graph traversal.
  • Topological Sort
  • Decomposition of SCC

Example

const g: Graph = new Graph();
const v1 = g.addVertex('people', {
  name: 'Bob',
});
const v2 = g.addVertex('people', {
  name: 'Alice',
});
const v3 = g.addVertex('item', {
  name: 'Pencil',
});
g.addEdge('knows', v1, v2);
g.addEdge('has', v1, v3);

// returns vertices that have 'people' label.
g.V().hasLabel('people').toArray();
// returns the item that Bob has.
g.V(v1).out('has').toArray();

Readme

Keywords

none

Package Sidebar

Install

npm i @devneko/graph-ts

Weekly Downloads

4

Version

0.1.8

License

MIT

Unpacked Size

157 kB

Total Files

47

Last publish

Collaborators

  • devneko