
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
double-linked-list-dot-js
Advanced tools
Efficient and useful implementation of the double linked list structure
Efficient and useful implementation of the double linked list structure
yarn add double-linked-list-dot-js # if you use yarn
npm install --save double-linked-list-dot-js # if you use npm
// Basic usage example
import {DoubleLinkedList, Node} from 'double-linked-list-dot-js';
let list = new DoubleLinkedList();
let head = new Node(2);
list.setHead(head);
console.log(list);
/* DoubleLinkedList {
head: Node { value: 2, prev: null, next: null },
tail: Node { value: 2, prev: null, next: null }
}
} */
list.insertAtPosition(2, new Node(5));
list.insertAtPosition(3, new Node(6));
list.insertAtPosition(4, new Node(7));
list.insertAtPosition(5, new Node(9));
console.log(list);
/*
DoubleLinkedList {
head: <ref *1> Node {
value: 2,
prev: null,
next: Node { value: 5, prev: [Circular *1], next: [Node] }
},
tail: <ref *2> Node {
value: 9,
prev: Node { value: 7, prev: [Node], next: [Circular *2] },
next: null
}*/
console.log(list.containsValue(2)); //true
console.log(list.containsValue(5)); //true
console.log(list.containsValue(6)); //true
console.log(list.containsValue(7)); //true
console.log(list.containsValue(9)); //true
//remove node by reference
list.removeNode(head);
console.log(list);
/*DoubleLinkedList {
head: <ref *1> Node {
value: 5,
prev: null,
next: Node { value: 6, prev: [Circular *1], next: [Node] }
},
tail: <ref *2> Node {
value: 9,
prev: Node { value: 7, prev: [Node], next: [Circular *2] },
next: null
}
}*/
//remove node by value
list.removeNodeWithValue(7);
console.log(list);
/*DoubleLinkedList {
head: <ref *1> Node {
value: 5,
prev: null,
next: Node { value: 6, prev: [Circular *1], next: [Node] }
},
tail: <ref *2> Node {
value: 9,
prev: Node { value: 6, prev: [Node], next: [Circular *2] },
next: null
}
}*/
FAQs
Efficient and useful implementation of the double linked list structure
The npm package double-linked-list-dot-js receives a total of 2 weekly downloads. As such, double-linked-list-dot-js popularity was classified as not popular.
We found that double-linked-list-dot-js 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
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.