JSPM

parse-jsonp

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 116
  • Score
    100M100P100Q80556F
  • License ISC

Get the payload of a JSONP response.

Package Exports

  • parse-jsonp

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (parse-jsonp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

parse-jsonp

Get the payload of a JSONP response in Node.js and in the browser. No fetch/AJAX logic in here.

npm version build status ISC-licensed chat on gitter support me on Patreon

Installing

npm install parse-jsonp

Usage

const {fetch} = require('fetch-ponyfill')()
const parse = require('parse-jsonp')

fetch('some-JSONP-url.js')
.then((res) => res.text())
.then((jsonp) => parse('callback', jsonp))
.then(console.log, console.error)

API

parse(hook, jsonp)

Contributing

If you have a question or have difficulties using parse-jsonp, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.