{"id":27944933,"url":"https://github.com/es-shims/iterator-helpers","last_synced_at":"2025-10-18T06:27:40.997Z","repository":{"id":65700216,"uuid":"573205267","full_name":"es-shims/iterator-helpers","owner":"es-shims","description":"An ESnext spec-compliant iterator helpers shim/polyfill/replacement that works as far down as ES3.","archived":false,"fork":false,"pushed_at":"2025-02-12T00:49:42.000Z","size":338,"stargazers_count":17,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T12:55:06.340Z","etag":null,"topics":["asynciterator","drop","ecmascript","es-shims","every","filter","find","flatmap","foreach","from","iterator","javascript","map","polyfill","reduce","some","take","toarray","toasync"],"latest_commit_sha":null,"homepage":"https://tc39.es/proposal-iterator-helpers/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/es-shims.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ljharb"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"npm/es5-shim","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2022-12-01T23:28:53.000Z","updated_at":"2025-03-26T11:40:42.000Z","dependencies_parsed_at":"2024-03-15T00:26:13.339Z","dependency_job_id":"810116f6-74fb-4020-80b7-ef789c8a475b","html_url":"https://github.com/es-shims/iterator-helpers","commit_stats":{"total_commits":104,"total_committers":3,"mean_commits":"34.666666666666664","dds":"0.019230769230769273","last_synced_commit":"1a70fd33ab81738ad2b748812a431d51e0c4d758"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2Fiterator-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2Fiterator-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2Fiterator-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2Fiterator-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/es-shims","download_url":"https://codeload.github.com/es-shims/iterator-helpers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252882788,"owners_count":21819154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asynciterator","drop","ecmascript","es-shims","every","filter","find","flatmap","foreach","from","iterator","javascript","map","polyfill","reduce","some","take","toarray","toasync"],"created_at":"2025-05-07T12:55:14.796Z","updated_at":"2025-10-18T06:27:40.902Z","avatar_url":"https://github.com/es-shims.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ljharb","https://tidelift.com/funding/github/npm/es5-shim"],"categories":[],"sub_categories":[],"readme":"# es-iterator-helpers \u003csup\u003e[![Version Badge][npm-version-svg]][package-url]\u003c/sup\u003e\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nAn ESnext spec-compliant sync iterator helpers shim/polyfill/replacement that works as far down as ES3.\n\nThis package implements the [es-shim API](https://github.com/es-shims/api) “multi” interface. It works in an ES3-supported environment and complies with the [iterator helpers spec](https://tc39.es/proposal-iterator-helpers/) and the [iterator sequencing spec](https://tc39.es/proposal-iterator-sequencing/).\n\nBecause the `Iterator.prototype` methods depend on a receiver (the `this` value), the main export in each subdirectory takes the iterator to operate on as the first argument.\n\nThe main export of the package itself is simply an array of the available directory names. It’s sole intended use is for build tooling and testing.\n\n## Supported things\n\n - [`Iterator` constructor](https://tc39.es/proposal-iterator-helpers/#sec-iterator-constructor)\n - [`Iterator.prototype`](https://tc39.es/proposal-iterator-helpers/#sec-iterator.prototype)\n - [`Iterator.concat`](https://tc39.es/proposal-iterator-sequencing/)\n - [`Iterator.from`](https://tc39.es/proposal-iterator-helpers/#sec-iterator.from)\n - [`Iterator.zip`](https://tc39.es/proposal-joint-iteration/#sec-iterator.zip)\n - [`Iterator.zipKeyed`](https://tc39.es/proposal-joint-iteration/#sec-iterator.zipkeyed)\n - [`Iterator.prototype.constructor`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.constructor)\n - [`Iterator.prototype.drop`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.drop)\n - [`Iterator.prototype.every`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.every)\n - [`Iterator.prototype.filter`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.filter)\n - [`Iterator.prototype.find`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.find)\n - [`Iterator.prototype.flatMap`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.flatmap)\n - [`Iterator.prototype.forEach`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.foreach)\n - [`Iterator.prototype.map`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.map)\n - [`Iterator.prototype.reduce`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.reduce)\n - [`Iterator.prototype.some`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.some)\n - [`Iterator.prototype.take`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.take)\n - [`Iterator.prototype.toArray`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.toarray)\n\n## Environments where this is needed\n\n - node v22, Chrome \u003e= v122: has a [bug](https://issues.chromium.org/issues/336839115)\n - node \u003c v22, Chrome \u003c v122, Safari \u003c= v17.1, Firefox \u003c= v125: not implemented\n - all environments lack Iterator.concat, Iterator.zip, Iterator.zipKeyed\n\n## Getting started\n\n```sh\nnpm install --save es-iterator-helpers\n```\n\n## Usage/Examples\n\nUsing explicit imports:\n\n```js\nconst map = require('es-iterator-helpers/Iterator.prototype.map');\nconst toArray = require('es-iterator-helpers/Iterator.prototype.toArray');\nconst assert = require('assert');\n\nconst iterator = [1, 2, 3].values();\n\nconst mapped = map(iterator, (x) =\u003e x + 10);\nassert.deepEqual(\n\tmapped.next(),\n    {\n        done: false,\n        value: 11,\n    }\n);\nassert.deepEqual(\n    toArray(mapped),\n    [12, 13]\n);\n```\n\nShim using `require`:\n\n```js\nrequire('es-iterator-helpers/auto'); // shim all of the methods\n\nrequire('es-iterator-helpers/Iterator.prototype.map/auto'); // shim the “map” method\n```\n\nShim using `import` syntax:\n\n[](#preventEval)\n```js\nimport 'es-iterator-helpers/auto'; // shim all of the methods\n\nimport 'es-iterator-helpers/Iterator.prototype.map/auto'; // shim the “map” method\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/es-iterator-helpers\n[npm-version-svg]: https://versionbadg.es/es-shims/iterator-helpers.svg\n[deps-svg]: https://david-dm.org/es-shims/iterator-helpers.svg\n[deps-url]: https://david-dm.org/es-shims/iterator-helpers\n[dev-deps-svg]: https://david-dm.org/es-shims/iterator-helpers/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/iterator-helpers#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/es-iterator-helpers.png?downloads=true\u0026stars=true\n[license-image]: https://img.shields.io/npm/l/es-iterator-helpers.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/es-iterator-helpers.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=es-iterator-helpers\n[codecov-image]: https://codecov.io/gh/es-shims/iterator-helpers/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/iterator-helpers/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/iterator-helpers\n[actions-url]: https://github.com/es-shims/iterator-helpers/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fes-shims%2Fiterator-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fes-shims%2Fiterator-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fes-shims%2Fiterator-helpers/lists"}