Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
js-data-structure
Advanced tools
JavaScript data structure implemented in ES6. This library covers the implementation of the basic data structures, including graph(Breath-first Search, Depth-first search), binary search tree, queue, and some sorting (Quick Sort, Merge Sort) and search algorithm for array.
The code here is rewriting from Learning JavaScript Data Structures and Algorithms to es6 with some enhancements on performance, and added the unit tests for each of the data structure.
npm install;
npm test;
npm run commit;
// Graph
import { Graph } from 'js-data-structure';
const graph = new Graph();
graph.addVertex('A');
graph.addVertex('B');
graph.addVertex('C');
graph.addVertex('D');
graph.addVertex('E');
graph.addVertex('F');
graph.addVertex('G');
graph.addVertex('H');
graph.addVertex('I');
graph.addEdge('A', 'B');
graph.addEdge('A', 'C');
graph.addEdge('B', 'D');
graph.addEdge('C', 'F');
graph.addEdge('D', 'E');
graph.addEdge('E', 'G');
graph.addEdge('E', 'I');
graph.addEdge('F', 'E');
graph.addEdge('G', 'H');
graph.addEdge('H', 'I');
/*
************************
Graph generated
************************
A -> B
| |
\/ \/
C D
| |
\/ \/
F -> E -> G
| |
\/ \/
I <- H
************************
*/
// get the shortest path
const shortestPath = graph.getShortestPath('A', 'I');
console.log(shortestPath) // ['A', 'B', 'D', 'E', 'I']
import { Sorting } from 'js-data-structure';
console.log(Sorting.bubbleSort([5, 4, 3, 2, 1]));
MIT © Sky Chen
FAQs
JavaScript Data Structure
We found that js-data-structure 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 malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.