{"id":16822889,"url":"https://github.com/wzhudev/pjsonp","last_synced_at":"2026-01-04T07:06:14.173Z","repository":{"id":57325263,"uuid":"127103624","full_name":"wzhudev/pjsonp","owner":"wzhudev","description":":traffic_light: jsonp with elegent Promise API.","archived":false,"fork":false,"pushed_at":"2018-04-09T13:53:37.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T06:52:08.619Z","etag":null,"topics":["jsonp","jsonp-request","promise-api"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pjsonp","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wzhudev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-28T07:47:02.000Z","updated_at":"2018-12-27T07:25:22.000Z","dependencies_parsed_at":"2022-09-18T22:56:06.884Z","dependency_job_id":null,"html_url":"https://github.com/wzhudev/pjsonp","commit_stats":null,"previous_names":["wendzhue/promise-jsonp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzhudev%2Fpjsonp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzhudev%2Fpjsonp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzhudev%2Fpjsonp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzhudev%2Fpjsonp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wzhudev","download_url":"https://codeload.github.com/wzhudev/pjsonp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244135897,"owners_count":20403797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jsonp","jsonp-request","promise-api"],"created_at":"2024-10-13T11:06:19.983Z","updated_at":"2026-01-04T07:06:14.112Z","avatar_url":"https://github.com/wzhudev.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pjsonp\n\n\u003e jsonp with elegent Promise API.\n\n## Installation\n\n```sh\nnpm install pjsonp --save\n```\n\n## API\n\n```js\nconst pjsonp = require('path/to/pjsonp')\nconst url = 'http://jsfiddle.net/echo/jsonp/'\nconst params = {\n  beep: 'boop',\n  yo: 'dawg'\n}\nconst options = {\n  timeout: 1,\n  name: 'namedCb'\n}\n\npjsonp(url, params, options)\n  .then(data =\u003e {\n    /* deal with the data you just fetched! */\n  })\n  .catch(err =\u003e {\n    /* timeout err by default */\n  })\n```\n\n* `url`: url to fetch data. It should look like `http://somehostname[:someport]/to/some/path[?with=true\u0026orWithoutQueries=false]`\n* `params` (optional): an plain object that contains parameters. Considering jsonp is all about 'GET', promise-jsonp will parse them into `url` for you. But if you don't have parameters or have enclosed them in `url`, that's fine. Just ignore `params`.\n* `options` (optional, but you can't just provide `params` without `options`):\n  * `prefix`: prefix of jsonp callback function. Default: `__jp`.\n  * `timeout`: literal meaning. Default: `60000`, in milliseconds.\n  * `name`: the name of callback function. If set, `prefix` would be invalid. Default: `undefined`.\n  * `param`: name of the query string parameter to specify the callback. Default: `callback`.\n\n## Test\n\n~~Test with Jest. Run `npm run test`.~~\n\n**Due to some unknown problems, I can't test it with Jest. So I wrote a `.html` to test it in browsers manually. Anyone knows why Jest just won't work?**\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwzhudev%2Fpjsonp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwzhudev%2Fpjsonp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwzhudev%2Fpjsonp/lists"}