# @xeito/router

> Router for Xeito | Framework for building web applications

Latest version **0.3.5** (published 2023-03-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @xeito/router
pnpm add @xeito/router
yarn add @xeito/router
bun add @xeito/router
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.5 |
| Published | 2023-03-17 |
| First published | 2022-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 33.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Samuel Bazaga |
| Maintainers | aerotoad |
| Keywords | Xeito, Framework, Web, Typescript |

## Links

- npm: https://www.npmjs.com/package/@xeito/router
- npm.io page: https://npm.io/package/@xeito/router

## Dependencies (5)

- [history](https://npm.io/package/history.md) ^5.3.0
- [@xeito/core](https://npm.io/package/@xeito/core.md) ^0.3.5
- [@xeito/store](https://npm.io/package/@xeito/store.md) ^0.3.5
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^6.2.1
- [@xeito/injection](https://npm.io/package/@xeito/injection.md) ^0.3.5

## 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

- 0.3.5 (latest) — 2023-03-17
- 0.3.4 — 2023-02-27
- 0.3.3 — 2023-02-21
- 0.3.2 — 2023-02-21
- 0.3.1 — 2023-02-21
- 0.3.0 — 2023-02-21
- 0.2.2 — 2023-02-08
- 0.2.1 — 2023-01-24
- 0.2.0 — 2023-01-20
- 0.1.13 — 2023-01-20
- 0.1.12 — 2023-01-19
- 0.1.11 — 2023-01-17
- 0.1.10 — 2023-01-13
- 0.1.9 — 2023-01-13
- 0.1.8 — 2023-01-12
- … 16 more at https://npm.io/package/@xeito/router/versions

## README

<h1 align="center">Xeito - Harness the power of the web.</h1>

<p align="center">
  <img src="https://xeito.dev/images/logo_gradient.svg" alt="xeito-logo" width="150px" height="150px"/>
  <br><br>
  <i>Xeito is a typescript framework for building web applications</i>
  <br>
</p>

<p align="center">
  <a href="https://xeito.dev/xeito-docs/"><strong>Xeito Documentation</strong></a>
  <br>
</p>

<p align="center">
  <a href="https://www.npmjs.com/@xeito/core">
    <img src="https://img.shields.io/npm/v/@xeito/core.svg?logo=npm&logoColor=fff&label=NPM+package&color=f59e0b" alt="Xeito on npm" />
  </a>
  &nbsp;
  <a href="https://github.com/aerotoad/xeito/blob/main/LICENSE">
    <img src="https://img.shields.io/github/license/aerotoad/xeito" alt="License" />
  </a>
</p>

<hr>

## Xeito Router

This is the Router library for Xeito Framework.
Provides a simple yet powerful router for web applications built with Xeito.

To find the full documentation and more links go to the main [README file](https://github.com/aerotoad/xeito).

<hr>

## Exports:

### Classes:
- `XeitoRouterPlugin`: The Router Plugin class, intented to be registered in a Xeito application.

Example:
```typescript
import { Xeito } from '@xeito/core';
import { XeitoRouterPlugin } from '@xeito/router';
import { AppComponent } from './app-component.ts';

const app = new Xeito(AppComponent);
app.usePlugin(XeitoRouterPlugin, {
  routes: [
    {
      path: '/',
      component: HomeComponent,
    },
    {
      path: '/about',
      component: AboutComponent,
    },
  ],
});

app.bootstrap();
```

### Components:
- `RouterSlot`: The component that renders the current route component (and nested views).
- `RouterLink`: Helper component to create links from the template.

### Interfaces
- `Route`: The interface for injectable metadata (decorator).
- `RouteGuard`: The interface for route guards.
- `RouterOptions`: The interface for the Router Plugin options (see example above).
- `XeitoRouter`: The interface for the XeitoRouter *global property*

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