# popstate

> Listen on popstate history events with Safari compatibility

Latest version **1.0.0** (published 2015-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install popstate
pnpm add popstate
yarn add popstate
bun add popstate
```

## 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.0 |
| Published | 2015-10-09 |
| First published | 2015-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | history, popstate, safari |

## Links

- npm: https://www.npmjs.com/package/popstate
- Repository: https://github.com/bendrucker/popstate
- Homepage: https://github.com/bendrucker/popstate#readme
- Issues: https://github.com/bendrucker/popstate/issues
- npm.io page: https://npm.io/package/popstate

## Dependencies (3)

- [global](https://npm.io/package/global.md) ~4.3.0
- [next-tick](https://npm.io/package/next-tick.md) ~0.2.2
- [window-load](https://npm.io/package/window-load.md) ~1.0.0

## Recent versions

- 1.0.0 (latest) — 2015-10-09

## README

# popstate [![Build Status](https://travis-ci.org/bendrucker/popstate.svg?branch=master)](https://travis-ci.org/bendrucker/popstate)

> Listen on popstate history events with Safari compatibility

Old versions of Chrome and all versions of Safari emit `popstate` events on page load [(MDN)](https://developer.mozilla.org/en-US/docs/Web/Events/popstate). popstate defers registration of the event listener to avoid double-calls.

## Install

```
$ npm install --save popstate
```


## Usage

```js
var popState = require('popstate')

popState(function (event) {
  //=> popped state  
})
```

## API

#### `popState(callback)` -> `undefined`

##### callback

*Required*  
Type: `function`

A callback to safely register for `popstate` events.


## License

MIT © [Ben Drucker](http://bendrucker.me)

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