{"name":"phin","version":"3.7.0","description":"The ultra-lightweight Node.js HTTP client","main":"lib/phin.js","types":"types.d.ts","scripts":{"test":"node ./tests/test.js","prepublishOnly":"npm test","gendocs":"rm -r docs || true && jsdoc -R README.md -d ./docs lib/phin.js"},"repository":{"type":"git","url":"git+https://github.com/ethanent/phin.git"},"keywords":["http","https","request","fetch","ajax","url","uri"],"author":{"name":"Ethan Davis"},"license":"MIT","bugs":{"url":"https://github.com/ethanent/phin/issues"},"homepage":"https://github.com/ethanent/phin","devDependencies":{"jsdoc":"^3.5.5","whew":"^1.1.3"},"engines":{"node":">= 8"},"dependencies":{"centra":"^2.6.0"},"gitHead":"5deab76adc41c660d3470596395429758f97bea5","_id":"phin@3.7.0","_nodeVersion":"19.0.1","_npmVersion":"9.1.1","dist":{"integrity":"sha512-DqnVNrpYhKGBZppNKprD+UJylMeEKOZxHgPB+ZP6mGzf3uA2uox4Ep9tUm+rUc8WLIdHT3HcAE4X8fhwQA9JKg==","shasum":"eeeff7660408515d8cf0c6252901012d4ab7153b","tarball":"http://registry-npm.ywwl.com/phin/download/phin-3.7.0.tgz","fileCount":5,"unpackedSize":13062,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEbWMbatYljLNRZFHkMWuXxcyNWERV9ouxvKGAvEtc6MAiA/961M1p3lUM44E7fHlmU+43xjjUqXIzNiciMo8seYJw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeUPlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUVA/+IIDKADA8XAYbWXAp3g86tCFSrizlKjbjuWkz197L/eNygyvA\r\nCgtInqiNd4u7/VmDWRU9wMvELgkQCz+rrZAHJghpD/KWYXKVtg80aX5EspHb\r\nagFsTFQvE9iXBZGFGv6HwXlL8KjZmAko2dpr5Czn8qgpP7LeoDSwajk0YozX\r\noG/dLZVY1qQomvQhtAlEawCdc7B1uDnx3h33wlQZcm1mMZlY5D8qnatkj0gK\r\nAb/Ab453Lp5nenJLVrc8brEGSQ7mbAUK2+7yp4Xg8QOIwjnXSPrwfOGeD4kE\r\nGcyLgYDNSGfJ7qyuSxGnW9jDb864MSlIY6gWbjFcK6M3E9M5Y2nKsPJMU7p+\r\nv8JzWS6dmv5sQ3w15+pRp0gyO50IFPFdf1nNZmuIjM4WNulRKdxvOt2gyOir\r\nn/QtZJiZ7y0QH3gKLvWIkAyLm9+esCcj214sWc3brS0efFALfUf2pdf7MhFC\r\nnxTNZlLr5JlrYuVydX7ox7cqxr2vYkXI4/HkB3mcR1n6P1JmkwFHcCmgfrmU\r\njFUpuzk+umK5Vedm/YMcpHPu5ji4YWDhZC2Y0Wz3pJ3yuynoa9U8bOggxzDM\r\nEPE5Hj3Fa7nPbHZsZrCyaoBD040nnAhs5hE8Sx1J5VbFfWZ5F3LEsorFx08t\r\nU8+oYtrM0vIMwiVYaLec80EOPpDm/VmHNcs=\r\n=60Dx\r\n-----END PGP SIGNATURE-----\r\n","size":4746,"noattachment":false,"key":"/phin/-/phin-3.7.0.tgz"},"_npmUser":{"name":"ethan_","email":"futuristiccake@gmail.com"},"directories":{},"maintainers":[{"name":"ethan_","email":"futuristiccake@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phin_3.7.0_1668891621231_0.2779135910263195"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","readme":"<p align=\"center\" style=\"text-align: center\"><img src=\"https://raw.githubusercontent.com/ethanent/phin/master/media/phin-textIncluded.png\" width=\"250\" alt=\"phin logo\"/></p>\n\n---\n\n> The lightweight Node.js HTTP client\n\n[Full documentation](https://ethanent.github.io/phin/global.html) | [GitHub](https://github.com/ethanent/phin) | [NPM](https://www.npmjs.com/package/phin)\n\n## Deprecated\n\nThis package is deprecated and should not be used. Please see [#91](https://github.com/ethanent/phin/issues/91) for more information.\n\n## Simple Usage\n\n```javascript\nconst p = require('phin')\n\nconst res = await p('https://ethanent.me')\n\nconsole.log(res.body)\n```\n\nNote that the above should be in an async context! Phin also provides an unpromisified version of the library.\n\n\n## Install\n\n```\nnpm install phin\n```\n\n\n## Why Phin?\n\nPhin is relied upon by important projects and large companies. The hundreds of contributors at [Less](https://github.com/less/less.js), for example, depend on Phin as part of their development process.\n\nAlso, Phin is very lightweight. To compare to other libraries, see [Phin vs. the Competition](https://github.com/ethanent/phin/blob/master/README.md#phin-vs-the-competition).\n\n## Quick Demos\n\nSimple POST:\n\n```js\nawait p({\n\turl: 'https://ethanent.me',\n\tmethod: 'POST',\n\tdata: {\n\t\they: 'hi'\n\t}\n})\n```\n\n### Unpromisified Usage\n\n```js\nconst p = require('phin').unpromisified\n\np('https://ethanent.me', (err, res) => {\n\tif (!err) console.log(res.body)\n})\n```\n\nSimple parsing of JSON:\n\n```js\n// (In async function in this case.)\n\nconst res = await p({\n\t'url': 'https://ethanent.me/name',\n\t'parse': 'json'\n})\n\nconsole.log(res.body.first)\n```\n\n### Default Options\n\n```js\nconst ppostjson = p.defaults({\n\t'method': 'POST',\n\t'parse': 'json',\n\t'timeout': 2000\n})\n\n// In async function...\n\nconst res = await ppostjson('https://ethanent.me/somejson')\n// ^ An options object could also be used here to set other options.\n\n// Do things with res.body?\n```\n\n### Custom Core HTTP Options\n\nPhin allows you to set [core HTTP options](https://nodejs.org/api/http.html#http_http_request_url_options_callback).\n\n```js\nawait p({\n\t'url': 'https://ethanent.me/name',\n\t'core': {\n\t\t'agent': myAgent // Assuming you'd already created myAgent earlier.\n\t}\n})\n```\n\n\n## Full Documentation\n\nThere's a lot more which can be done with the Phin library.\n\nSee [the Phin documentation](https://ethanent.github.io/phin/global.html).\n\n\n## Phin vs. the Competition\n\nPhin is a very lightweight library, yet it contains all of the common HTTP client features included in competing libraries!\n\nHere's a size comparison table:\n\nPackage | Size\n--- | ---\nrequest | [![request package size](https://packagephobia.now.sh/badge?p=request)](https://packagephobia.now.sh/result?p=request)\nsuperagent | [![superagent package size](https://packagephobia.now.sh/badge?p=superagent)](https://packagephobia.now.sh/result?p=superagent)\ngot | [![got package size](https://packagephobia.now.sh/badge?p=got)](https://packagephobia.now.sh/result?p=got)\naxios | [![axios package size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios)\nisomorphic-fetch | [![isomorphic-fetch package size](https://packagephobia.now.sh/badge?p=isomorphic-fetch)](https://packagephobia.now.sh/result?p=isomorphic-fetch)\nr2 | [![r2 package size](https://packagephobia.now.sh/badge?p=r2)](https://packagephobia.now.sh/result?p=r2)\nnode-fetch | [![node-fetch package size](https://packagephobia.now.sh/badge?p=node-fetch)](https://packagephobia.now.sh/result?p=node-fetch)\nphin | [![phin package size](https://packagephobia.now.sh/badge?p=phin)](https://packagephobia.now.sh/result?p=phin)\n","publish_time":1668891621423,"_cnpm_publish_time":1668891621423,"dist-tags":{"latest":"3.7.1"}}