# pollr

> A JavaScript/AJAX polling engine

Latest version **1.1.4** (published 2017-05-22) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2017-05-22 |
| First published | 2017-05-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | olishmollie |
| Maintainers | olishmollie |

## Links

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

## Recent versions

- 1.1.4 (latest) — 2017-05-22
- 1.1.3 — 2017-05-22
- 1.1.2 — 2017-05-22
- 1.1.1 — 2017-05-22
- 1.1.0 — 2017-05-22
- 1.0.1 — 2017-05-21
- 1.0.0 — 2017-05-20

## README

# pollr

A JavaScript/AJAX polling engine.

## Usage

```javascript
import Pollr from 'pollr';

var pollr = new Pollr({
  url: '/test',
  retries: 10,
  interval: 3000,
  responseType: 'json'
});

pollr.on('data', function(data) {
  if (data.foo === 'bar') {
    // Do something awesome
    pollr.stop(); 
  }
});

pollr.on('error', function(error) {
  console.error(error); // Called when response.statusCode != 200
});

pollr.start(); // Polls the server 11 times, unless stopped
```

## Other Examples

### Continuous polling
```javascript
pollr.retries = null; 
pollr.start(); // Will poll until stopped
```

### Post data
```javascript
pollr.method = 'post';
pollr.data = { message: 'Is anybody home...?' };
```

## Contact
AJ Bond
* Email: olishmollie@gmail.com
* Twitter: @olishmollie

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