{"id":19419672,"url":"https://github.com/rwu823/react-addons-text-content","last_synced_at":"2025-07-27T19:08:52.482Z","repository":{"id":8919905,"uuid":"60236472","full_name":"rwu823/react-addons-text-content","owner":"rwu823","description":"Like DOM API `Node.textContent`","archived":false,"fork":false,"pushed_at":"2023-12-15T20:34:12.000Z","size":6,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T22:03:47.630Z","etag":null,"topics":["addons","content","react","text"],"latest_commit_sha":null,"homepage":"https://github.com/rwu823/react-addons-text-content","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rwu823.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06-02T05:55:19.000Z","updated_at":"2021-08-26T06:33:38.000Z","dependencies_parsed_at":"2024-06-18T17:07:06.906Z","dependency_job_id":"4171a95b-1d0b-4126-904b-bd01f48e165e","html_url":"https://github.com/rwu823/react-addons-text-content","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"a98b9787a7a0b9ebd3bd9f3b6d452988d53e5244"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwu823%2Freact-addons-text-content","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwu823%2Freact-addons-text-content/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwu823%2Freact-addons-text-content/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwu823%2Freact-addons-text-content/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwu823","download_url":"https://codeload.github.com/rwu823/react-addons-text-content/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250643459,"owners_count":21464180,"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":["addons","content","react","text"],"created_at":"2024-11-10T13:18:37.085Z","updated_at":"2025-04-24T14:31:53.949Z","avatar_url":"https://github.com/rwu823.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![version](https://img.shields.io/npm/v/react-addons-text-content.svg?label=version)](https://www.npmjs.org/package/react-addons-text-content) [![Build Status](https://img.shields.io/travis/rwu823/react-addons-text-content.svg?branch=master)](https://travis-ci.org/rwu823/react-addons-text-content/) [![Coverage](https://img.shields.io/coveralls/rwu823/react-addons-text-content.svg)](https://coveralls.io/github/rwu823/react-addons-text-content)\n\n# react-addons-text-content\n\nLike DOM API's `Node.textContent` and it works in React Element\n\n## Install\n\n```sh\n$ npm install --save react-addons-text-content\n```\n\n\n\n## Usage\n\n```javascript\nimport textContent from 'react-addons-text-content'\n \nrender() {\n  const {children} = this.props\n  const text = textContent(children)\n  \n  return (...)\n}\n```\n\n\n\n## Examples\n\n```javascript\ntest('should be got text `Hello World`', assert =\u003e {\n  const Com =\n      \u003cdiv\u003e\n        \u003ch1\u003eHello\u003c/h1\u003e World\n      \u003c/div\u003e\n\n  assert.is(textContent(Com), `Hello World`)\n})\n```\n\n```javascript\ntest('array children', assert =\u003e {\n  const Com = (\n    \u003cdiv\u003e\n      \u003ch1\u003eHello\u003c/h1\u003e World\n      {\n        ['a', \u003ch2\u003eb\u003c/h2\u003e]\n      }\n    \u003c/div\u003e\n  )\n  \n  assert.is(textContent(Com), `Hello Worldab`)\n})\n```\n\n```javascript\ntest('array component', assert =\u003e {\n  const Com = (\n    [\n      \u003ch1\u003ea\u003c/h1\u003e, 'b', 'c',\n      \u003cdiv\u003e\n        \u003ch2\u003ex\u003c/h2\u003ey\n      \u003c/div\u003e\n    ]\n  )\n\n  assert.is(textContent(Com), `abcxy`)\n})\n```\n\n\n\n## API\n\n### textContent([React Element])","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwu823%2Freact-addons-text-content","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwu823%2Freact-addons-text-content","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwu823%2Freact-addons-text-content/lists"}