@hec9527/jsonp

1.0.1 • Public • Published

jsonp

GitHub Size Version Files Bundle Download Issues Start

中文

A simple JSONP implementation base on typescript build by rollup。

install

install by npm

npm install jsonp --save

🎉 feature

  • light

    dist file just less than 1kb after gzip

  • type safe

    write by typescript and provide all type declare

  • sourceMap

    sourcemap inside, you can debug your fetch step by step

  • openSource

    get the source code for free and build your own dist

API

jsonp(url, option, callback)
  • url (String) fetch url
  • option (Object) optional
    • prefixString)prefix of jsonp callback function name
    • nameString) you can custom the jsonp callback function name
    • params (String) name of the query string parameter to specify the callback
    • timeoutNumber) a time limit in milliseconds for the call (default: 60*1000)
    • dataObject) Other query strings, note that the key with the same name as callback will be ignored
  • callbackFunction)the callback of request, first params is error info, and the second is response data

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @hec9527/jsonp

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

95.3 kB

Total Files

13

Last publish

Collaborators

  • hec9527