Gathering detailed insights and metrics for extra-lists
Gathering detailed insights and metrics for extra-lists
Gathering detailed insights and metrics for extra-lists
Gathering detailed insights and metrics for extra-lists
npm install extra-lists
Typescript
Module System
Node Version
NPM Version
75.1
Supply Chain
99.4
Quality
76.2
Maintenance
100
Vulnerability
100
License
TypeScript (90.05%)
JavaScript (9.95%)
Total Downloads
34,737
Last Day
1
Last Week
3
Last Month
46
Last Year
3,775
MIT License
146 Commits
2 Watchers
2 Branches
1 Contributors
Updated on Apr 08, 2025
Minified
Minified + Gzipped
Latest Version
4.0.8
Package Id
extra-lists@4.0.8
Unpacked Size
78.46 kB
Size
15.92 kB
File Count
6
NPM Version
9.5.0
Node Version
18.15.0
Published on
Apr 14, 2023
Cumulative downloads
Total Downloads
Last Day
-50%
1
Compared to previous day
Last Week
-75%
3
Compared to previous week
Last Month
-85.7%
46
Compared to previous month
Last Year
10.3%
3,775
Compared to previous year
A collection of functions for operating upon Lists.
📦 Node.js,
🌐 Web,
📜 Files,
📰 Docs,
📘 Wiki.
Lists is a pair of key list and value list, with unique keys. It is an an
alternative to Entries. Unless entries are implemented as structs by v8,
lists should be more space efficient. This package includes common functions
related to querying about lists, generating them, comparing one with
another, finding their size, adding and removing entries, obtaining
its properties, getting a part of it, getting a subset entries in
it, finding an entry in it, performing functional operations,
manipulating it in various ways, combining together lists or its
sub-entries, of performing set operations upon it. All functions except
fromEntries()
take lists as 1st parameter.
This package is available in Node.js and Web formats. To use it on the web,
simply use the extra_lists
global variable after loading with a <script>
tag from the jsDelivr CDN.
Stability: Experimental.
1const xlists = require('extra-lists'); 2// import * as xlists from 'extra-lists'; 3// import * as xlists from 'https://unpkg.com/extra-lists/index.mjs'; (deno) 4 5var x = [['a', 'b', 'c', 'd', 'e'], [1, 2, 3, 4, 5]]; 6xlists.filter(x, v => v % 2 === 1); 7// → [ [ 'a', 'c', 'e' ], [ 1, 3, 5 ] ] 8 9var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]]; 10xlists.some(x, v => v > 10); 11// → false 12 13var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]]; 14xlists.min(x); 15// → -4 16 17var x = [['a', 'b', 'c'], [1, 2, 3]]; 18[...xlists.subsets(x)].map(a => [[...a[0]], [...a[1]]]); 19// → [ 20// → [ [], [] ], 21// → [ [ 'a' ], [ 1 ] ], 22// → [ [ 'b' ], [ 2 ] ], 23// → [ [ 'a', 'b' ], [ 1, 2 ] ], 24// → [ [ 'c' ], [ 3 ] ], 25// → [ [ 'a', 'c' ], [ 1, 3 ] ], 26// → [ [ 'b', 'c' ], [ 2, 3 ] ], 27// → [ [ 'a', 'b', 'c' ], [ 1, 2, 3 ] ] 28// → ]
Property | Description |
---|---|
is | Check if value is lists. |
keys | List all keys. |
values | List all values. |
entries | List all key-value pairs. |
fromEntries | Convert lists to entries. |
size | Find the size of lists. |
isEmpty | Check if lists is empty. |
compare | Compare two lists. |
isEqual | Check if two lists are equal. |
get | Get value at key. |
getAll | Gets values at keys. |
getPath | Get value at path in nested lists. |
hasPath | Check if nested lists has a path. |
set | Set value at key. |
swap | Exchange two values. |
remove | Remove value at key. |
head | Get first entry from lists (default order). |
tail | Get lists without its first entry (default order). |
take | Keep first n entries only (default order). |
drop | Remove first n entries (default order). |
count | Count values which satisfy a test. |
countAs | Count occurrences of values. |
min | Find smallest value. |
minEntry | Find smallest entry. |
max | Find largest value. |
maxEntry | Find largest entry. |
range | Find smallest and largest values. |
rangeEntries | Find smallest and largest entries. |
subsets | List all possible subsets. |
randomKey | Pick an arbitrary key. |
randomValue | Pick an arbitrary value. |
randomEntry | Pick an arbitrary entry. |
randomSubset | Pick an arbitrary subset. |
has | Check if lists has a key. |
hasValue | Check if lists has a value. |
hasEntry | Check if lists has an entry. |
hasSubset | Check if lists has a subset. |
find | Find first value passing a test (default order). |
findAll | Find values passing a test. |
search | Finds key of an entry passing a test. |
searchAll | Find keys of entries passing a test. |
searchValue | Find a key with given value. |
searchValueAll | Find keys with given value. |
forEach | Call a function for each value. |
some | Check if any value satisfies a test. |
every | Check if all values satisfy a test. |
map | Transform values of entries. |
reduce | Reduce values of entries to a single value. |
filter | Keep entries which pass a test. |
filterAt | Keep entries with given keys. |
reject | Discard entries which pass a test. |
rejectAt | Discard entries with given keys. |
flat | Flatten nested lists to given depth. |
flatMap | Flatten nested lists, based on map function. |
zip | Combine matching entries from all lists. |
partition | Segregate values by test result. |
partitionAs | Segregate entries by similarity. |
chunk | Break lists into chunks of given size. |
concat | Append entries from all lists, preferring last. |
join | Join lists together into a string. |
isDisjoint | Check if lists have no common keys. |
unionKeys | Obtain keys present in any lists. |
union | Obtain entries present in any lists. |
intersection | Obtain entries present in both lists. |
difference | Obtain entries not present in another lists. |
symmetricDifference | Obtain entries not present in both lists. |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
6 existing vulnerabilities detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
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
Score
Last Scanned on 2025-06-09
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