# micro-jsonp

> Teeny-tiny JSONP handler. **386b gzipped.**

Latest version **1.0.4** (published 2017-07-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install micro-jsonp
pnpm add micro-jsonp
yarn add micro-jsonp
bun add micro-jsonp
```

## 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.4 |
| Published | 2017-07-09 |
| First published | 2016-09-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | estrattonbailey |
| Maintainers | estrattonbailey |

## Links

- npm: https://www.npmjs.com/package/micro-jsonp
- Repository: https://github.com/estrattonbailey/micro-jsonp
- Homepage: https://github.com/estrattonbailey/micro-jsonp#readme
- Issues: https://github.com/estrattonbailey/micro-jsonp/issues
- npm.io page: https://npm.io/package/micro-jsonp

## Recent versions

- 1.0.4 (latest) — 2017-07-09
- 1.0.3 — 2016-09-08
- 1.0.2 — 2016-09-05
- 1.0.1 — 2016-09-02
- 1.0.0 — 2016-09-02
- 0.0.1 — 2016-09-01

## README

# micro-jsonp
Teeny-tiny JSONP handler. **386b gzipped.**

## Usage
```javascript
import jsonp from 'micro-jsonp'

jsonp('path/to/endpoint?data=Data', {
  param: 'callback',
  timeout: 10000,
  response: (err, data) => {
    err ? errorCallback(err) : successCallback(data)
  }
})
```

## API

### jsonp(url[, options])

#### url
The endpoint *and* serialized data e.g. `path/to/endpoint?email=ericstrattonbailey%2B1%40gmail.com`.

#### options
 - `param (optional, type: string, default: 'callback')`: the name of the query param your service uses to specify the callback function `default: 'callback'`
 - `response (required, type: function)`: your data callback function - receives `err, data` params - users must handle success/error state
 - `timeout (optional, type: number, default: 60000)`: an optional timeout. If `false`, script will not time out.

* * *
 MIT License

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