Gathering detailed insights and metrics for extra-iterable
Gathering detailed insights and metrics for extra-iterable
Gathering detailed insights and metrics for extra-iterable
Gathering detailed insights and metrics for extra-iterable
npm install extra-iterable
Typescript
Module System
Node Version
NPM Version
78.1
Supply Chain
99.5
Quality
78.7
Maintenance
100
Vulnerability
100
License
TypeScript (94.06%)
JavaScript (5.94%)
Total Downloads
678,980
Last Day
18
Last Week
680
Last Month
4,303
Last Year
64,124
MIT License
5 Stars
322 Commits
1 Forks
2 Watchers
2 Branches
1 Contributors
Updated on Apr 08, 2025
Minified
Minified + Gzipped
Latest Version
3.3.2
Package Id
extra-iterable@3.3.2
Unpacked Size
127.47 kB
Size
23.11 kB
File Count
6
NPM Version
10.9.2
Node Version
22.14.0
Published on
Apr 08, 2025
Cumulative downloads
Total Downloads
Last Day
100%
18
Compared to previous day
Last Week
-1.9%
680
Compared to previous week
Last Month
-34.5%
4,303
Compared to previous month
Last Year
-69.8%
64,124
Compared to previous year
An iterable is a sequence of values.
📦 Node.js,
🌐 Web,
📜 Files,
📰 Docs,
📘 Wiki.
This is a collection of functions for operating upon iterables. Assumption here is that an iterable can only be iterated over once. Methods which require multiple iterations preserve old values in a backup array using toMany. Many methods accept both compare and map functions, and in some cases using only a map function enables faster comparision (like unique). I borrowed a lot of ideas from Haskell, Elm, Python, Basic, Lodash, and other NPM packages. These are mentioned in references of each method.
This package is available in Node.js and Web formats. To use it on the web,
simply use the extra_iterable
global variable after loading with a <script>
tag from the jsDelivr CDN.
Stability: Experimental.
1const xiterable = require('extra-iterable'); 2// import * as xiterable from "extra-iterable"; 3// import * as xiterable from "https://unpkg.com/extra-iterable/index.mjs"; (deno) 4 5var x = [2, 4, 6, 8]; 6xiterable.get(x, 1); 7// → 4 8 9var x = [1, 2, 3, 4]; 10[...xiterable.swap(x, 0, 1)]; 11// → [ 2, 1, 3, 4 ] 12 13var x = [1, 2, 3]; 14[...xiterable.cycle(x, 0, 4)]; 15// → [1, 2, 3, 1] 16 17var x = [1, 2, 3, 4]; 18xiterable.reduce(x, (acc, v) => acc+v); 19// → 10
Property | Description |
---|---|
is | Check if value is an iterable. |
isIterator | Check if value is an iterator. |
isList | Check if value is a list (iterable & !string). |
iterator | Get iterator of an iterable. |
keys | List all indices. |
values | List all values. |
entries | List all index-value pairs. |
from | Convert an iterable-like to iterable. |
fromIterator | Convert an iterator to iterable. |
fromRange | Generate iterable from given number range. |
fromInvocation | Generate iterable from repeated function invocation. |
fromApplication | Generate iterable from repeated function application. |
isOnce | Check if an iterable can iterated only once. |
isMany | Check if an iterable can be iterated many times. |
toMany | Convert a once-like iterable to many. |
toInvokable | Generate a function that iterates over values upon invocation. |
isEmpty | Check if an iterable is empty. |
length | Find the length of an iterable. |
compare | Compare two iterables. |
isEqual | Check if two iterables are equal. |
index | Get zero-based index for element in iterable. |
indexRange | Get index range for part of iterable. |
get | Get value at index. |
getAll | Get values at indices. |
getPath | Get value at path in a nested iterable. |
hasPath | Check if nested iterable has a path. |
set | Set value at index. |
swap | Exchange two values. |
remove | Remove value at index. |
count | Count values which satisfy a test. |
countAs | Count occurrences of values. |
min | Find smallest value. |
max | Find largest value. |
range | Find smallest and largest values. |
minEntry | Find smallest entry. |
maxEntry | Find largest entry. |
rangeEntries | Find smallest and largest entries. |
slice | Get part of an iterable. |
head | Get first value. |
last | Get last value. |
tail | Get values except first. |
init | Get values except last. |
left | Get values from left. |
right | Get values from right. |
middle | Get values from middle. |
take | Keep first n values only. |
takeRight | Keep last n values only. |
takeWhile | Keep values from left, while a test passes. |
takeWhileRight | Keep values from right, while a test passes. |
drop | Discard first n values only. |
dropRight | Discard last n values only. |
dropWhile | Discard values from left, while a test passes. |
dropWhileRight | Discard values from right, while a test passes. |
includes | Check if iterable has a value. |
indexOf | Find first index of a value. |
lastIndexOf | Find last index of a value. |
find | Find first value passing a test. |
findRight | Find last value passing a test. |
scanWhile | Scan from left, while a test passes. |
scanWhileRight | Scan from right, while a test passes. |
scanUntil | Scan from left, until a test passes. |
scanUntilRight | Scan from right, until a test passes. |
search | Find index of first value passing a test. |
searchRight | Find index of last value passing a test. |
searchAll | Find indices of values passing a test. |
searchValue | Find first index of a value. |
searchValueRight | Find last index of a value. |
searchValueAll | Find indices of a value. |
searchInfix | Find first index of an infix. |
searchInfixRight | Find last index of an infix. |
searchInfixAll | Find indices of an infix. |
searchSubsequence | Find first index of a subsequence. |
hasValue | Check if iterable has a value. |
hasPrefix | Check if iterable starts with a prefix. |
hasSuffix | Check if iterable ends with a suffix. |
hasInfix | Check if iterable contains an infix. |
hasSubsequence | Check if iterable has a subsequence. |
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 an iterable. |
reduce | Reduce values of iterable to a single value. |
filter | Keep the values which pass a test. |
filterAt | Keep the values at given indices. |
reject | Discard the values which pass a test. |
rejectAt | Discard the values at given indices. |
accumulate | Produce accumulating values. |
flat | Flatten nested iterable to given depth. |
flatMap | Flatten nested iterable, based on map function. |
zip | Combine values from iterables. |
fill | Fill with given value. |
push | Add values to the end. |
unshift | Add values to the start. |
copy | Copy part of iterable to another. |
copyWithin | Copy part of iterable within. |
moveWithin | Move part of iterable within. |
splice | Remove or replaces existing values. |
split | Break iterable considering test as separator. |
splitAt | Break iterable considering indices as separator. |
cut | Break iterable when test passes. |
cutRight | Break iterable after test passes. |
cutAt | Break iterable at given indices. |
cutAtRight | Break iterable after given indices. |
group | Keep similar values together and in order. |
partition | Segregate values by test result. |
partitionAs | Segregate values by similarity. |
chunk | Break iterable into chunks of given size. |
cycle | Obtain values that cycle through an iterable. |
repeat | Repeat an iterable given times. |
reverse | Reverse the values. |
rotate | Rotate values in iterable. |
intersperse | Place a separator between every value. |
interpolate | Estimate new values between existing ones. |
intermix | Place values of an iterable between another. |
interleave | Place values from iterables alternately. |
concat | Append values from iterables. |
merge | Merge values from sorted iterables. |
join | Join values together into a string. |
isUnique | Check if there are no duplicate values. |
isDisjoint | Checks if arrays have no value in common. |
unique | Remove duplicate values. |
union | Obtain values present in any iterable. |
intersection | Obtain values present in both iterables. |
difference | Obtain values not present in another iterable. |
symmetricDifference | Obtain values not present in both iterables. |
cartesianProduct | List cartesian product of iterables. |
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
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