# @analytics/router-utils

> Route change utilities for single page apps

Latest version **0.1.1** (published 2022-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @analytics/router-utils
pnpm add @analytics/router-utils
yarn add @analytics/router-utils
bun add @analytics/router-utils
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-01-02 |
| First published | 2021-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2666 |
| Author | David Wells |
| Maintainers | davidwells |
| Keywords | analytics, analytics-project, analytics-util, spa, route-listener, routes |

## Links

- npm: https://www.npmjs.com/package/@analytics/router-utils
- Repository: https://github.com/DavidWells/analytics
- Homepage: https://github.com/DavidWells/analytics#readme
- Issues: https://github.com/DavidWells/analytics/issues
- npm.io page: https://npm.io/package/@analytics/router-utils

## Recent versions

- 0.1.1 (latest) — 2022-01-02
- 0.1.0 — 2021-02-08
- 0.0.2 — 2021-02-08
- 0.0.1 — 2021-02-08

## README

<!--
title: SPA Router Utilities
pageTitle: Router Utils
description: Utility library for single page app routing
-->

# Single Page Router utils

A tiny (<!-- AUTO-GENERATED-CONTENT:START (pkgSize) -->`584 bytes`<!-- AUTO-GENERATED-CONTENT:END -->) routing utility for listening to route changes in single page applications.

## Install

```bash
npm install @analytics/router-utils
```

## Usage

```js
import onRouteChange from '@analytics/router-utils'
import analytics from './analytics'

onRouteChange((newRoutePath) => {
  console.log('new route path', newRoutePath)
  // trigger page view
  analytics.page()
})
```

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