
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.
linked-deque
Advanced tools
A deque (double-ended queue) provides fast pushing and popping from both sides of the data structure.
This implementation is a simple deque built off of a doubly linked list.
The Symbol.iterator method is defined to allow for the use of a for ... of loop on the deque.
Additionally, there is a length property used to access the current size of the deque in O(1) time.
All methods will have the time complexity listed in their documentation.
npm install --save linked-deque
import Deque from "linked-deque";
const deque = new Deque([1, 2, 3]); // ( 1 ) -> ( 2 ) -> ( 3 ) -> null
deque.popLeft(); // ( 2 ) -> ( 3 ) -> null
deque.pushLeft(5); // ( 5 ) -> ( 2 ) -> ( 3 ) -> null
deque.length; // 3
deque.rotate(); // ( 3 ) -> ( 5 ) -> ( 2 ) -> null
deque.insertAt("foo", 1); // ( 3 ) -> ( "foo" ) -> ( 5 ) -> ( 2 ) -> null
deque.removeAt(2); // ( 3 ) -> ( "foo" ) -> ( 2 ) -> null
deque.reverse(); // ( 2 ) -> ( "foo" ) -> ( 3 ) -> null
deque.push(7); // ( 2 ) -> ( "foo" ) -> ( 3 ) -> ( 7 ) -> null
// you can use for ... of loops
for (let element of deque) {
// do something
}
deque.clear(); // null
deque.length; // 0
FAQs
A simple double-ended queue.
The npm package linked-deque receives a total of 3 weekly downloads. As such, linked-deque popularity was classified as not popular.
We found that linked-deque demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.