1.5.2 • Published 2 years ago

sveltegen v1.5.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

sveltegen

A simple, easy to use CLI for creating Svelte/SvelteKit components, actions, and routes, quickly and conveniently.

Now with 0 dependencies!

*Find me on NPM!*

Features

  • Simple and easy generation of:
    • Components
    • Routes/Endpoints
    • Actions
  • Sveltegen handles file structure for you

Installation

Note: only run Sveltegen at your project root directory.

Install globally (recommended):

npm install -g sveltegen

...or use npx to skip the install

npx sveltegen

Commands

commanddescription
configallows you to change the path to your output folders
helpshows all available commands
actionalias: amakes a new action
componentalias: cmakes a new component
route alias: rmakes a new route

Command Options

Below is a table of what commands have what options.

TypeScriptSCSSEndpointPage
action:white_check_mark::x::x::x:
component:white_check_mark::white_check_mark::x::x:
route:white_check_mark::white_check_mark::white_check_mark::white_check_mark:

Don't want to use TypeScript / SCSS? Don't worry, just don't put any -t -s flags! Sveltegen will create .css and .js files, as well as properly format your .svelte files, if you opt-out of either of them.

Usage

sveltegen <command> [options]

For example, to create a new component named Button with SCSS and Typescript:

sveltegen component Button -t -s

// you can use the shorthand format too!

sveltegen c Button -t -s

File Output

Components:

[name].svelte
index.ts       // or index.js if not using Typescript
index.scss     // or index.css if not using SCSS

Routes:

[name]/index.svelte    // optional
[name]/index.json.ts   // optional ; or index.json.js if not using Typescript

Actions:

[name].ts     // or [name].js if not using Typescript

Thanks for checking out Sveltegen!

1.4.6

2 years ago

1.4.5

2 years ago

1.4.4

2 years ago

1.5.2

2 years ago

1.4.3

2 years ago

1.5.1

2 years ago

1.4.2

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.4.9

2 years ago

1.4.85

2 years ago

1.4.8

2 years ago

1.4.7

2 years ago

1.3.1

2 years ago

1.3.0

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago