{"id":28545132,"url":"https://github.com/moxystudio/js-deep-for-each","last_synced_at":"2025-12-12T04:23:37.601Z","repository":{"id":55655988,"uuid":"48759254","full_name":"moxystudio/js-deep-for-each","owner":"moxystudio","description":"Recursively iterates over collections arrays and objects","archived":false,"fork":false,"pushed_at":"2020-12-15T15:15:57.000Z","size":778,"stargazers_count":35,"open_issues_count":1,"forks_count":6,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-06-17T09:02:27.300Z","etag":null,"topics":["array","collection","deep","for-each","iterate","object"],"latest_commit_sha":null,"homepage":"","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/moxystudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-29T17:33:24.000Z","updated_at":"2023-01-03T02:08:47.000Z","dependencies_parsed_at":"2022-08-15T05:40:47.804Z","dependency_job_id":null,"html_url":"https://github.com/moxystudio/js-deep-for-each","commit_stats":null,"previous_names":["indigounited/js-deep-for-each"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/moxystudio/js-deep-for-each","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Fjs-deep-for-each","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Fjs-deep-for-each/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Fjs-deep-for-each/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Fjs-deep-for-each/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moxystudio","download_url":"https://codeload.github.com/moxystudio/js-deep-for-each/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Fjs-deep-for-each/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262406038,"owners_count":23306064,"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":["array","collection","deep","for-each","iterate","object"],"created_at":"2025-06-09T23:06:39.863Z","updated_at":"2025-12-12T04:23:37.568Z","avatar_url":"https://github.com/moxystudio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deep-for-each\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]\n\n[npm-url]:https://npmjs.org/package/deep-for-each\n[downloads-image]:https://img.shields.io/npm/dm/deep-for-each.svg\n[npm-image]:https://img.shields.io/npm/v/deep-for-each.svg\n[travis-url]:https://travis-ci.org/moxystudio/js-deep-for-each\n[travis-image]:https://img.shields.io/travis/moxystudio/js-deep-for-each/master.svg\n[codecov-url]:https://codecov.io/gh/moxystudio/js-deep-for-each\n[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/js-deep-for-each/master.svg\n[david-dm-url]:https://david-dm.org/moxystudio/js-deep-for-each\n[david-dm-image]:https://img.shields.io/david/moxystudio/js-deep-for-each.svg\n[david-dm-dev-url]:https://david-dm.org/moxystudio/js-deep-for-each?type=dev\n[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/js-deep-for-each.svg\n\nRecursively iterates over arrays and objects. The iteration is made using a [deep-first](https://en.wikipedia.org/wiki/Depth-first_search) algorithm.\n\n\n## Installation\n\n```sh\n$ npm install deep-for-each\n```\n\nThis library is written in modern JavaScript and is published in both CommonJS and ES module transpiled variants. If you target older browsers please make sure to transpile accordingly.\n\n\n## Usage\n\n```js\nimport deepForEach from 'deep-for-each';\n\ndeepForEach({\n    prop1: 'foo',\n    prop2: ['foo', 'bar'],\n    prop3: ['foo', 'foo'],\n    prop4: {\n        prop5: 'foo',\n        prop6: 'bar',\n    },\n}, (value, key, subject, path) =\u003e {\n    // `value` is the current property value\n    // `key` is the current property name\n    // `subject` is either an array or an object\n    // `path` is the iteration path, e.g.: 'prop2[0]' and 'prop4.prop5'\n\n    console.log(`${path}:`, value);\n});\n```\n\nRunning the example above will print:\n\n```\nprop1: foo\nprop2: [ 'foo', 'bar' ]\nprop2[0]: foo\nprop2[1]: bar\nprop3: [ 'foo', 'foo' ]\nprop3[0]: foo\nprop3[1]: foo\nprop4: { prop5: 'foo', prop6: 'bar' }\nprop4.prop5: foo\nprop4.prop6: bar\n```\n\n\n## Tests\n\n```sh\n$ npm test\n$ npm test -- --watch # during development\n```\n\n\n## License\n\nReleased under the [MIT License](https://www.opensource.org/licenses/mit-license.php).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoxystudio%2Fjs-deep-for-each","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoxystudio%2Fjs-deep-for-each","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoxystudio%2Fjs-deep-for-each/lists"}