o-fetch-jsonp is deprecated. Use the fetch
polyfill and Cross-Origin Resource Sharing instead.
Client side fetch wrapper that fallbacks to JSONP
Uses fetch, but fallbacks to a fetch
-like interface using JSONP under the hood
bower install -S o-fetch-jsonp
import fetchJsonp from 'o-fetch-jsonp';
const opts = {
timeout: 1000
};
fetchJsonp('http://other.domain.com/foo', opts)
.then(data => {
...
});
Note: If using CommonJS modules,
const fetchJsonp = require('o-fetch-jsonp').default;
Where opts
can take