# generator-svalter

> Generator to help you create and manage svelte/sapper application

Latest version **1.2.0** (published 2020-09-18) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install generator-svalter
pnpm add generator-svalter
yarn add generator-svalter
bun add generator-svalter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2020-09-18 |
| First published | 2020-07-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 10.0.0 |
| Dependencies | 4 |
| Unpacked size | 238.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Nokorbis |
| Maintainers | nokorbis |
| Keywords | Svelte, Sapper, Generator, Component, Web, yeoman-generator |

## Links

- npm: https://www.npmjs.com/package/generator-svalter
- Repository: https://github.com/Nokorbis/svalter
- Issues: https://github.com/Nokorbis/svalter/issues
- npm.io page: https://npm.io/package/generator-svalter

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [yosay](https://npm.io/package/yosay.md) ^2.0.1
- [yeoman-generator](https://npm.io/package/yeoman-generator.md) ^4.11.0
- [inquirer-autocomplete-prompt](https://npm.io/package/inquirer-autocomplete-prompt.md) ^1.0.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2020-09-18
- 1.1.1 — 2020-08-11
- 1.1.0 — 2020-08-09
- 1.0.0 — 2020-08-08
- 0.9.0 — 2020-08-08
- 0.8.0 — 2020-08-08
- 0.7.0 — 2020-08-08
- 0.6.0 — 2020-08-07
- 0.5.2 — 2020-07-30
- 0.5.1 — 2020-07-30
- 0.5.0 — 2020-07-30
- 0.3.3 — 2020-07-26
- 0.3.2 — 2020-07-26
- 0.3.1 — 2020-07-25
- 0.3.0 — 2020-07-25
- … 5 more at https://npm.io/package/generator-svalter/versions

## README

# generator-svalter [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]

> Generator to help you create and manage svelte/sapper application

## Features

-   Generate a boilerplate project for svelte, sapper or a component library
-   Generate routes (sapper only), components, models, services and (svelte) actions

## Supported "templates"

-   **Svelte** : (javascript || typescript) && (css || scss)
-   **Sapper** : (javascript || typescript) && (css || scss)
-   **Component library** : (javascript || typescript) && (css || scss)

## Installation

First, install [Yeoman](http://yeoman.io) and generator-svalter using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).

```bash
npm install -g yo
npm install -g generator-svalter
```

## Usage notes :

Each option is optional. If the generator needs more data, you will be prompted a question.

## Project generation

```bash
mkdir your-project
cd your-project
yo svalter [project_name] [options...]
```

![svalter-gif](https://github.com/Nokorbis/svalter/raw/master/doc/gifs/svalter.gif)

### Available options

|                               Option | Description                                                                                                                                      |
| -----------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|                         --**svelte** | Creates a **svelte** project. _(Skips the project type question)_                                                                                |
|                         --**sapper** | Creates a **sapper** project. _(Skips the project type question)_                                                                                |
|                        --**library** | Creates a **component library** project _(Skips the project type question)_                                                                      |
|            --**css-reset**=_\<name>_ | Adds a css reset in your project. _name_ can be any of : **none**, **meyer_reset**, **normalize**, **sanitize** _(Skips the css reset question)_ |
|               --**style-separation** | Components' styles will be put in a different file for each component                                                                            |
|            --**no-style-separation** | Components' styles will be put in the same file as the markup                                                                                    |
|              --**script-separation** | Components' scripts will be put in a different file for each component                                                                           |
|           --**no-script-separation** | Components' scripts will be put in the same file as the markup                                                                                   |
|       --**typescript** _or_ --**ts** | **Adds TypeScript support** to your project                                                                                                      |
| --**no-typescript** _or_ --**no-ts** | Does **not add TypeScript support** to your project                                                                                              |
|           --**sass** _or_ --**scss** | **Adds SASS support** to your project                                                                                                            |
|     --**no-sass** _or_ --**no-scss** | Does **not add SASS support** to your project                                                                                                    |

## Component generation

```bash
#in a svalter project
yo svalter:component [component-name] [options...]
```

### Available options

|              Option | Description                                                                  |
| ------------------: | ---------------------------------------------------------------------------- |
| --**folder**=_path_ | Put the component in a specific folder (which will be under /src/components) |

## Route generation

```bash
#in a svalter project
yo svalter:route [route] [options...]
```

If your route's name starts with [ and ends with ], you will be prompted to choose a predefined pattern to help you.  
If you have existing routes containing path variables with patterns, you can skip the pattern, and the generator will still find the right route for you.  
Example:  
If a route "/a/[b(some-pattern)]/" exists, to generate a new [c] route, you can type :

```bash
yo svalter:route a/[b]/[c]
```

### Available options

|                               Option | Description                                                                                                                                                                                                   |
| -----------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|        --**json-api** _or_ --**api** | Create a json api script in this generated route                                                                                                                                                              |
| --**page-component** _or_ --**page** | Create a page component in this generated route                                                                                                                                                               |
|  --**page-layout** _or_ --**layout** | Create a page layout in this route                                                                                                                                                                            |
|         --**pattern**=_some_pattern_ | Available patterns: **none**, **numbers**, **characters**, **uuid**, **date**, **time**, **datetime**. Many patterns can be specified (separated by ; ) _for each path variable that doesn't currently exist_ |

## Service generation

```bash
#in a svalter project
yo svalter:service [service-name] [options...]
```

### Available options

|              Option | Description                                                                      |
| ------------------: | -------------------------------------------------------------------------------- |
| --**folder**=_path_ | Put the service in a specific folder (which will be under /src/scripts/services) |

## Model generation

```bash
#in a svalter project
yo svalter:model [model-name] [options...]
```

### Available options

|              Option | Description                                                                  |
| ------------------: | ---------------------------------------------------------------------------- |
| --**folder**=_path_ | Put the model in a specific folder (which will be under /src/scripts/models) |

## Action generation

```bash
#in a svalter project
yo svalter:action [action-name] [options...]
```

### Available options

|              Option | Description                                                                    |
| ------------------: | ------------------------------------------------------------------------------ |
| --**folder**=_path_ | Put the action in a specific folder (which will be under /src/scripts/actions) |

## Considered features

Recipes generation  
i18n addition

## License

Apache-2.0 © [Nokorbis](https://github.com/Nokorbis)

[npm-image]: https://badge.fury.io/js/generator-svalter.svg
[npm-url]: https://npmjs.org/package/generator-svalter
[travis-image]: https://travis-ci.org/Nokorbis/svalter.svg?branch=master
[travis-url]: https://travis-ci.org/Nokorbis/svalter
[daviddm-image]: https://david-dm.org/Nokorbis/svalter.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/Nokorbis/svalter

---
_Source: https://npm.io/package/generator-svalter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
