Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
js-data-structures
Advanced tools
A collection of data structures written in JavaScript.
Detailed information on the complexity of each data structure is located here. To learn more about how some of the data structures are implemented, check out the technical articles on Growing with the Web.
npm install --save js-data-structures
var AvlTree = require('js-data-structures').AvlTree;
var BinaryHeap = require('js-data-structures').BinaryHeap;
var BinarySearchTree = require('js-data-structures').BinarySearchTree;
var BinomialHeap = require('js-data-structures').BinomialHeap;
var FibonacciHeap = require('js-data-structures').FibonacciHeap;
var RedBlackTree = require('js-data-structures').RedBlackTree;
var SplayTree = require('js-data-structures').SplayTree;
See the source files and dependencies
in package.json for a list of public interfaces on each data structure, here is an example for the Fibonacci heap.
var heap = new FibonacciHeap();
heap.insert(3);
heap.insert(7);
heap.insert(8);
heap.insert(1);
heap.insert(2);
while (!heap.isEmpty()) {
console.log(heap.extractMinimum());
}
I'd love to get some contributions for other data structures, if you want to make a pull request try to follow the existing style of the code and make sure you add tests for the new data structure.
npm install
npm test
# generate coverage report in ./coverage/
grunt coverage
MIT © Daniel Imms
FAQs
A collection of data structures
The npm package js-data-structures receives a total of 3 weekly downloads. As such, js-data-structures popularity was classified as not popular.
We found that js-data-structures 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.