# jd-promise-jsonp

> 将 jsonp 请求 promise 化

Latest version **1.0.2** (published 2017-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install jd-promise-jsonp
pnpm add jd-promise-jsonp
yarn add jd-promise-jsonp
bun add jd-promise-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.2 |
| Published | 2017-01-17 |
| First published | 2016-05-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jason Deng |
| Maintainers | dnxbf321 |

## Links

- npm: https://www.npmjs.com/package/jd-promise-jsonp
- Repository: https://dnxbf321@github.com/dnxbf321/promise-jsonp
- Homepage: https://github.com/dnxbf321/promise-jsonp#readme
- Issues: https://github.com/dnxbf321/promise-jsonp/issues
- npm.io page: https://npm.io/package/jd-promise-jsonp

## Recent versions

- 1.0.2 (latest) — 2017-01-17
- 1.0.1 — 2016-05-30
- 1.0.0 — 2016-05-30

## README

# jd-promise-jsonp

将 jsonp 请求 promise 化

## 用法

```js
var jsonp = require('jd-promise-jsonp') // window['promise-jsonp']

jsonp({
	url: '/jsonp',  // 接口地址
	callback: 'jsoncallback',  // 服务端接收的 jsonp callback 参数名，默认是 jsoncallback
	data: {
		v: 1,
		obj: {
			key1: '1',
			key2: '2'
		} // 将调用 JSON.stringify 将 object 类型转换成 string
	}
}).then(function(ret) {
	console.log(ret)
}).catch(function(err) {
	console.error(err)
})
```

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