
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
Create a new instance of a Graph.
Set a vertex (create or update) with an id and a type.
g.setVertex('foo', 'Person', {name: 'Foo Bar', age: 23});
Get a vertex by its id.
g.vertex('foo').name === 'Foo Bar';
Check if a vertex exists by its id.
g.hasVertex('foo') === true;
Remove a vertex by its id and all of its edges.
Returns all of the discarded edges.
g.removeVertex('foo');
Ensure an edge of type type from vertex origin to vertex target.
g.setEdge('foo', 'bar', 'friendOf');
Get the type edge from origin to target if exists, null otherwise.
g.edge('foo', 'bar', 'friendOf').type === 'friends';
g.edge('foo', 'bar', 'father') === null;
Check if a type edge from origin to target exists.
g.hasEdge('foo', 'bar', 'friendOf') === true;
Remove a type edge from origin to target.
g.removeEdge('foo', 'bar', 'friendOf');
Get all edges to target, all edges from origin, all edges from origin to target, all edges involving vertexId - respectively.
An iterator over all the graph's vertices.
Serialize and de-serialize the graph
'use strict';
const Graph = require('graph-core');
const g = new Graph();
g.setVertex('foo', 'Person', {name: 'Foo Bar', age: 23});
g.setVertex('bar', 'Person', {name: 'Bar Bar', age: 22});
g.setEdge('foo', 'bar', 'friendOf');
g.outEdges('foo')
.filter(({type}) => type === 'friendsOf')
.map(({target}) => g.vertex(target).age); // [22]
FAQs
A powerful and flexible graph structure for JS
We found that graph-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.