smol-jsonp
small, promise-based, zero-dependency jsonp library for browsers. ~330b gzip
Last updated a year ago by goto-bus-stop .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install smol-jsonp 
SYNC missed versions from official npm registry.

smol-jsonp

small, promise-based, zero-dependency jsonp library for browsers. ~330b gzip

Install - Usage - License: Apache-2.0

npm standard

Install

npm install smol-jsonp

Usage

var jsonp = require('smol-jsonp')

async function main () {
  // does <script src="http://some-jsonp-url?query=etc&callback={NAME}"></script>
  var result = await jsonp('http://some-jsonp-url?query=etc')
  // does <script src="http://some-jsonp-url?cb={NAME}"></script>
  var result2 = await jsonp('http://some-jsonp-url', { param: 'cb' })
}

This package uses a global variable window.__jsonpCallbacks to register callbacks. Do not touch it.

License

Apache-2.0

Current Tags

  • 1.0.0                                ...           latest (a year ago)

1 Versions

  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 4
Dependencies (0)
None
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |