{"maintainers":[{"name":"camsong","email":"neosoyn@gmail.com"}],"keywords":["fetch","jsonp","github fetch","ajax"],"dist-tags":{"latest":"1.0.6"},"author":{"name":"Cam Song"},"description":"Fetch JSONP like a boss using Fetch API","readme":"# Fetch JSONP [![Build Status](https://travis-ci.org/camsong/fetch-jsonp.svg)](https://travis-ci.org/camsong/fetch-jsonp) [![npm version](https://badge.fury.io/js/fetch-jsonp.svg)](http://badge.fury.io/js/fetch-jsonp) [![npm downloads](https://img.shields.io/npm/dm/fetch-jsonp.svg?style=flat-square)](https://www.npmjs.com/package/fetch-jsonp)\n\nJSONP is NOT supported in standard Fetch API, https://fetch.spec.whatwg.org.\nfetch-jsonp provides you same API to fetch JSONP like naive Fetch, also comes\nwith global `fetchJsonp` function.\n\nIf you need a `fetch` polyfill for old browsers, try [github/fetch](http://github.com/github/fetch).\n\n## Installation\n\nYou can install with `npm`.\n\n```\nnpm install fetch-jsonp\n```\n\n## Promise Polyfill for IE\n\nIE8/9/10/11 does not support [ES6 Promise](https://tc39.github.io/ecma262/#sec-promise-constructor), run this to polyfill the global environment at the beginning of your application.\n\n```js\nrequire('es6-promise').polyfill();\n```\n\n## Usage\n\nThe `fetch-jsonp` function supports any HTTP method. We'll focus on GET and POST\nexample requests.\n\n### Fetch JSONP in simple way\n\n```javascript\nfetchJsonp('/users.jsonp')\n  .then(function(response) {\n    return response.json()\n  }).then(function(json) {\n    console.log('parsed json', json)\n  }).catch(function(ex) {\n    console.log('parsing failed', ex)\n  })\n```\n\n### Set JSONP callback name, default is 'callback'\n\n```javascript\nfetchJsonp('/users.jsonp', {\n    jsonpCallback: 'custom_callback'\n  })\n  .then(function(response) {\n    return response.json()\n  }).then(function(json) {\n    console.log('parsed json', json)\n  }).catch(function(ex) {\n    console.log('parsing failed', ex)\n  })\n```\n\n### Set JSONP request timeout, default is 5000ms\n\n```javascript\nfetchJsonp('/users.jsonp', {\n    timeout: 3000,\n    jsonpCallback: 'custom_callback'\n  })\n  .then(function(response) {\n    return response.json()\n  }).then(function(json) {\n    console.log('parsed json', json)\n  }).catch(function(ex) {\n    console.log('parsing failed', ex)\n  })\n```\n\n### Caveats\n\nYou need to call `.then(function(response) { return response.json(); })` in order\nto keep consistent with Fetch API.\n\n## Browser Support\n\n![Chrome](https://raw.github.com/alrra/browser-logos/master/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/firefox/firefox_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/internet-explorer/internet-explorer_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/safari/safari_48x48.png)\n--- | --- | --- | --- | --- |\nLatest ✔ | Latest ✔ | 8+ ✔ | Latest ✔ | 6.1+ ✔ |\n\n# License\n\nMIT\n\n# Acknowledgement\n\nThanks to [github/fetch](https://github.com/github/fetch) for bring Fetch to old browsers.\n","repository":{"type":"git","url":"git+https://github.com/camsong/fetch-jsonp.git"},"users":{"mrmartineau":true,"foto":true,"brainpoint":true,"edwardxyt":true,"sternelee":true,"shuoshubao":true},"bugs":{"url":"https://github.com/camsong/fetch-jsonp/issues"},"license":"MIT","versions":{"0.9.0":{"name":"fetch-jsonp","version":"0.9.0","description":"Fetch JSONP like a boss using Fetch API","main":"build/fetch-jsonp.js","scripts":{"test":"mocha --compilers js:babel/register --recursive --ui bdd --reporter spec","build":"babel src/ --modules umd --out-dir build","clean":"rm -rf build","lint":"eslint src/ test/"},"keywords":["fetch","jsonp","github fetch","ajax"],"dependencies":{"es6-promise":"^2.3.0"},"devDependencies":{"babel":"^5.8.21","babel-core":"^5.8.21","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.1.0","eslint-config-airbnb":"^0.0.7","eslint-plugin-react":"^3.2.1","mocha":"^2.2.5"},"repository":{"type":"git","url":"git+https://github.com/camsong/fetch-jsonp.git"},"author":{"name":"Cam Song"},"license":"MIT","bugs":{"url":"https://github.com/camsong/fetch-jsonp/issues"},"homepage":"https://github.com/camsong/fetch-jsonp#readme","gitHead":"6b6d142ff62c82d38a7d78f794aee6bb9f509ae7","_id":"fetch-jsonp@0.9.0","_shasum":"7b4a0e6b4dacb8dcd6274373bdf57e18e57731e9","_from":".","_npmVersion":"2.9.0","_nodeVersion":"2.0.0","_npmUser":{"name":"camsong","email":"neosoyn@gmail.com"},"dist":{"shasum":"7b4a0e6b4dacb8dcd6274373bdf57e18e57731e9","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/fetch-jsonp/-/fetch-jsonp-0.9.0.tgz"},"maintainers":[{"name":"camsong","email":"neosoyn@gmail.com"}],"directories":{}},"0.9.2":{"name":"fetch-jsonp","version":"0.9.2","description":"Fetch JSONP like a boss using Fetch API","main":"build/fetch-jsonp.js","scripts":{"test":"mocha --compilers js:babel/register --recursive --ui bdd --reporter spec","build":"babel src/ --modules umd --out-dir build","clean":"rm -rf build","lint":"eslint src/ test/"},"keywords":["fetch","jsonp","github fetch","ajax"],"dependencies":{"es6-promise":"^2.3.0"},"devDependencies":{"babel":"^5.8.21","babel-core":"^5.8.21","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.1.0","eslint-config-airbnb":"^0.0.7","eslint-plugin-react":"^3.2.1","mocha":"^2.2.5"},"repository":{"type":"git","url":"git+https://github.com/camsong/fetch-jsonp.git"},"author":{"name":"Cam Song"},"license":"MIT","bugs":{"url":"https://github.com/camsong/fetch-jsonp/issues"},"homepage":"https://github.com/camsong/fetch-jsonp#readme","gitHead":"d66919ec059722db151bf65ac0149ea9c1c5eef7","_id":"fetch-jsonp@0.9.2","_shasum":"0b583db69a8a342d5fcfb96aa277239c79f90162","_from":".","_npmVersion":"2.13.4","_nodeVersion":"2.5.0","_npmUser":{"name":"camsong","email":"neosoyn@gmail.com"},"dist":{"shasum":"0b583db69a8a342d5fcfb96aa277239c79f90162","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/fetch-jsonp/-/fetch-jsonp-0.9.2.tgz"},"maintainers":[{"name":"camsong","email":"neosoyn@gmail.com"}],"directories":{}},"1.0.0":{"name":"fetch-jsonp","version":"1.0.0","description":"Fetch JSONP like a boss using Fetch API","main":"build/fetch-jsonp.js","scripts":{"test":"mocha --compilers js:babel/register --recursive --ui bdd --reporter spec","build":"babel src/ --modules umd --out-dir build","clean":"rm -rf build","lint":"eslint src/ test/"},"keywords":["fetch","jsonp","github fetch","ajax"],"dependencies":{"es6-promise":"^2.3.0"},"devDependencies":{"babel":"^5.8.21","babel-core":"^5.8.21","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.1.0","eslint-config-airbnb":"^0.0.7","eslint-plugin-react":"^3.2.1","mocha":"^2.2.5"},"repository":{"type":"git","url":"git+https://github.com/camsong/fetch-jsonp.git"},"author":{"name":"Cam Song"},"license":"MIT","bugs":{"url":"https://github.com/camsong/fetch-jsonp/issues"},"homepage":"https://github.com/camsong/fetch-jsonp#readme","gitHead":"44b6e0b8eee67aa9256818ed24879db4074f732a","_id":"fetch-jsonp@1.0.0","_shasum":"d36538645df65d4ce5fbadf17a2969b6cbd5733b","_from":".","_npmVersion":"2.13.2","_nodeVersion":"2.5.0","_npmUser":{"name":"camsong","email":"neosoyn@gmail.com"},"dist":{"shasum":"d36538645df65d4ce5fbadf17a2969b6cbd5733b","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/fetch-jsonp/-/fetch-jsonp-1.0.0.tgz"},"maintainers":[{"name":"camsong","email":"neosoyn@gmail.com"}],"directories":{}},"1.0.1":{"name":"fetch-jsonp","version":"1.0.1","description":"Fetch JSONP like a boss using Fetch API","main":"build/fetch-jsonp.js","scripts":{"test":"mocha --compilers js:babel/register --recursive --ui bdd --reporter spec","build":"babel src/ --modules umd --out-dir build","clean":"rm -rf build","lint":"eslint src/ test/"},"keywords":["fetch","jsonp","github fetch","ajax"],"dependencies":{"es6-promise":"^2.3.0"},"devDependencies":{"babel":"^5.8.21","babel-core":"^5.8.21","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.1.0","eslint-config-airbnb":"^0.0.7","eslint-plugin-react":"^3.2.1","mocha":"^2.2.5"},"repository":{"type":"git","url":"git+https://github.com/camsong/fetch-jsonp.git"},"author":{"name":"Cam Song"},"license":"MIT","bugs":{"url":"https://github.com/camsong/fetch-jsonp/issues"},"homepage":"https://github.com/camsong/fetch-jsonp#readme","gitHead":"0e6dd00a19f89dc1042b3b9b84e69d5e02022717","_id":"fetch-jsonp@1.0.1","_shasum":"c0136306873e590c5fe44d76081511213e78c07d","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.1","_npmUser":{"name":"camsong","email":"neosoyn@gmail.com"},"dist":{"shasum":"c0136306873e590c5fe44d76081511213e78c07d","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/fetch-jsonp/-/fetch-jsonp-1.0.1.tgz"},"maintainers":[{"name":"camsong","email":"neosoyn@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/fetch-jsonp-1.0.1.tgz_1471145828018_0.28242166223935783"},"directories":{}},"1.0.2":{"name":"fetch-jsonp","version":"1.0.2","description":"Fetch JSONP like a boss using Fetch API","main":"build/fetch-jsonp.js","scripts":{"test":"mocha --compilers js:babel/register --recursive --ui bdd --reporter spec","build":"babel src/ --modules umd --out-dir build","clean":"rm -rf build","lint":"eslint src/ test/"},"keywords":["fetch","jsonp","github fetch","ajax"],"dependencies":{"es6-promise":"^2.3.0"},"devDependencies":{"babel":"^5.8.21","babel-core":"^5.8.21","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.1.0","eslint-config-airbnb":"^0.0.7","eslint-plugin-react":"^3.2.1","mocha":"^2.2.5"},"repository":{"type":"git","url":"git+https://github.com/camsong/fetch-jsonp.git"},"author":{"name":"Cam Song"},"license":"MIT","bugs":{"url":"https://github.com/camsong/fetch-jsonp/issues"},"homepage":"https://github.com/camsong/fetch-jsonp#readme","gitHead":"655c1d0cadc1621873dfb2a6908691dd722998c8","_id":"fetch-jsonp@1.0.2","_shasum":"70684888c3ec6323d0ff757b48f30587ef847647","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.1","_npmUser":{"name":"camsong","email":"neosoyn@gmail.com"},"dist":{"shasum":"70684888c3ec6323d0ff757b48f30587ef847647","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/fetch-jsonp/-/fetch-jsonp-1.0.2.tgz"},"maintainers":[{"name":"camsong","email":"neosoyn@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/fetch-jsonp-1.0.2.tgz_1474854642553_0.3182041561231017"},"directories":{}},"1.0.3":{"name":"fetch-jsonp","version":"1.0.3","description":"Fetch JSONP like a boss using Fetch API","main":"build/fetch-jsonp.js","scripts":{"test":"mocha --compilers js:babel/register --recursive --ui bdd --reporter spec","build":"babel src/ --modules umd --out-dir build","clean":"rm -rf build","lint":"eslint src/ test/"},"keywords":["fetch","jsonp","github fetch","ajax"],"devDependencies":{"babel":"^5.8.21","babel-core":"^5.8.21","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.1.0","eslint-config-airbnb":"^0.0.7","eslint-plugin-react":"^3.2.1","mocha":"^2.2.5"},"repository":{"type":"git","url":"git+https://github.com/camsong/fetch-jsonp.git"},"author":{"name":"Cam Song"},"license":"MIT","bugs":{"url":"https://github.com/camsong/fetch-jsonp/issues"},"homepage":"https://github.com/camsong/fetch-jsonp#readme","gitHead":"78cec1343ba5d09a6967e207f83b765bcbca91ed","_id":"fetch-jsonp@1.0.3","_shasum":"724458f1c6fc8fff5462fd0b5b01f5169baeec9b","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.1","_npmUser":{"name":"camsong","email":"neosoyn@gmail.com"},"dist":{"shasum":"724458f1c6fc8fff5462fd0b5b01f5169baeec9b","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/fetch-jsonp/-/fetch-jsonp-1.0.3.tgz"},"maintainers":[{"name":"camsong","email":"neosoyn@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/fetch-jsonp-1.0.3.tgz_1480827987440_0.2136140235234052"},"directories":{}},"1.0.4":{"name":"fetch-jsonp","version":"1.0.4","description":"Fetch JSONP like a boss using Fetch API","main":"build/fetch-jsonp.js","scripts":{"test":"mocha --compilers js:babel/register --recursive --ui bdd --reporter spec","build":"babel src/ --modules umd --out-dir build","clean":"rm -rf build","lint":"eslint src/ test/"},"keywords":["fetch","jsonp","github fetch","ajax"],"devDependencies":{"babel":"^5.8.21","babel-core":"^5.8.21","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.1.0","eslint-config-airbnb":"^0.0.7","eslint-plugin-react":"^3.2.1","mocha":"^2.2.5"},"repository":{"type":"git","url":"git+https://github.com/camsong/fetch-jsonp.git"},"author":{"name":"Cam Song"},"license":"MIT","bugs":{"url":"https://github.com/camsong/fetch-jsonp/issues"},"homepage":"https://github.com/camsong/fetch-jsonp#readme","gitHead":"1c2c9f2fe45b9e090d6e26a349a0b6ac3b4ae130","_id":"fetch-jsonp@1.0.4","_shasum":"270bdc1b0d52bdf32b6436cd7c7d7d1e70a33fd9","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.1","_npmUser":{"name":"camsong","email":"neosoyn@gmail.com"},"dist":{"shasum":"270bdc1b0d52bdf32b6436cd7c7d7d1e70a33fd9","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/fetch-jsonp/-/fetch-jsonp-1.0.4.tgz"},"maintainers":[{"name":"camsong","email":"neosoyn@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/fetch-jsonp-1.0.4.tgz_1482490516145_0.06446344801224768"},"directories":{}},"1.0.5":{"name":"fetch-jsonp","version":"1.0.5","description":"Fetch JSONP like a boss using Fetch API","main":"build/fetch-jsonp.js","scripts":{"test":"mocha --compilers js:babel/register --recursive --ui bdd --reporter spec","build":"babel src/ --modules umd --out-dir build","clean":"rm -rf build","lint":"eslint src/ test/"},"keywords":["fetch","jsonp","github fetch","ajax"],"devDependencies":{"babel":"^5.8.21","babel-core":"^5.8.21","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.1.0","eslint-config-airbnb":"^0.0.7","eslint-plugin-react":"^3.2.1","mocha":"^2.2.5"},"repository":{"type":"git","url":"git+https://github.com/camsong/fetch-jsonp.git"},"author":{"name":"Cam Song"},"license":"MIT","bugs":{"url":"https://github.com/camsong/fetch-jsonp/issues"},"homepage":"https://github.com/camsong/fetch-jsonp#readme","gitHead":"af613229e0fc7ed86d91d6f7eb943eef92beaecf","_id":"fetch-jsonp@1.0.5","_shasum":"fd1720a6876f557237013ec70ee969dd140486e4","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.1","_npmUser":{"name":"camsong","email":"neosoyn@gmail.com"},"dist":{"shasum":"fd1720a6876f557237013ec70ee969dd140486e4","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/fetch-jsonp/-/fetch-jsonp-1.0.5.tgz"},"maintainers":[{"name":"camsong","email":"neosoyn@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/fetch-jsonp-1.0.5.tgz_1483003629775_0.03485181508585811"},"directories":{}},"1.0.6":{"name":"fetch-jsonp","version":"1.0.6","description":"Fetch JSONP like a boss using Fetch API","main":"build/fetch-jsonp.js","scripts":{"test":"mocha --compilers js:babel/register --recursive --ui bdd --reporter spec","build":"babel src/ --modules umd --out-dir build","clean":"rm -rf build","lint":"eslint src/ test/"},"keywords":["fetch","jsonp","github fetch","ajax"],"devDependencies":{"babel":"^5.8.21","babel-core":"^5.8.21","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.1.0","eslint-config-airbnb":"^0.0.7","eslint-plugin-react":"^3.2.1","mocha":"^2.2.5"},"repository":{"type":"git","url":"git+https://github.com/camsong/fetch-jsonp.git"},"author":{"name":"Cam Song"},"license":"MIT","bugs":{"url":"https://github.com/camsong/fetch-jsonp/issues"},"homepage":"https://github.com/camsong/fetch-jsonp#readme","gitHead":"3b1be53776fa36a548fbf2aa16063c27ca318661","_id":"fetch-jsonp@1.0.6","_shasum":"8d2ae174ed14108292f025f43fa07d2078de6736","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.1","_npmUser":{"name":"camsong","email":"neosoyn@gmail.com"},"dist":{"shasum":"8d2ae174ed14108292f025f43fa07d2078de6736","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/fetch-jsonp/-/fetch-jsonp-1.0.6.tgz"},"maintainers":[{"name":"camsong","email":"neosoyn@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/fetch-jsonp-1.0.6.tgz_1486087842804_0.46444737794809043"},"directories":{}}},"name":"fetch-jsonp","time":{"modified":"2017-04-08T17:43:09.263Z","created":"2015-08-08T10:53:52.880Z","0.9.0":"2015-08-08T10:53:52.880Z","0.9.2":"2015-08-11T06:25:21.817Z","1.0.0":"2015-11-19T02:59:20.242Z","1.0.1":"2016-08-14T03:37:10.743Z","1.0.2":"2016-09-26T01:50:44.225Z","1.0.3":"2016-12-04T05:06:28.041Z","1.0.4":"2016-12-23T10:55:18.171Z","1.0.5":"2016-12-29T09:27:10.018Z","1.0.6":"2017-02-03T02:10:43.057Z"},"readmeFilename":"README.md","homepage":"https://github.com/camsong/fetch-jsonp#readme"}