Gathering detailed insights and metrics for array-iterate
Gathering detailed insights and metrics for array-iterate
Gathering detailed insights and metrics for array-iterate
Gathering detailed insights and metrics for array-iterate
iterate-value
Iterate any iterable JS value. Works robustly in all environments, all versions.
async-each
No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach / map function for JavaScript.
deep-for-each
Recursively iterates over arrays and objects
eachr
Give eachr an item to iterate (array, object or map) and an iterator, then in return eachr gives iterator the value and key of each item, and will stop if the iterator returned false.
`Array#forEach()` but it’s possible to define where to move to next
npm install array-iterate
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
7 Stars
78 Commits
3 Forks
3 Watchers
1 Branches
3 Contributors
Updated on Apr 02, 2024
Latest Version
2.0.1
Package Id
array-iterate@2.0.1
Unpacked Size
10.68 kB
Size
4.06 kB
File Count
7
NPM Version
8.1.0
Node Version
17.0.1
Published on
Oct 27, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Array#forEach()
but it’s possible to define where to move to next.
A tiny package that works just like forEach
, with one small difference.
You can use this if for some weird reason—like I did—you have to sometimes skip a few places ahead or backwards when moving through an array.
This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm:
1npm install array-iterate
In Deno with Skypack:
1import {arrayIterate} from 'https://cdn.skypack.dev/array-iterate@2?dts'
In browsers with Skypack:
1<script type="module"> 2 import {arrayIterate} from 'https://cdn.skypack.dev/array-iterate@2?min' 3</script>
1import {arrayIterate} from 'array-iterate' 2 3let first = true 4 5arrayIterate( 6 [1, 2, 3, 4], 7 (value, index, values) => { 8 console.log(this, value, index, values) 9 10 // Repeat once. 11 if (first && index + 1 === values.length) { 12 first = false 13 return 0 14 } 15 }, 16 {hello: 'world'} 17)
Yields:
1{hello: 'world'}, 1, 0, [1, 2, 3, 4] 2{hello: 'world'}, 2, 1, [1, 2, 3, 4] 3{hello: 'world'}, 3, 2, [1, 2, 3, 4] 4{hello: 'world'}, 4, 3, [1, 2, 3, 4] 5{hello: 'world'}, 1, 0, [1, 2, 3, 4] 6{hello: 'world'}, 2, 1, [1, 2, 3, 4] 7{hello: 'world'}, 3, 2, [1, 2, 3, 4] 8{hello: 'world'}, 4, 3, [1, 2, 3, 4]
This package exports the following identifiers: arrayIterate
.
There is no default export.
arrayIterate(values, callbackFn[, thisArg])
Perform the specified action for each element in an array (just like
Array#forEach()
).
When callbackFn
returns a number
, moves to the element at that index
next.
values
(Array<*>
)
— values to iterate overcallbackFn
(Function
)
— function called for each element, can return the index
to move to nextthisArg
(*
, optional)
— optional object assigned as this
in callbackFn
undefined
.
function callbackFn(value, index, values)
Callback given to iterate
.
this
(*
)
— context object when given as thisArg
to arrayIterate
or undefined
value
(*
)
— element in arrayindex
(number
)
— index of value
in values
values
(Array.<*>
)
— listnumber
or undefined
— the index
to move to next.
This package is fully typed with TypeScript.
There is also a CallbackFn
type export that represents the callback function.
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 12.20+, 14.14+, and 16.0+. It also works in Deno and modern browsers.
This package is safe, assuming that you don’t create an infinite loop by keeping on repeating.
Yes please! See How to Contribute to Open Source.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
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
Project has not signed or included provenance with any releases.
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 2025-06-30
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