sveld weekly downloads statistics
By carbon-design-system · npm · Vite plugins
Generate TypeScript definitions and component documentation for your Svelte components.
sveld has 7,570 recorded weekly downloads on npm, a decrease of 25.9% over the past 30 days, ranking #1376 of 3,247 tracked listings.
About sveld
sveld
Generate TypeScript definitions and component documentation for your Svelte components.
sveld reads your components' props, events, slots, snippets and context, and the JSDoc where inference isn't enough, and writes .d.ts files your users' editors type-check against, plus JSON and Markdown docs from the same pass. It's for JavaScript-first libraries; one built with svelte-package already gets .d.ts files from svelte2tsx. A type it can't pin down falls back to any, and --strict says where. Carbon Components Svelte generates its types and API docs with it.
<!-- src/Button.svelte -->
<script>
/** @type {"button" | "submit" | "reset"} */
export let type = "button";
/** Set to `true` to use the primary variant */
export let primary = false;
</script>
<button {...$$restProps} {type} class:primary on:click>
<slot>Click me</slot>
</button>
// types/Button.svelte.d.ts, from `npx sveld` (imports left out)
type $RestProps = SvelteHTMLElements["button"];
type $Props = {
/**
* @default "button"
*/
type?: "button" | "submit" | "reset";
/**
* Set to `true` to use the primary variant
* @default false
*/
primary?: boolean;
children?: (this: void) => void;
[key: `data-${string}`]: unknown;
};
export type ButtonProps = Omit<$RestProps, keyof $Props> & $Props;
export default class Button extends SvelteComponentTyped<
ButtonProps,
{ click: WindowEventMap["click"] },
{ default: Record<string, never> }
> {}
An API change fails CI before it ships. Commit COMPONENT_API.json, and --check diffs each run against it:
$ npx sveld --check
sveld --check: 2 API changes detected against "COMPONENT_API.json".
Suggested semver bump: major.
Button
[BREAKING] prop "label" added (required)
[BREAKING] prop "primary" removed
It runs on Node 22 or later, or Bun, and parses Svelte 3, 4 and 5, runes included.
Quick start
npm i -D sveld
{
"svelte": "./src/index.js"
}
npx sveld # writes types/*.d.ts for what src/index.js exports
Exit status: 0 when done, 1 when the run found problems, 2 when it was called wrong or couldn't finish.
Common tasks
# Write the JSON and Markdown docs too
npx sveld --json --markdown
# Fail CI on a breaking API change against COMPONENT_API.json
npx sveld --check
# Fail CI where a prop fell back to `any` or a tag was dropped
npx sveld --strict
# Every .svelte file under the entry's directory, not just its exports
npx sveld --glob
# Svelte 5's `Component` type instead of a class
npx sveld --types-format=component
# Check the @example blocks against your TypeScript program
npx sveld --check-examples
With --format=json, the --check report and an exit-2 error print as JSON on stdout, each with a schemaVersion. The same options go in a sveld.config.js, or to the Vite plugin: sveld({ json: true }) in vite.config.ts.
From code
import { sveld } from "sveld";
const { document, diagnostics, exitCode, failures } = await sveld({
entry: "./src/index.js",
json: true,
});
document.components; // the same document `json: true` writes
Docs
- Options: every option and flag, the config file, the Vite plugin,
sveld(),sveld/browser, and requirements - JSDoc tags: how types are inferred, and every tag sveld reads
- Output: a worked example,
.d.tsformats, JSON and its schema, Markdown, and custom output - CI: exit codes,
--check,--strictand diagnostic codes, and@examplechecks - Troubleshooting: common problems, and the fix for each
- Playground: try it in the browser
Description from the npm listing.
- svelte
- svelte component
- documentation
- docgen
- typescript
- definitions
- JSDocs
- vite
- vite-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Vite plugins plugins
All 20 sveld alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/sveld. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.