
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
graphology-components
Advanced tools
Connected components for graphology
.
npm install graphology-components
Iterates over the connected components of the given graph using a callback.
import {forEachConnectedComponent} from 'graphology-components';
forEachConnectedComponent(graph, component => {
console.log(component);
});
Specialized version of forEachConnectedComponent that iterates over the connected component orders, i.e. the number of nodes they contain.
It consumes less memory than a naive approach mapping the component lengths using forEachConnectedComponent
.
import {forEachConnectedComponentOrder} from 'graphology-components';
forEachConnectedComponentOrder(graph, order => {
console.log(order);
});
Returns the number of connected components of the given graph.
import {countConnectedComponents} from 'graphology-components';
const count = countConnectedComponents(graph);
Returns the list of connected components of the given graph.
import {connectedComponents} from 'graphology-components';
const components = connectedComponents(graph);
If your graph is mixed or directed, the result will be what are usually called weakly connected components.
Returns the largest connected component of the given graph.
import {largestConnectedComponent} from 'graphology-components';
const largest = largestConnectedComponent(graph);
Returns a subgraph of the largest connected component of the given graph.
import {largestConnectedComponentSubgraph} from 'graphology-components';
const subgraph = largestConnectedComponentSubgraph(graph);
Mutates the given graph to remove nodes and edges that are not part of its largest connected component.
import {cropToLargestConnectedComponent} from 'graphology-components';
cropToLargestConnectedComponent(graph);
Returns the list of strongly connected components of the given graph. (mixed or directed)
import {stronglyConnectedComponents} from 'graphology-components';
const components = stronglyConnectedComponents(graph);
FAQs
Connected components for graphology.
The npm package graphology-components receives a total of 27,446 weekly downloads. As such, graphology-components popularity was classified as popular.
We found that graphology-components 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.