
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
comp-parser
Advanced tools
Extract props, actions, slots and css variables from Svelte components. Designed to simplify the creation of documentation.
Extract props, actions, slots and css variables from a Svelte file.
This is a fork is a fork of svelte-get-component-info. Credit to the original author el3um4s for doing all the hard work. I forked this project to add additional features necessary for another library I'm working on and may not align with the original author's vision for this project.
Features added:
You want to document your Svelte components, but you don't want to manually write the documentation for each component. You want to extract the information from the component itself.
This library provides a single function that takes a path to a Svelte file and returns an object with the props, actions, slots and css variables.
At the moment, it only works with local Svelte files, however, it may eventually be extended to work with remote files.
This module is distributed via npm and should be installed as one of your project's dependencies:
npm i comp-parser
pnpm i comp-parser
import { getInfo, type SvelteInformation } from "comp-parser";
const info: SvelteInformation = getInfo("./src/lib/hello.svelte");
info will be an object with the following structure:
{
"props": [
{ "name": "color", "type":"", "defaultValue": "red" },
{ "name": "steps", "type": "number", "defaultValue": "8" }
{ "name": "title", "type": "string" },
{ "name": "variant", "type": "'success' | 'error' | 'warning'", "defaultValue": "success"}
{ "name": "description"}
],
"actions": [
{ "name": "click" },
{ "name": "hover" },
{ "name": "customAction" }
],
"slots": [
{ "anonymous": true },
{ "name": "header", "anonymous": false },
{ "name": "footer", "anonymous": false }
],
"css": [
{ "name": "--color-primary" },
{ "name": "--color-secondary" }
]
}
FAQs
Extract props, actions, slots and css variables from Svelte components. Designed to simplify the creation of documentation.
The npm package comp-parser receives a total of 2 weekly downloads. As such, comp-parser popularity was classified as not popular.
We found that comp-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rustâs crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.