
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
Minimalistic in-memory graph for metadata management. Allows to create directions graphs to store entities and connect them. Connections, called "edges" may also contain data.
Just run npm i nanograph.
Types for Typescript are provided and must not be installed separately.
import { Nanograph } from 'nanograph';
const nano: Nanograph = new Nanograph();
const { _id: vertex1Id, error: error1 } = nano.createVertex('PERSON', { name: 'John Doe' });
const { _id: vertex2Id, error: error2 } = nano.createVertex('PERSON', { name: 'Jane Doe' });
const { _id: friendshipId } = nano.createEdge('FRIENDSHIP', vertex1Id, vertex2Id, {
type: 'platonic', since: Date.now(),
});
Retrieve the first edge matching provided criteria. If an ID is given, it can simply be passed as string.
const vertex = nano.findVertices('PERSON', vertex1Id ).getFirst();
const edge = nano.findEdges('FRIENDSHIP', { _id: { equals: friendshipId } }).getFirst();
For filtering, instead of an id, parameters can be provided. For this version, only equals is possible. Result of getAll is a list of vertices or edges
const vertex = nano.findVertices('PERSON', { name: { equals: 'John Doe' } }).getAll();
const edges = nano.findEdges('FRIENDSHIP', { type: { equals: 'platonic' } }).getAll();
Traversal is also possible using labels and properties to filter
const vertices = nano
.findVertices('PERSON', { name: { equals: 'John Doe' } }) // a person called John Doe
.over('CHILDOF').to('PERSON') // searching for John Does Parents
.over('CHILDOF').to('PERSON', { gender: { equals: 'm' } }) // searching for their father, John Doe's grandfather
.over('MARRIED').to('PERSON') // searching for his wife, John Doe's grandmother
.getAll();
Both edges and vertices can be updated using update methods. Old values will be kept. If a value to update is already exiting, it will be overwritten.
nano.updateVertex(vertexId, { weight: 6000, hasFur: false });
nano.updateEdge(edgeId, { isShareHolder: true, holdings: 15 });
Vertices and edges can be deleted by their id.
nano.deleteEdge(edgeId);
nano.deleteVertex(vertexid);
FAQs
minimalistic in-memory graph for metadata management
The npm package nanograph receives a total of 9 weekly downloads. As such, nanograph popularity was classified as not popular.
We found that nanograph 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.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.