{"id":15837185,"url":"https://github.com/afeiship/next-tree","last_synced_at":"2026-04-29T18:31:38.934Z","repository":{"id":57122882,"uuid":"196173827","full_name":"afeiship/next-tree","owner":"afeiship","description":"Tree data for next.","archived":false,"fork":false,"pushed_at":"2021-08-11T13:19:33.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-17T10:03:01.794Z","etag":null,"topics":["ancestors","descendants","next","tree","tree-view"],"latest_commit_sha":null,"homepage":null,"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/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-10T09:17:46.000Z","updated_at":"2021-08-11T13:19:36.000Z","dependencies_parsed_at":"2022-08-24T14:59:32.454Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/next-tree","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/afeiship/next-tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/next-tree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-tree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32439129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ancestors","descendants","next","tree","tree-view"],"created_at":"2024-10-05T15:21:20.595Z","updated_at":"2026-04-29T18:31:38.915Z","avatar_url":"https://github.com/afeiship.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-tree\n\u003e Tree data for next.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```bash\nnpm install -S @jswork/next-tree\n```\n\n## apis\n| api         | params   | description                 |\n| ----------- | -------- | --------------------------- |\n| children    | callback | Find children only on level |\n| parent      | callback | Find parent only one level  |\n| descendants | callback | Find descendants recursion  |\n| ancestors   | callback | Find ancestors recursion    |\n| find        | callback | -                           |\n| filter      | callback | -                           |\n| search      | callback | -                           |\n| table       | callback | Create table data           |\n\n\n## usage\n```js\nimport NxTree from '@jswork/next-tree';\n\nconst treeData = {\n  label: '空间',\n  value: '/admin/space',\n  children: [\n    {\n      label: '空间-子级1',\n      value: '/admin/space/:id',\n      children: [\n        {\n          label: '空间导出',\n          value: '/admin/space/:id/export'\n        }\n      ]\n    },\n    {\n      label: '空间-子级2',\n      value: '/admin/space2/:id',\n      children: [\n        {\n          label: '空间导出222',\n          value: '/admin/space/:id/expor2222t'\n        }\n      ]\n    }\n  ]\n};\n\nconst item = NxTree.create(treeData).find((_, item) =\u003e item.label === '空间导出222');\nconst data = NxTree.serialize(item);\n\n// results:\n{\n  label: '空间导出222',\n  value: '/admin/space/:id/expor2222t',\n  depth: 2,\n  independent: true\n}\n```\n\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/next-tree/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/next-tree\n[version-url]: https://npmjs.org/package/@jswork/next-tree\n\n[license-image]: https://img.shields.io/npm/l/@jswork/next-tree\n[license-url]: https://github.com/afeiship/next-tree/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-tree\n[size-url]: https://github.com/afeiship/next-tree/blob/master/dist/next-tree.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/next-tree\n[download-url]: https://www.npmjs.com/package/@jswork/next-tree\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Fnext-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-tree/lists"}