{"id":15844531,"url":"https://github.com/afeiship/with-props","last_synced_at":"2026-04-02T16:44:12.402Z","repository":{"id":96088521,"uuid":"147623670","full_name":"afeiship/with-props","owner":"afeiship","description":"Enhance component with preset properties.","archived":false,"fork":false,"pushed_at":"2026-03-26T14:49:06.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-27T05:43:05.692Z","etag":null,"topics":["default-props","presets","properties","react","with-props"],"latest_commit_sha":null,"homepage":"","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/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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-09-06T05:45:06.000Z","updated_at":"2026-03-26T14:50:27.000Z","dependencies_parsed_at":"2023-04-21T01:29:24.739Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/with-props","commit_stats":null,"previous_names":["afeiship/with-props"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/afeiship/with-props","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fwith-props","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fwith-props/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fwith-props/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fwith-props/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/with-props/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fwith-props/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31310453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"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":["default-props","presets","properties","react","with-props"],"created_at":"2024-10-05T17:23:09.180Z","updated_at":"2026-04-02T16:44:12.395Z","avatar_url":"https://github.com/afeiship.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# with-props\n\u003e Enhance component with preset properties.\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```shell\nnpm install @jswork/with-props\n```\n\n## usage\n\n```tsx\nimport withProps from '@jswork/with-props';\nimport React from 'react';\n\ninterface ButtonProps {\n  text: string;\n  color?: string;\n  size?: 'small' | 'medium' | 'large';\n}\n\nconst Button: React.FC\u003cButtonProps\u003e = ({ text, color = 'blue', size = 'medium' }) =\u003e {\n  return (\n    \u003cbutton style={{ color, fontSize: size === 'small' ? '12px' : size === 'large' ? '20px' : '16px' }}\u003e\n      {text}\n    \u003c/button\u003e\n  );\n};\n\n// Create a component with default props\nconst PrimaryButton = withProps(Button, {\n  color: 'red',\n  size: 'large'\n});\n\nconst App: React.FC = () =\u003e {\n  return (\n    \u003cdiv\u003e\n      {/* Uses default props */}\n      \u003cPrimaryButton text=\"Click me\" /\u003e\n\n      {/* Override default props */}\n      \u003cPrimaryButton text=\"Cancel\" color=\"gray\" /\u003e\n    \u003c/div\u003e\n  );\n};\n```\n\n### Features\n\n- **Type Safe**: Full TypeScript support with proper type inference\n- **Props Merging**: Default props are overridden by provided props\n- **Simple API**: Just pass component and default props\n- **Zero Dependencies**: Lightweight and focused\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/with-props/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/with-props\n[version-url]: https://npmjs.org/package/@jswork/with-props\n\n[license-image]: https://img.shields.io/npm/l/@jswork/with-props\n[license-url]: https://github.com/afeiship/with-props/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/with-props\n[size-url]: https://github.com/afeiship/with-props/blob/master/dist/index.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/with-props\n[download-url]: https://www.npmjs.com/package/@jswork/with-props\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fwith-props","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Fwith-props","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fwith-props/lists"}