{"_id":"jsonp-body","_rev":"12-4120205d37a54b427ceb06add57d9e7c","name":"jsonp-body","dist-tags":{"latest":"2.0.0"},"versions":{"0.1.0":{"name":"jsonp-body","version":"0.1.0","keywords":["jsonp","koa","json","CVE-2014-4671","abusing-jsonp-with-rosetta-flash"],"author":{"url":"http://fengmk2.github.com","name":"fengmk2","email":"fengmk2@gmail.com"},"license":"MIT","_id":"jsonp-body@0.1.0","maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"contributors":[{"url":"https://github.com/fengmk2","name":"fengmk2","email":"fengmk2@gmail.com"}],"homepage":"https://github.com/node-modules/jsonp-body","bugs":{"url":"https://github.com/node-modules/jsonp-body/issues","email":"fengmk2@gmail.com"},"dist":{"shasum":"1c48887cf5daff4d7253e1bdc8a2de94e314d07f","tarball":"https://registry.npmjs.org/jsonp-body/-/jsonp-body-0.1.0.tgz","integrity":"sha512-P3U4sPTYMcqEfvO8RROcnL68ZDp6CPonJa3Qh+JGWhpZpMpROwSclH76kp7j8JMv0i30STuPu4hI3Ac3NYaM/Q==","signatures":[{"sig":"MEUCIQCOO2ovWG8sDVCWtryXkYi1NHwvUORwoVl5iFCfO1dL+QIgZzY7zP6um91ea/DvlZg0YA+tG4gFg3U9qKZ7+VyMnaE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","config":{"cov":{"threshold":100}},"_shasum":"1c48887cf5daff4d7253e1bdc8a2de94e314d07f","engines":{"node":">= 0.10.0"},"scripts":{"test":"make test-all"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"repository":{"url":"git://github.com/node-modules/jsonp-body.git","web":"https://github.com/node-modules/jsonp-body","type":"git"},"_npmVersion":"1.4.9","description":"Helper to create more safe jsonp response body for koa and other web framework.","dependencies":{},"devDependencies":{"cov":"*","autod":"*","mocha":"*","jshint":"*","should":"~4.0.4","contributors":"*","istanbul-harmony":"*"},"directories":{}},"0.2.0":{"name":"jsonp-body","version":"0.2.0","keywords":["jsonp","koa","json","CVE-2014-4671","abusing-jsonp-with-rosetta-flash"],"author":{"url":"http://fengmk2.github.com","name":"fengmk2","email":"fengmk2@gmail.com"},"license":"MIT","_id":"jsonp-body@0.2.0","maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"contributors":[{"url":"https://github.com/fengmk2","name":"fengmk2","email":"fengmk2@gmail.com"}],"homepage":"https://github.com/node-modules/jsonp-body","bugs":{"url":"https://github.com/node-modules/jsonp-body/issues","email":"fengmk2@gmail.com"},"dist":{"shasum":"d81ca5012ef02614c207e7fc25339fd34fc593ab","tarball":"https://registry.npmjs.org/jsonp-body/-/jsonp-body-0.2.0.tgz","integrity":"sha512-pPtLAZpDIAkpsUjLjlkTaGo23ItIT3b1vgIrmoAEblfh+cm32liQhr0vU08OzNu/d1ImEt7WswcAylxhBan1uQ==","signatures":[{"sig":"MEYCIQDTYehruCc6JGiG9T5gcb4W/kRTUzUAkduqZeIE9Z2pXQIhAKSbY856j3etBUGscyFpzuiIk0GKKS9+KNK+SGOKfpgo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","config":{"cov":{"threshold":100}},"_shasum":"d81ca5012ef02614c207e7fc25339fd34fc593ab","engines":{"node":">= 0.10.0"},"gitHead":"e1863f4f79e14a4c23a6e93f05a58f3baaaf17d0","scripts":{"test":"make test-all"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"repository":{"url":"git://github.com/node-modules/jsonp-body.git","web":"https://github.com/node-modules/jsonp-body","type":"git"},"_npmVersion":"1.5.0-alpha-4","description":"Helper to create more safe jsonp response body for koa and other web framework.","dependencies":{},"devDependencies":{"cov":"*","autod":"*","mocha":"*","jshint":"*","should":"~4.0.4","contributors":"*","istanbul-harmony":"*"},"directories":{}},"1.0.0":{"name":"jsonp-body","version":"1.0.0","keywords":["jsonp","koa","json","CVE-2014-4671","abusing-jsonp-with-rosetta-flash"],"author":{"url":"http://fengmk2.github.com","name":"fengmk2","email":"fengmk2@gmail.com"},"license":"MIT","_id":"jsonp-body@1.0.0","maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"contributors":[{"url":"https://github.com/fengmk2","name":"fengmk2","email":"fengmk2@gmail.com"},{"url":"https://github.com/dead-horse","name":"dead-horse","email":"heyiyu.deadhorse@gmail.com"}],"homepage":"https://github.com/node-modules/jsonp-body","bugs":{"url":"https://github.com/node-modules/jsonp-body/issues","email":"fengmk2@gmail.com"},"dist":{"shasum":"e610fb6fcea79cf0cc9f27baa7b56377d4b0bb36","tarball":"https://registry.npmjs.org/jsonp-body/-/jsonp-body-1.0.0.tgz","integrity":"sha512-jv6gqQPPOP7mrOqGOQr1U++VzTsumU9JwW+igKcBHHe4qrgLzcvqUoDeByj61AZYIGAocd9FaYxVcvfHWCnJ7g==","signatures":[{"sig":"MEYCIQD70sjjy1y2wkF4V+1CRi32C2yC0GzfsLw6YjA1CTp5QwIhAJsue8T61CLXphLTNmhYtN9sZR62Y/jd/W1tUuqsV3sy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","config":{"cov":{"threshold":100}},"_shasum":"e610fb6fcea79cf0cc9f27baa7b56377d4b0bb36","engines":{"node":">= 0.10.0"},"gitHead":"a5ed30dc7224739727176c8c2e88ca4bc299696b","scripts":{"test":"make test-all"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"repository":{"url":"git://github.com/node-modules/jsonp-body.git","web":"https://github.com/node-modules/jsonp-body","type":"git"},"_npmVersion":"1.5.0-alpha-4","description":"Helper to create more safe jsonp response body for koa and other web framework.","dependencies":{},"devDependencies":{"cov":"*","autod":"*","mocha":"*","jshint":"*","should":"~4.0.4","contributors":"*","istanbul-harmony":"*"},"directories":{}},"1.1.0":{"name":"jsonp-body","version":"1.1.0","keywords":["jsonp","koa","json","CVE-2014-4671","abusing-jsonp-with-rosetta-flash"],"author":{"url":"https://github.com/fengmk2","name":"fengmk2","email":"fengmk2@gmail.com"},"license":"MIT","_id":"jsonp-body@1.1.0","maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"contributors":[{"url":"https://github.com/fengmk2","name":"fengmk2","email":"fengmk2@gmail.com"},{"url":"https://github.com/dead-horse","name":"dead-horse","email":"heyiyu.deadhorse@gmail.com"}],"homepage":"https://github.com/node-modules/jsonp-body","bugs":{"url":"https://github.com/node-modules/jsonp-body/issues","email":"fengmk2@gmail.com"},"dist":{"shasum":"f01f185c79b0976e20c09f474bf74976fd5a302c","tarball":"https://registry.npmjs.org/jsonp-body/-/jsonp-body-1.1.0.tgz","fileCount":7,"integrity":"sha512-ZQyNWgHI8vvqclzz0l4/PatmeGureejrdMiLQGxTupMw0yQMHf+pQwS/7d5tpo2NBHsuwLCmXvZeNiz2RKdklA==","signatures":[{"sig":"MEUCIAYUQzjHeO+CfY50lZL8LVZkDgOTPuNE3Jj42dSY7WgFAiEA958E7iTHDHa3utD7iNWP/slPwqf+fOQSafmeEwrrvWE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6572},"main":"index.js","types":"index.d.ts","engines":{"node":">= 0.10.0"},"gitHead":"64616a934068c5d853d169e1b79a7ccf84d00694","scripts":{"test":"mocha test/*.test.js","test-cov":"istanbul cover _mocha -- test/*.test.js"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"repository":{"url":"git://github.com/node-modules/jsonp-body.git","web":"https://github.com/node-modules/jsonp-body","type":"git"},"_npmVersion":"10.9.0","description":"Helper to create more safe jsonp response body for koa and other web framework.","directories":{},"_nodeVersion":"22.11.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"autod":"*","mocha":"*","jshint":"*","should":"7","istanbul":"*","contributors":"*"},"_npmOperationalInternal":{"tmp":"tmp/jsonp-body_1.1.0_1736584451751_0.6872550938582851","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"jsonp-body","version":"2.0.0","description":"Helper to create more safe jsonp response body for koa and other web framework","homepage":"https://github.com/node-modules/jsonp-body","repository":{"type":"git","url":"git://github.com/node-modules/jsonp-body.git"},"bugs":{"url":"https://github.com/node-modules/jsonp-body/issues"},"keywords":["jsonp","koa","json","CVE-2014-4671","abusing-jsonp-with-rosetta-flash"],"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"https://github.com/fengmk2"},"license":"MIT","engines":{"node":">= 18.19.0"},"dependencies":{},"devDependencies":{"@arethetypeswrong/cli":"^0.17.1","@eggjs/tsconfig":"1","@types/node":"22","@types/mocha":"10","@eggjs/bin":"7","eslint":"8","eslint-config-egg":"14","rimraf":"6","tshy":"3","tshy-after":"1","typescript":"5"},"scripts":{"lint":"eslint --cache src test --ext .ts","pretest":"npm run clean && npm run lint -- --fix","test":"egg-bin test","preci":"npm run clean &&  npm run lint","ci":"egg-bin cov","postci":"npm run prepublishOnly && npm run clean","clean":"rimraf dist","prepublishOnly":"tshy && tshy-after && attw --pack"},"type":"module","tshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"types":"./dist/commonjs/index.d.ts","main":"./dist/commonjs/index.js","module":"./dist/esm/index.js","_id":"jsonp-body@2.0.0","gitHead":"7f7fb55a0c9d02c17aa8ee44bfeaccc092b41e1a","_nodeVersion":"18.20.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-9VZNeFvIO6gjtYiob3KW3HzxMgq8UEO0xUaUaQ1e8eAeOVlCAs49CtrdMXLma8y3GC/lsyfnzZDTrBWkdGxi2g==","shasum":"ea504901e450157d4e00d01fa12a5257694a176a","tarball":"https://registry.npmjs.org/jsonp-body/-/jsonp-body-2.0.0.tgz","fileCount":11,"unpackedSize":13484,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/jsonp-body@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgVpj8OREM0mkx5mxb19FRQ5XQmHp1bdiR/VzjwMHfjQIhAPWHpJvs6vjE87TSU1mg19JgzcUr3vh4yWhVtJFGVOcj"}]},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jsonp-body_2.0.0_1736586605842_0.7826538614479888"},"_hasShrinkwrap":false}},"time":{"created":"2014-07-17T14:54:02.277Z","modified":"2025-01-11T09:10:06.778Z","0.1.0":"2014-07-17T14:54:02.277Z","0.2.0":"2014-07-22T04:42:18.508Z","1.0.0":"2014-08-19T09:34:22.438Z","1.1.0":"2025-01-11T08:34:11.939Z","2.0.0":"2025-01-11T09:10:06.048Z"},"bugs":{"url":"https://github.com/node-modules/jsonp-body/issues"},"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"https://github.com/fengmk2"},"license":"MIT","homepage":"https://github.com/node-modules/jsonp-body","keywords":["jsonp","koa","json","CVE-2014-4671","abusing-jsonp-with-rosetta-flash"],"repository":{"type":"git","url":"git://github.com/node-modules/jsonp-body.git"},"description":"Helper to create more safe jsonp response body for koa and other web framework","maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"readme":"# jsonp-body\n\n[![NPM version][npm-image]][npm-url]\n[![Node.js CI](https://github.com/node-modules/jsonp-body/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/jsonp-body/actions/workflows/nodejs.yml)\n[![Test coverage][codecov-image]][codecov-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n[![Node.js Version](https://img.shields.io/node/v/jsonp-body.svg?style=flat)](https://nodejs.org/en/download/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)\n\n[npm-image]: https://img.shields.io/npm/v/jsonp-body.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/jsonp-body\n[codecov-image]: https://img.shields.io/codecov/c/github/node-modules/jsonp-body.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/node-modules/jsonp-body?branch=master\n[snyk-image]: https://snyk.io/test/npm/jsonp-body/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/jsonp-body\n[download-image]: https://img.shields.io/npm/dm/jsonp-body.svg?style=flat-square\n[download-url]: https://npmjs.org/package/jsonp-body\n\nHelper to create more safe jsonp response body for [koa](http://koajs.com/) and other web framework.\n\n## Install\n\n```bash\nnpm install jsonp-body --save\n```\n\n## Usage\n\n```js\nconst koa = require('koa');\nconst { jsonp } = require('jsonp-body');\n\nvar app = koa();\napp.use(async function () {\n  this.set('X-Content-Type-Options', 'nosniff');\n  if (this.query.callback) {\n    this.set('Content-Type', 'text/javascript');\n  } else {\n    this.set('Content-Type', 'application/json');\n  }\n  this.body = jsonp({foo: 'bar'}, this.query.callback);\n});\n```\n\n## API Reference\n\n### `jsonp(obj, callback, options)`\n\nGet `obj` jsonp string response with `callback`.\n\n- __obj__: object convert to JSON string\n- __callback__: callback function name\n- __options__: optional for `JSON.stringify`\n  - __limit__: length limit for `callback`, default to `512`\n  - __replacer__: replacer in `JSON.stringify(obj, [replacer, [space]])`\n  - __space__: space in `JSON.stringify(obj, [replacer, [space]])`\n\n## License\n\n[MIT](LICENSE)\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=node-modules/jsonp-body)](https://github.com/node-modules/jsonp-body/graphs/contributors)\n\nMade with [contributors-img](https://contrib.rocks).\n","readmeFilename":"README.md","users":{"ruizhao":true,"edwardxyt":true}}