Skip to content
/ jsonp Public

A lightweight jsonp library implementation written in typescript

License

Notifications You must be signed in to change notification settings

hec9527/jsonp

Repository files navigation

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

About

A lightweight jsonp library implementation written in typescript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published