# tracked-history

> [![NPM Package](https://badge.fury.io/js/tracked-history.svg)](https://www.npmjs.com/package/tracked-history)

Latest version **0.1.0** (published 2023-02-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install tracked-history
pnpm add tracked-history
yarn add tracked-history
bun add tracked-history
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-02-09 |
| First published | 2023-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 59.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | vilicvane |
| Maintainers | vilic |

## Links

- npm: https://www.npmjs.com/package/tracked-history
- npm.io page: https://npm.io/package/tracked-history

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.5.0

## Recent versions

- 0.1.0 (latest) — 2023-02-09

## README

[![NPM Package](https://badge.fury.io/js/tracked-history.svg)](https://www.npmjs.com/package/tracked-history)

# Tracked History

`BrowserHistory` tracks browser history so that we can restore history stack with snapshots.

> It was originally created for [Boring Router](https://github.com/makeflow/boring-router) to support complete lifecycle hooks while keeping browser navigation behavior right.

`MemoryHistory` and `ReadOnlyHistory` are also available for testing or server-side usages.

## Installation

```sh
npm install tracked-history
```

## Usage

```ts
import {BrowserHistory} from 'tracked-history';

const history = new BrowserHistory();

const snapshot = history.snapshot;

void history.push('/about');

void history.restore(snapshot);
```

## License

MIT License.

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