Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries. Maintains compatability with deque.
The denque npm package is a fast double-ended queue implementation. It is optimized for performance and is useful for situations where you need a queue that allows adding or removing items from both ends.
Adding items
This demonstrates how to add items to the queue. 'push' adds an item to the end of the queue, while 'unshift' adds an item to the beginning.
const Denque = require('denque');
let myQueue = new Denque();
myQueue.push('item1');
myQueue.unshift('item0');
Removing items
This shows how to remove items from the queue. 'pop' removes an item from the end of the queue, and 'shift' removes an item from the beginning.
const removedLast = myQueue.pop();
const removedFirst = myQueue.shift();
Peeking at items
This code sample demonstrates how to peek at items in the queue without removing them. 'peekFront' looks at the first item, and 'peekBack' looks at the last item.
const firstItem = myQueue.peekFront();
const lastItem = myQueue.peekBack();
FastQueue is another high-performance queue implementation. It offers similar functionality to Denque but may have different performance characteristics under certain conditions.
This package also provides a double-ended queue implementation. It is similar to Denque in terms of API and functionality but might have slight differences in performance or additional methods.
Denque is a well tested, extremely fast and lightweight double-ended queue implementation with zero dependencies and includes TypeScript types.
Double-ended queues can also be used as a:
This implementation is currently the fastest available, even faster than double-ended-queue
, see the benchmarks.
Every queue operation is done at a constant O(1)
- including random access from .peekAt(index)
.
Works on all node versions >= v0.10
Install the package:
npm install denque
Create and consume a queue:
const Denque = require("denque");
const denque = new Denque([1,2,3,4]);
denque.shift(); // 1
denque.pop(); // 4
See the API reference documentation for more examples.
... and many more.
Built and maintained by Invertase.
1.5.1
FAQs
The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries. Maintains compatability with deque.
The npm package denque receives a total of 7,743,035 weekly downloads. As such, denque popularity was classified as popular.
We found that denque 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 threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.