# @lqs469/ssr

> Super Simple Router

Latest version **1.0.2** (published 2018-06-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lqs469/ssr
pnpm add @lqs469/ssr
yarn add @lqs469/ssr
bun add @lqs469/ssr
```

## 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.0.2 |
| Published | 2018-06-21 |
| First published | 2018-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | lqs469 |
| Maintainers | lqs469 |
| Keywords | router |

## Links

- npm: https://www.npmjs.com/package/@lqs469/ssr
- Repository: https://github.com/lqs469/SSR
- Homepage: https://github.com/lqs469/SSR#readme
- Issues: https://github.com/lqs469/SSR/issues
- npm.io page: https://npm.io/package/@lqs469/ssr

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

- 1.0.2 (latest) — 2018-06-21
- 1.0.1 — 2018-06-21
- 1.0.0 — 2018-06-21

## README

# :rocket: SSR

Super Simple Router.

一个灰常轻量化的前端路由框架.

* 无任何依赖, 轻至百行.
* 可随意搭配流行前端框架.
* 即开即用, 实现基础功能甚至无需写一行 js 代码.
* 支持 hook, 提供 location 参数匹配.

## 💾 Installation

直接

```JS
<script src='ssr.js'></script>
```

或者 NPM

```BASH
npm i @lqs469/ssr -S
```

## :feet: Usage

无障碍实现功能, 实现功能只在需要的路由的组件加了一个`path`. [这有一个简单的 Demo](https://github.com/lqs469/SSR/tree/master/demo)

HTML:

```html
<a href=''>Index</a>
<a href='#a'>A</a>
<a href='#b/3/4?test=1'>C</a>

<div path='/'>Index</div>
<div path='a'>A</div>
<div path='b/:i/:j'>C</div>
```

JS:

```js
// ES:
import ssr from '@lqs469/ssr'

// 跳转钩子
// 点击 <a href='#b/3/4?test=1'>C</a> 跳转之后触发:
ssr.didChange(['b/:i/:j'], (props, search) => {
  // path: { i: '3', j: '4' }
  // serach:{ test: '1' }
  ...
})
```

## TODO

* [x] npm
* [ ] 嵌套?
* [ ] regex?
* [ ] match method?
* [ ] action style?
* [ ] promise hook?

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