Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
queue-lit is a tiny queue data structure in case you `Array#push()` or `Array#shift()` on large arrays very often
This package is a tiny queue data structure in case you Array#push()
or
Array#shift()
on large arrays very often.
Array#shift()
has linear time complexity O(n)
while Queue#push()
has
constant time complexity O(1)
.
$ npm i queue-lit
# or
$ yarn add queue-lit
import { Queue } from 'queue-lit';
const queue = new Queue();
queue.push('Hello');
queue.push('World');
console.log(queue.size);
// => 2
console.log(...queue);
// => 'Hello World'
console.log(queue.pop());
//=> 'Hello'
console.log(queue.pop());
//=> 'World'
queue = new Queue()
The instance is an Iterable
, which means you can iterate over the queue
front to back with a for...of
loop, or use spreading to convert the queue to
an array.
.push(value)
Adds one element to the end of the queue and returns the new length of
the queue.
This method changes the size of the queue.
.pop()
Pop removes the last element from the queue and returns that element.
This method changes the size of the queue.
Returns undefined
if the queue is empty.
.clear()
Clears the queue and removes all elements.
This method changes the size of the queue.
.size
Static method that returns the size of the queue.
(1) Install dependencies
$ npm i
(2) Run initial validation
$ ./Taskfile.sh validate
(3) Start developing. See ./Taskfile.sh
for more tasks to
help you develop.
FAQs
queue-lit is a tiny queue data structure in case you `Array#push()` or `Array#shift()` on large arrays very often
The npm package queue-lit receives a total of 588,544 weekly downloads. As such, queue-lit popularity was classified as popular.
We found that queue-lit 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.