npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sveltekit-generator

v2.0.7

Published

Inspired by Laravel (php artisan make:)

Readme

SvelteKit Generator

SvelteKit Generator is a powerful CLI tool inspired by Laravel Artisan (php artisan make:). It simplifies the process of generating routes, components, server functions, API endpoints, and layouts in your SvelteKit projects. With sveltekit-generator, you can save time and focus on building your application.


Features

  • Generate Routes: Automatically creates +page.svelte and +page.server.ts files in the src/routes/ directory.
  • Dynamic Route Parameters: Supports creating dynamic routes parameter (e.g., /user/[id], store/[storeId]).
  • Custom Dynamic Parameters: Allows you to specify custom dynamic parameters (e.g., --dynamic userId or using the -d flag).
  • Component Generator: Easily create Svelte components inside route directories.
  • API Endpoint Generator: Automatically generates +server.ts files for API endpoints.
  • Layout Generator: Quickly create layout files (+layout.svelte and +layout.server.ts) for consistent page structures.
  • Route Name Validation: Ensures route names only contain letters, numbers, and hyphens.
  • Route Store Validation and Creation: Validates and creates stores automatically (e.g., src/lib/stores).
  • Ready-to-Use Templates: Provides pre-built file templates for quick setup.

Installation

Install sveltekit-generator using your preferred package manager:

Using npm

npm i sveltekit-generator

Using pnpm

pnpm i sveltekit-generator

Using bun

bun install i sveltekit-generator

After installation, you can can put this command in your package.json file to use it globally:

"scripts": {
    "generate": "sveltekit-generator"
}

Usage

Generate a Basic Route:

pnpm generate route <route_name>

Generate / Custom a Dynamic Route existing

pnpm generate route <route_name> -d <param_name>

Generate a Component Inside a Route

pnpm generate component <route_name> <component_name>

Generate / Custom a Component Inside a Dynamic Route existing

pnpm generate component <route_name> -d <param_name> <component_name>

Generate routes in spesific directory

pnpm generate route ('(folder_name)/<route_name>')

Generate dynamic routes in spesific directory

pnpm generate route ('(folder_name)/<route_name>') --dynamic <param_name>

generate API endpoint

pnpm generate api <api_name>

Generate a Dynamic API endpoint

pnpm generate api <api_name> -d <param_name>

Generate a Layout

pnpm generate layout <layout_name>

Generate a Store (type: writable, readable, derived)

pnpm generate store <store_name>

Generate a Store with a different type

pnpm generate store <store_name> -t readable
pnpm generate store <store_name> -t derived
pnpm generate store <store_name> -t writable

Generate a store in spesific path

pnpm generate store <store_name> -p <path>

Why Use SvelteKit Generator?

  • Save Time: Automates repetitive tasks like creating routes, components, API endpoints, and layouts.
  • Consistency: Ensures a consistent project structure.
  • Easy to Use: Simple commands for generating files.
  • Customizable: Supports dynamic routes and custom parameters.

Contributing

If you'd like to contribute to this project, feel free to open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE.md file for details.