Gathering detailed insights and metrics for queue-lit
Gathering detailed insights and metrics for queue-lit
Gathering detailed insights and metrics for queue-lit
Gathering detailed insights and metrics for queue-lit
queue-lit is a tiny queue data structure in case you `Array#push()` or `Array#shift()` on large arrays very often.
npm install queue-lit
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
2 Stars
62 Commits
3 Watching
1 Branches
1 Contributors
Updated on 15 May 2024
TypeScript (72.64%)
Shell (25.42%)
JavaScript (1.94%)
Cumulative downloads
Total Downloads
Last day
-5.4%
114,532
Compared to previous day
Last week
2.4%
658,393
Compared to previous week
Last month
8.5%
2,740,365
Compared to previous month
Last year
102.7%
25,193,839
Compared to previous year
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)
.
1$ npm i queue-lit 2# or 3$ yarn add queue-lit
1import { Queue } from 'queue-lit'; 2 3const queue = new Queue(); 4 5queue.push('Hello'); 6queue.push('World'); 7 8console.log(queue.size); 9// => 2 10 11console.log(...queue); 12// => 'Hello World' 13 14console.log(queue.pop()); 15//=> 'Hello' 16 17console.log(queue.pop()); 18//=> '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
1$ npm i
(2) Run initial validation
1$ ./Taskfile.sh validate
(3) Start developing. See ./Taskfile.sh
for more tasks to
help you develop.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
7 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More