Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
resolved-graph
Advanced tools
Generates and updates a graph of nodes and links with resolved relationships for ease of traversal and extraction
This is a tiny package that takes a more or less standard graph and make its entities directly accesible (and iterable with standard methods) through memory, like so:
import { Graph } from "resolved-graph"
const graph: Graph = {
nodes: [
{
id: "Tommy ",
},
{
id: "Viktoria ",
}
],
links: [
{
id: "is in love with ",
from: "Tommy ",
to: "Viktoria "
},
{
id: "is head over heels for ",
from: "Viktoria ",
to: "Tommy "
}
]
}
Now, lets resolve it:
import { Graph, ResolvedGraph } from "resolved-graph"
...
const resolvedGraph = new ResolvedGraph(graph)
...And try it out for size:
...
for (const node of resolvedGraph.nodes) {
for (const link of node.from) {
const nextNode = link.to
console.log(node.id + link.id + nextNode.id)
}
}
Expected output:
Tommy is in love with Viktoria
Viktoria is head over heels for Tommy
As long as you use the standard methods found on the ResolvedGraph class, it should keep up with all resolutions for you. You can chuck in whatever properties you like on the nodes & links, as long as you stay away from 'id', 'to' and 'from'. The dissolve() method breaks the circular references and makes it safe for JSON. No checks are made on other properties so that's up to you. GLHF! <3
FAQs
Generates and updates a graph of nodes and links with resolved relationships for ease of traversal and extraction
The npm package resolved-graph receives a total of 1 weekly downloads. As such, resolved-graph popularity was classified as not popular.
We found that resolved-graph 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.