{"id":13422499,"url":"https://github.com/fernandopasik/react-children-utilities","last_synced_at":"2025-04-13T08:56:40.471Z","repository":{"id":13046310,"uuid":"70021728","full_name":"fernandopasik/react-children-utilities","owner":"fernandopasik","description":"Extended utils for ⚛️  React.Children data structure that adds recursive filter, map and more methods to iterate nested children.","archived":false,"fork":false,"pushed_at":"2025-04-04T15:53:43.000Z","size":5791,"stargazers_count":374,"open_issues_count":1,"forks_count":24,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-06T05:07:59.116Z","etag":null,"topics":["react","react-library","reactjs"],"latest_commit_sha":null,"homepage":"https://fernandopasik.com/react-children-utilities","language":"TypeScript","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/fernandopasik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"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}},"created_at":"2016-10-05T01:45:33.000Z","updated_at":"2025-04-04T15:53:46.000Z","dependencies_parsed_at":"2023-01-13T17:16:16.989Z","dependency_job_id":"1ea459d0-3a24-436d-8c95-408bfa7b445a","html_url":"https://github.com/fernandopasik/react-children-utilities","commit_stats":{"total_commits":1314,"total_committers":9,"mean_commits":146.0,"dds":"0.34550989345509897","last_synced_commit":"a53fe54319f9aa2d782d8ecb3125978556c2c2ce"},"previous_names":[],"tags_count":101,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandopasik%2Freact-children-utilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandopasik%2Freact-children-utilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandopasik%2Freact-children-utilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandopasik%2Freact-children-utilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fernandopasik","download_url":"https://codeload.github.com/fernandopasik/react-children-utilities/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688544,"owners_count":21145764,"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":["react","react-library","reactjs"],"created_at":"2024-07-30T23:00:46.261Z","updated_at":"2025-04-13T08:56:40.446Z","avatar_url":"https://github.com/fernandopasik.png","language":"TypeScript","funding_links":[],"categories":["Utilities","TypeScript"],"sub_categories":["Miscellaneous"],"readme":"# React Children Utilities\n\nExtended utils for ⚛️ React.Children data structure that adds recursive filter, map and more methods to iterate nested children.\n\n\u003c!-- BADGES - START --\u003e\n\n[![Gzip Bundle Size](https://img.badgesize.io/https://unpkg.com/react-children-utilities/react-children-utilities.min.js?compression=gzip)](https://unpkg.com/react-children-utilities/react-children-utilities.min.js 'Gzip Bundle Size')\n[![Build Status](https://github.com/fernandopasik/react-children-utilities/actions/workflows/main.yml/badge.svg)](https://github.com/fernandopasik/react-children-utilities/actions/workflows/main.yml 'Build Status')\n[![Coverage Status](https://codecov.io/gh/fernandopasik/react-children-utilities/branch/main/graph/badge.svg)](https://codecov.io/gh/fernandopasik/react-children-utilities 'Coverage Status')\n[![Known Vulnerabilities](https://snyk.io/test/github/fernandopasik/react-children-utilities/badge.svg?targetFile=package.json)](https://snyk.io/test/github/fernandopasik/react-children-utilities?targetFile=package.json 'Known Vulnerabilities')\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors)\n[![npm version](https://img.shields.io/npm/v/react-children-utilities.svg?logo=npm)](https://www.npmjs.com/package/react-children-utilities 'npm version')\n[![npm downloads](https://img.shields.io/npm/dm/react-children-utilities.svg)](https://www.npmjs.com/package/react-children-utilities 'npm downloads')\n\n\u003c!-- BADGES - END --\u003e\n\n## Installation\n\nCan be added to your application after installing the peer dependency `react`\n\n```sh\nnpm install --save react-children-utilities\n```\n\n## Usage\n\nThis package extends the existing React.Children utilities, you can import it as a whole.\n\n```jsx\nimport React from 'react';\nimport Children from 'react-children-utilities';\n\nconst MyComponent = ({ children }) =\u003e {\n  const onlySpans = Children.filter(children, (child) =\u003e child.type === 'span');\n  return \u003cdiv\u003e{onlySpans}\u003c/div\u003e;\n};\n```\n\nAlso you can import only the function you need\n\n```jsx\nimport React from 'react';\nimport { filter } from 'react-children-utilities';\n\nconst MyComponent = ({ children }) =\u003e {\n  const onlySpans = filter(children, (child) =\u003e child.type === 'span');\n  return \u003cdiv\u003e{onlySpans}\u003c/div\u003e;\n};\n```\n\n## API documentation\n\n- [deepFilter](/docs/deep-filter.md)\n- [deepFind](/docs/deep-find.md)\n- [deepForEach](/docs/deep-foreach.md)\n- [deepMap](/docs/deep-map.md)\n- [filter](/docs/filter.md)\n- [getElementName](/docs/get-element-name.md)\n- [groupByType](/docs/group-by-type.md)\n- [hasChildren](/docs/has-children.md)\n- [hasComplexChildren](/docs/has-complex-children.md)\n- [onlyText](/docs/only-text.md)\n- [onlyValid](/docs/only-valid.md)\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://fernandopasik.com\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/1301335?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFernando Pasik\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/fernandopasik/react-children-utilities/issues?q=author%3Afernandopasik\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/fernandopasik/react-children-utilities/commits?author=fernandopasik\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/fernandopasik/react-children-utilities/commits?author=fernandopasik\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#ideas-fernandopasik\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/mrm007\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/3297808?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003emrm007\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/fernandopasik/react-children-utilities/issues?q=author%3Amrm007\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/fernandopasik/react-children-utilities/commits?author=mrm007\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/vasilevich\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/1217224?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eyosef langer\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/fernandopasik/react-children-utilities/issues?q=author%3Avasilevich\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/fernandopasik/react-children-utilities/commits?author=vasilevich\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/iyegoroff\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/4447438?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eiyegoroff\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/fernandopasik/react-children-utilities/issues?q=author%3Aiyegoroff\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/fernandopasik/react-children-utilities/commits?author=iyegoroff\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://vydia.com\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/4197823?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMark Allen\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/fernandopasik/react-children-utilities/issues?q=author%3ATSMMark\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/fernandopasik/react-children-utilities/commits?author=TSMMark\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://medium.com/@riywo\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/37822?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRyosuke IWANAGA\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/fernandopasik/react-children-utilities/issues?q=author%3Ariywo\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/fernandopasik/react-children-utilities/commits?author=riywo\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.linkedin.com/in/dpinol/\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/1954955?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDaniel Pinyol\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/fernandopasik/react-children-utilities/issues?q=author%3Adpinol\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/fernandopasik/react-children-utilities/commits?author=dpinol\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://brianbartholomew.com\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/6721622?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBrian Bartholomew\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/fernandopasik/react-children-utilities/issues?q=author%3Abcbrian\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/fernandopasik/react-children-utilities/commits?author=bcbrian\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## License\n\nMIT (c) 2016 [Fernando Pasik](https://fernandopasik.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandopasik%2Freact-children-utilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffernandopasik%2Freact-children-utilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandopasik%2Freact-children-utilities/lists"}