{"id":16227673,"url":"https://github.com/el3um4s/svelte-get-component-info","last_synced_at":"2025-03-19T13:31:08.236Z","repository":{"id":40621883,"uuid":"427343035","full_name":"el3um4s/svelte-get-component-info","owner":"el3um4s","description":"A function to extract information about the props of a Svelte file. Designed to simplify the creation of documentation","archived":false,"fork":false,"pushed_at":"2023-01-07T13:43:06.000Z","size":736,"stargazers_count":13,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T18:48:22.226Z","etag":null,"topics":["documentation","npm","npm-package","svelte","sveltejs","sveltekit"],"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/el3um4s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["el3um4s"],"patreon":"el3um4s","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.me/el3um4s"]}},"created_at":"2021-11-12T11:55:23.000Z","updated_at":"2023-11-28T20:20:23.000Z","dependencies_parsed_at":"2023-02-07T08:17:03.567Z","dependency_job_id":null,"html_url":"https://github.com/el3um4s/svelte-get-component-info","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el3um4s%2Fsvelte-get-component-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el3um4s%2Fsvelte-get-component-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el3um4s%2Fsvelte-get-component-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el3um4s%2Fsvelte-get-component-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/el3um4s","download_url":"https://codeload.github.com/el3um4s/svelte-get-component-info/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243989730,"owners_count":20379648,"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":["documentation","npm","npm-package","svelte","sveltejs","sveltekit"],"created_at":"2024-10-10T12:53:30.720Z","updated_at":"2025-03-19T13:31:07.890Z","avatar_url":"https://github.com/el3um4s.png","language":"TypeScript","funding_links":["https://github.com/sponsors/el3um4s","https://patreon.com/el3um4s","https://www.paypal.me/el3um4s"],"categories":[],"sub_categories":[],"readme":"# Svelte - Get Component Info\n\n_A function to extract information about the props, actions, slots and css variables from a Svelte file. Designed to simplify the creation of documentation_\n\nNPM link: [@el3um4s/svelte-get-component-info](https://www.npmjs.com/package/@el3um4s/svelte-get-component-info)\n\nI recommend using it with [el3um4s/svelte-component-info](https://github.com/el3um4s/svelte-component-info) (npm: [@el3um4s/svelte-component-info](https://www.npmjs.com/package/@el3um4s/svelte-component-info))\n\n### Install and use the package\n\nTo use the package in a project:\n\n```bash\nnpm i @el3um4s/svelte-get-component-info\n```\n\nand then in a file:\n\n```ts\nimport type { SvelteInformations } from \"@el3um4s/svelte-get-component-info\";\nimport { getInfo } from \"@el3um4s/svelte-get-component-info\";\n\nconst info: SvelteInformations = getInfo(\"./src/lib/hello.svelte\");\nconsole.log(info.props); //  [{ name: \"message\", type: \"string\", defaultValue: \"Hello World\" }]\nconsole.log(info.actions); /// [ { name: \"notify\" }]\n```\n\n`info` looks like this:\n\n```json\n{\n    \"props\": [\n        { \"name\": \"color\", \"type\":\"string\", \"defaultValue\":\"red\" },\n        { \"name\": \"steps\", \"type\":\"number\", \"defaultValue\":\"8\" }\n        { \"name\": \"title\", \"type\":\"string\" },\n        { \"name\": \"description\"}\n    ],\n    \"actions\": [\n        { \"name\": \"click\" },\n        { \"name\": \"hover\" },\n        { \"name\": \"customAction\" }\n    ],\n    \"slots\": [\n        { \"anonymous\": true },\n        { \"name\": \"header\", \"anonymous\": false },\n        { \"name\": \"footer\", \"anonymous\": false }\n    ],\n    \"css\": [\n      { \"name\": \"--color-primary\" },\n      { \"name\": \"--color-secondary\" }\n    ]\n}\n```\n\n### To Do List:\n\n- [x] get props:\n  - [x] name\n  - [x] type\n  - [x] defaultValue\n- [x] actions\n- [x] slots\n  - [x] anonyms\n  - [x] named\n- [x] css variables\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fel3um4s%2Fsvelte-get-component-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fel3um4s%2Fsvelte-get-component-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fel3um4s%2Fsvelte-get-component-info/lists"}