Gathering detailed insights and metrics for eachr
Gathering detailed insights and metrics for eachr
Gathering detailed insights and metrics for eachr
Gathering detailed insights and metrics for eachr
Deprecated: Use `for ( const [key, value] of Object.entries(thing) )`
npm install eachr
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (74.77%)
JavaScript (25.23%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
6 Stars
209 Commits
1 Forks
2 Watchers
1 Branches
5 Contributors
Updated on Oct 12, 2024
Latest Version
7.4.0
Package Id
eachr@7.4.0
Unpacked Size
47.68 kB
Size
12.47 kB
File Count
18
NPM Version
10.2.3
Node Version
20.10.0
Published on
Dec 28, 2023
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
2
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.
Eachr accepts an array, object, or map. The iterator is bound to the list, and receives three arguments: the value, key, and list.
1// Prepare 2const eachr = require('eachr') 3const arr = ['first', 'second', 'third'] 4const obj = { a: 'first', b: 'second', c: 'third' } 5const map = new Map([ 6 ['a', 'first'], 7 ['b', 'second'], 8 ['c', 'third'], 9]) 10function iterator(value, key) { 11 console.log({ value: value, key: key }) 12 if (value === 'second') { 13 console.log('break') 14 return false 15 } 16} 17 18// Cycle Array 19eachr(arr, iterator) 20// {'value': 'first', 'key': 0} 21// {'value': 'second', 'key': 1} 22// break 23 24// Cycle Object 25eachr(obj, iterator) 26// {'value': 'first', 'key': 'a'} 27// {'value': 'second', 'key': 'b'} 28// break 29 30// Cycle Map 31eachr(map, iterator) 32// {'value': 'first', 'key': 'a'} 33// {'value': 'second', 'key': 'b'} 34// break
npm install --save eachr
import pkg from ('eachr')
const pkg = require('eachr').default
1import pkg from 'https://unpkg.com/eachr@^7.4.0/edition-deno/index.ts'
1<script type="module"> 2 import pkg from '//cdn.skypack.dev/eachr@^7.4.0' 3</script>
1<script type="module"> 2 import pkg from '//unpkg.com/eachr@^7.4.0' 3</script>
1<script type="module"> 2 import pkg from '//dev.jspm.io/eachr@7.4.0' 3</script>
This package is published with the following editions:
eachr
aliases eachr/index.cjs
which uses the Editions Autoloader to automatically select the correct edition for the consumer's environmenteachr/source/index.ts
is TypeScript source code with Import for moduleseachr/edition-browsers/index.js
is TypeScript compiled against ES2022 for web browsers with Import for moduleseachr/edition-es2022/index.js
is TypeScript compiled against ES2022 for Node.js 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for moduleseachr/edition-es5/index.js
is TypeScript compiled against ES5 for Node.js 4 || 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for moduleseachr/edition-es2022-esm/index.js
is TypeScript compiled against ES2022 for Node.js 12 || 14 || 16 || 18 || 20 || 21 with Import for moduleseachr/edition-types/index.d.ts
is TypeScript compiled Types with Import for moduleseachr/edition-deno/index.ts
is TypeScript source code made to be compatible with DenoDiscover the release history by heading on over to the HISTORY.md
file.
Discover how to contribute via the CONTRIBUTING.md
file.
Unless stated otherwise all works are:
and licensed under:
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
6 existing vulnerabilities detected
Details
Reason
Found 0/23 approved changesets -- score normalized to 0
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
detected GitHub workflow tokens with excessive permissions
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 2025-07-07
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