
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
avl-tree-rust
Advanced tools
avl-tree-rust is a high-performance native AVL tree library for Node.js, written in Rust and exposed through N-API. This library offers efficient self-balancing tree operations such as insertion, removal, search, and in-order traversal. It supports keys and values as integers and strings, providing flexibility and fast performance.
Note: This library is designed for Node.js environments only and has not been tested in browsers.
Platform Compatibility: The library is primarily built and tested on Linux environments. While it should work on other platforms, compatibility is not guaranteed. If you encounter issues, you can try building from source using
npm run build.
To use avl-tree-rust, you need the following:
Node.js (v12 or higher recommended)
For building from source:
build-essential package on Ubuntu/Debian)To install the library via npm:
npm install avl-tree-rust
If you need to build from source, follow these steps:
git clone https://github.com/psht13/avl-tree.git
cd avl-tree
npm install
npm run build
Here’s an example demonstrating how to use avl-tree-rust in your Node.js project:
// Import the AVL tree class from the package
const AvlTree = require('avl-tree-rust');
// OR using ES Modules
import AvlTree from 'avl-tree-rust';
// Create a new AVL tree instance
const tree = new AvlTree();
// Insert nodes with keys and values
tree.insert(10, 'ten');
tree.insert(5, 'five');
tree.insert(15, 'fifteen');
// Check if a key exists in the tree
if (tree.has(10)) {
console.log('Key 10 exists in the tree');
}
// Search for a node by its key
const result = tree.find(10);
if (result !== null) {
console.log('Found:', result);
} else {
console.log('Not found');
}
// Remove a node by key
const removed = tree.remove(5);
if (removed !== null) {
console.log('Removed:', removed);
} else {
console.log('Key not found for removal');
}
// Dump the tree (in-order traversal) to view all nodes
console.log('Tree dump:', tree.dump());
// Example output:
// "{ key: 10, value: 'ten' }, { key: 15, value: 'fifteen' }"
insert(key: i32, value: String): Inserts a node with the given key and value. If a node with the same key exists, its value is updated.find(key: i32): Searches for a node by its key. Returns the value if found, or null if the key does not exist in the tree.remove(key: i32): Removes a node by its key. Returns the value of the removed node if successful, or null if the key does not exist.has(key: i32): Checks if a node with the given key exists in the tree. Returns true if the key is present, false otherwise.dump(): Returns a string representation of all nodes in the tree, sorted by key. This is done using in-order traversal.The AVL tree implementation for:
MIT License
Pavlo Yurchenko pashtet.gm@gmail.com
FAQs
High-performance native AVL tree library for Node.js.
We found that avl-tree-rust demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.