jsonp-simple
v0.0.5
Published
simple and thin promisify jsonp
Downloads
4
Readme
jsonp-simple
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)