
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
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" }
]
}
0.0.6
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 0 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
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.