jsonp-simple
0.0.5 • Public • Published 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)
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)
Package Sidebar
Install
Weekly Downloads