A simple JSONP implementation base on typescript build by rollup。
install by npm
npm install jsonp --save
-
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
jsonp(url, option, callback)
url
(String
) fetch urloption
(Object
) optionalprefix
(String
)prefix of jsonp callback function namename
(String
) you can custom the jsonp callback function nameparams
(String
) name of the query string parameter to specify the callbacktimeout
(Number
) a time limit in milliseconds for the call (default: 60*1000)data
(Object
) Other query strings, note that the key with the same name as callback will be ignored
callback
(Function
)the callback of request, first params is error info, and the second is response data
MIT