npm

jsonp-simple

0.0.5 • Public • Published

jsonp-simple

npm npm CircleCI Codecov cdn

simple and thin promisify jsonp

Usage

Browser

<script src="https://cdn.jsdelivr.net/npm/jsonp-simple/dist/jsonp-simple.min.js"></script>
<script>
  jsonpSimple("https://api.github.com/repos/kthjm/jsonp-simple")
  .then((res) => console.log(res))
  .catch((err) => console.error(err))
</script> 

Node (bundle for Browser)

yarn add jsonp-simple
import jsonp from "jsonp-simple"
 
jsonp("https://api.github.com/repos/kthjm/jsonp-simple")
.then((res) => console.log(res))
.catch((err) => console.error(err))

API

jsonp(src[, timeout])

src: string

timeout: number = 2000

error

timeout: boolean

onerror: Event | false

License

MIT (http://opensource.org/licenses/MIT)

Readme

Keywords

Package Sidebar

Install

npm i jsonp-simple

Weekly Downloads

0

Version

0.0.5

License

MIT

Last publish

Collaborators

  • kthjm