Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A simple JavaScript implementation of Dijkstra's single-source shortest-paths algorithm.
The dijkstrajs npm package is a JavaScript implementation of Dijkstra's shortest path algorithm. It allows you to find the shortest path between nodes in a graph, which can be useful for various applications such as routing, network analysis, and more.
Find Shortest Path
This feature allows you to find the shortest path between two nodes in a graph. The code sample demonstrates how to define a graph and use the dijkstrajs package to find the shortest path from node 'A' to node 'D'.
const dijkstra = require('dijkstrajs');
const graph = {
A: { B: 1, C: 4 },
B: { A: 1, C: 2, D: 5 },
C: { A: 4, B: 2, D: 1 },
D: { B: 5, C: 1 }
};
const startNode = 'A';
const endNode = 'D';
const shortestPath = dijkstra.find_path(graph, startNode, endNode);
console.log(shortestPath); // Output: [ 'A', 'B', 'C', 'D' ]
Graphlib is a JavaScript library that provides data structures for creating and manipulating graphs, along with algorithms for graph analysis, including Dijkstra's algorithm. It offers more comprehensive graph manipulation capabilities compared to dijkstrajs.
js-graph-algorithms is a library that implements various graph algorithms in JavaScript, including Dijkstra's algorithm. It provides a broader range of graph algorithms and data structures, making it a more versatile choice for complex graph-related tasks.
Graphology is a robust and versatile library for graph theory in JavaScript. It supports a wide range of graph algorithms, including Dijkstra's algorithm, and offers extensive features for graph manipulation and analysis. It is more feature-rich compared to dijkstrajs.
dijkstrajs is a simple JavaScript implementation of Dijkstra's single-source shortest-paths algorithm.
The code was originally written by Wyatt Baldwin and turned into a node module by Thomas Cort.
npm install dijkstrajs
See test/dijkstra.test.js
in the sources for some example code.
FAQs
A simple JavaScript implementation of Dijkstra's single-source shortest-paths algorithm.
The npm package dijkstrajs receives a total of 2,301,633 weekly downloads. As such, dijkstrajs popularity was classified as popular.
We found that dijkstrajs 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.