https://github.com/goto-bus-stop/smol-jsonp
small, promise-based, zero-dependency jsonp library for browsers. ~330b gzip
https://github.com/goto-bus-stop/smol-jsonp
Last synced: 10 days ago
JSON representation
small, promise-based, zero-dependency jsonp library for browsers. ~330b gzip
- Host: GitHub
- URL: https://github.com/goto-bus-stop/smol-jsonp
- Owner: goto-bus-stop
- License: other
- Created: 2019-11-19T15:04:27.000Z (over 5 years ago)
- Default Branch: default
- Last Pushed: 2024-10-15T20:36:09.000Z (9 months ago)
- Last Synced: 2025-05-18T13:40:52.380Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# smol-jsonp
small, promise-based, zero-dependency jsonp library for browsers. ~330b gzip
[Install](#install) - [Usage](#usage) - [License: Apache-2.0](#license)
[![npm][npm-image]][npm-url]
[![standard][standard-image]][standard-url][npm-image]: https://img.shields.io/npm/v/smol-jsonp.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/smol-jsonp
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard## Install
```
npm install smol-jsonp
```## Usage
```js
var jsonp = require('smol-jsonp')async function main () {
// does
var result = await jsonp('http://some-jsonp-url?query=etc')
// does
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](LICENSE.md)