# celestial-glow-router

> A router library for celestial glow.

Latest version **2.0.2** (published 2024-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install celestial-glow-router
pnpm add celestial-glow-router
yarn add celestial-glow-router
bun add celestial-glow-router
```

## 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 | 2.0.2 |
| Published | 2024-04-17 |
| First published | 2024-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | revilskento |
| Keywords | router, celestial, glow |

## Links

- npm: https://www.npmjs.com/package/celestial-glow-router
- Repository: https://github.com/revilskento/celestial-glow-router
- Homepage: https://github.com/revilskento/celestial-glow-router#readme
- Issues: https://github.com/revilskento/celestial-glow-router/issues
- npm.io page: https://npm.io/package/celestial-glow-router

## Dependencies (3)

- [express](https://npm.io/package/express.md) ^4.17.1
- [query-string](https://npm.io/package/query-string.md) ^7.0.0
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^6.2.0

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 2.0.2 (latest) — 2024-04-17
- 2.0.1 — 2024-03-20
- 2.0.0 — 2024-03-20
- 1.0.0 — 2024-03-18

## README

# Celestial Glow Router

The Celestial Glow Router is a lightweight, easy-to-use routing library designed specifically for the Celestial Glow framework. It provides a simple API to add and navigate routes in your Celestial Glow applications.

## Installation

To install the celestial-glow-router, run the following command in your project directory:

```sh
npm install celestial-glow-router
```

## Usage

First, import the `CelestialGlowRouter` in your application:

```javascript
const CelestialGlowRouter = require('celestial-glow-router');
```

Then, create a new router instance and define your routes:

```javascript
const router = new CelestialGlowRouter();

router.addRoute('/', () => {
console.log('Home Page');
});

router.addRoute('/about', () => {
console.log('About Page');
});
```

To navigate to a route, use the `navigate` method:

```javascript
router.navigate('/');
// Outputs: Home Page

router.navigate('/about');
// Outputs: About Page
```

## API

### addRoute(path, action)

- `path` \<String\>: The URL path to match.
- `action` \<Function\>: The function to execute when the route is navigated to.

Adds a new route to the router.

### navigate(path)

- `path` \<String\>: The URL path to navigate to.

Navigates to a given path if it exists in the router's routes; otherwise, it logs a message indicating the path does not exist.

## Contributing

Contributions to the Celestial Glow Router are welcome! Please feel free to submit issues, pull requests, or suggest features to enhance the library.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

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