{"_id":"@root/request","_rev":"42-8aa618bc50afa14c6682b266bafd7c63","name":"@root/request","dist-tags":{"latest":"1.9.2","old":"1.3.13","beta":"1.9.0-8"},"versions":{"1.3.8":{"name":"@root/request","version":"1.3.8","description":"A lightweight drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.ppl.family/ppl/urequest.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"solderjs@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"999797270f39cd15e6d400879d789c94cd481289","_id":"@root/request@1.3.8","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-Ozzvu75Nqpt0DWxQTklBa81n8jQAcr+7PVoYi6nQLLokIS2UA+bm5zCQX0q4HV/ZmmjQKu9YwqvpK4Fc1IHOYA==","shasum":"5109a7a00c06f287c46fea2d4f62031aadd8fb5e","tarball":"https://registry.npmjs.org/@root/request/-/request-1.3.8.tgz","fileCount":4,"unpackedSize":29290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpbUsCRA9TVsSAnZWagAA7uwP/01p+XrvRC/i5Tf8m5FD\nGAtl/NLu2oWgnhL4yBaZkNZ9nPND0x2Fryga+5DBYRCxGGh5lU/P33dA3T4l\nwX//rvF2Kzb+777yYIOpVZvOQv+QujHypXfVSBNI9EF+gqI7mgITPGVY7rEX\n/IR7qoCd+Bdvjqth8My1isvLg/tR70hSLdBQw2JmwjyXyWEkVUrigRCIGCdM\naDDSszr8OgsFsg+dpWqOOUMNWl4MvB/irLDpc7wl2SSdnWPs75q8P5Nn1qbQ\n8S893p4z4h1ow9oJqsQP4etgimDFhg697GouRMTjHU/3Fz5KtFi+WNwV22Yg\nXBhl7Js0BaWEWEyHVOx0qnpQqvg3meY9FrN1jATh5lVzp4tqF4FTNdb82M0Q\nO5eeF9tBXetXhTtuJfpzl5GiS73+DphETVcByKMBnB8ungJdqvQuWFcyKXyW\nRBw2A+Me1VMQnMUZm1ZVSAA0rXpmoP0E58kJWUgix3sxgigBO4WDl298NHlx\na3x7ICGfYN5dw22P811nyDBahkHbyN7RpzK+DxUkX7yngPQFAhp2cohkIzqe\n4nqBpQhWqWrVf1ZP+9w42DC0q5UbBUttcRcaw0VLkqtJLtdZrXFHPEF3EuA9\n6Kb/X5qU+QIJBbgMSH0zyrQiNCDKNciIrWJS6C5Y/drBEO4QA0U+OGGv4hkx\nf2PU\r\n=I1T3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGP6HE3LUNrVLAp60//+cLujjbtWdShApS/4NA9eqPjhAiEA29FyUTO+FateZcQnv0OQFcto2Qqm0ccD0zOCOsD2ga0="}]},"maintainers":[{"name":"turleybw","email":"turleybw@gmail.com"},{"name":"thejshaver","email":"john@jshaver.net"},{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.3.8_1554363689431_0.7762940127127511"},"_hasShrinkwrap":false},"1.3.9":{"name":"@root/request","version":"1.3.9","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"solderjs@gmail.com","url":"https://solderjs.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"1d4c3c1997d02e229dad207ad6be6785a3e2f8bf","_id":"@root/request@1.3.9","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-9+fgHkZUI8DltsQnMJmYzj/mYzFz8GvT6kBQkxIoqZuH7EZ4Vs+F0hAVvPiRuMv6o+a3MnsYDq3m0pxx949XvA==","shasum":"76920c523f5af4358469fde8ea4c062506aac4b5","tarball":"https://registry.npmjs.org/@root/request/-/request-1.3.9.tgz","fileCount":4,"unpackedSize":29299,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctiHWCRA9TVsSAnZWagAAFI0P/3rV2gWDq+cIzXcLNSvc\nJ+Pz+mQm0UxCv9gP/E7dAL4Yolrpwy6TftKg4M8c44zKwtyPvGeCHxJBcaNX\nCeuCChXtAJySuFV8tl/lJeP+38IK0SkfwTYCB3JUwG7f/jmKYwx6xB35fExl\nDPJENvUDav/2j0g0kiPlqXPx+q7zhVxpNGcY2hUSumLn0Ca9HLU4xioyw6N/\nv/sMLD+oatL0nB409f3Hey0Ny/LG9ask7jG5kIa9/G8XLDwS83/bWFeFf+33\nyonU4D6d+2yxJuHxKMThJDL56hBEwOGn3GcNnobB1ZUve6cn8uUn765NPXwW\n5NTYccqkJSWC/JTTeHWbfqq66xlvYy3hV6eWXJfHtkCpa4ICEoL74HmS/eLm\nFNzGG+LK469YEaWpNIOFYEkENq3lk6ORS61zmENDkqxfh7mcOgeVSqH0rZYZ\nWwdLIRGzkEmGCqEJ7F6q4SPemMtiAcvg/jJodX1zlojfDYXoE9rojH7cf3gL\nL+8JIx12N8YzJsBp/x+0Wf31e+DaJXnJ0rAb33M64gIAMQv6fWrQrzzjJMpY\nwQu9lw2XJ1L8newqDxHiANTLT/PuOCe664CtVKJy4Ed+egg0o6Lvj0dHNAhw\nqqU2wgzYd6+rF72/4CZIILg8fIhVK7AnJk14C93QutDFL4uDOi0TVh3QZrZ6\nGl+x\r\n=FqJ3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH4wGtPGMQrYwSxQWcnPG66/deNUuj34/Li/buLxzmioAiEAvXehmFGcVfHDxwPafGK9Wvizo72WGCAGxRbgy7/5TRM="}]},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"},{"name":"thejshaver","email":"john@jshaver.net"},{"name":"turleybw","email":"turleybw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.3.9_1555440085786_0.9646976558879732"},"_hasShrinkwrap":false},"1.3.10":{"name":"@root/request","version":"1.3.10","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"solderjs@gmail.com","url":"https://solderjs.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"28f3f783aedeb117f96d2b039dc6df8de64fe3bb","_id":"@root/request@1.3.10","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-GSn8dfsGp0juJyXS9k7B/DjYm7Axe85wiCHfPs30eQ+/V6p2aqey45e1czb3ZwP+iPmzWCKXahhWnZhSDIil6w==","shasum":"313f09764515d3327c178a2e74c7a5beab5d117a","tarball":"https://registry.npmjs.org/@root/request/-/request-1.3.10.tgz","fileCount":4,"unpackedSize":29373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctiJZCRA9TVsSAnZWagAAa18QAJriKw4aKfQJQraKeLIW\n35N2vw2//Sxr2wSOuIJcQcv1ITTkcDEyKo8TOtzGQoif7cX2va2egjUPWhjd\nlhL8mdkvhKVl9GmnjZp/1qnfXBYgc3IFP1DNeTWz473nDaMTX63dDCrPqE09\nF53WUJ84hX8qct6LhEq2GHXAmBKgIGUiItru1NHRezsXIGG2nxWBif4Top6c\nT0e6gelaEJAyAOfLuWg0MSM/IgpkRFM3RwpPNPaNN83DiB7+CalLODJmu22P\ne+tGCqj688jaZU8cuZWYoHbU6T7MH3uMWASn6bfx75TyRjyFA2hIXnAhfwhE\nEDZ+AZt9HT9+rFxUdJV8dzSAdbtYcWu/3Nt6FbPLN4Kwgjsfp4f2FWeoe0T/\nnBRP8mch41mcSXuHODn/0plcYid0w62i612TUBCtpjBmme/dR11Dpc3KgYfm\nUTyEl9C5fAqjYLJreXnOeDsZEu4CxQBNKPFAzSsIkAY9Sel93hXMF03HMMKR\nOR+PUpC3IrydKPoxRBLdYjBUVE1knkSk59ZMEu0vqnh3A+bH0J3Btf8d0Oiq\nlcZKe37QVzeY+M54aiVLeFUQP3fZe8MaXwl+42D4dLq2zUX+6q1enyZROX0R\n96dMb+C3qPxwMZ2aISEK5+MSpiF9Zgmtc65gbfB4GyeIDOsMfaHXGhyiKUmx\ntoZD\r\n=i4Xl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0kNOqiocLSPhpISUanoK+oesFWgK8yx5uNj3H59YGZAIhAOJCu4dJWdnA3wDbJyl9NKgOkIG675mxwLO5igSJSJJo"}]},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"},{"name":"thejshaver","email":"john@jshaver.net"},{"name":"turleybw","email":"turleybw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.3.10_1555440216404_0.6183287452259063"},"_hasShrinkwrap":false},"1.3.11":{"name":"@root/request","version":"1.3.11","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"solderjs@gmail.com","url":"https://solderjs.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"335dd9863185c6d9fa1927c605d01e67d2b89136","_id":"@root/request@1.3.11","_nodeVersion":"10.13.0","_npmVersion":"6.9.0","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-3a4Eeghcjsfe6zh7EJ+ni1l8OK9Fz2wL1OjP4UCa0YdvtH39kdXB9RGWuzyNv7dZi0+Ffkc83KfH0WbPMiuJFw==","shasum":"b72df33c2a759443466939712be74fd8c5b9e554","tarball":"https://registry.npmjs.org/@root/request/-/request-1.3.11.tgz","fileCount":4,"unpackedSize":29381,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5vRPCRA9TVsSAnZWagAAM8gP/1TEivMoP7LZLbodafuR\n/+kUG9EpQXJMNN8O+Ib/dWqzBaMcrgqLHOECu/RTIFMH2BzMfgEObUdd7yHu\n0LLieOuU4+6qQA6FlBct3Gm+93Y+EZhCGQ3q5MqOFCEt2cSghV/gBcbMbtBT\nh4XTMPirp3ZMQ6uXgNNuTs/jPO8jCss73o2u5oC8WnTsJxX0UFBuVEXRizyI\nGjGmuZSq8dMGJX6F8tujPe1vkixrw42e3jV51Hb2N13iQXh5O6fxdJnuTbxe\nC0YZYh0/KOzNFmDE5+z51ueUsGZ3j8olEP8qwFn0cQH98U5AVFtGBvQD00C5\ny+UuiAQB+YmXVyzk6kRd9TGw0enF1Su89rY+rZixVpDeKdLbea3VLfIvXONh\nmcS0U8Yxrq/uVHJrhhx+PRIS0QiqSuQ5BvFM/g2Pe1QI9brX5JJBqHGio0xM\ng9RSeGWTZe3eSep4rHgaNbRvRry48ijxJurWkKfTImEzz+dTGkPiou0JhrHl\n+MDMDTs6f2irvAt0iJkPfoc5KSBa3Hs5W5uZpDug77CXfURk8+aRGX3+RVqQ\nNR4+Qy80YXKBkpwO7yUj5KyAhGsuV0BhRizq+4VrLqJ+/uEPk/M76UyAKjsE\nm1RoJjiq69wkfPYb+APKy+DqgDRHKdvFqZJ9lI2yWGKGxODxd26zXMoj7zna\n1jj8\r\n=xig7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIADB3+U5n45IlsD3QwiZvCaqzk8Mrzby/nJ//it42F/yAiBxTdX8R+9wpgX0+82kFSJlM3xIIgCV7eISVNjsuRjSOA=="}]},"maintainers":[{"email":"coolaj86@gmail.com","name":"coolaj86"},{"email":"john@jshaver.net","name":"thejshaver"},{"email":"turleybw@gmail.com","name":"turleybw"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.3.11_1558639692568_0.7220824355950701"},"_hasShrinkwrap":false},"1.3.12":{"name":"@root/request","version":"1.3.12","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"solderjs@gmail.com","url":"https://solderjs.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"1507b38503bd0459d0cedc490d3424aff68c5c0e","_id":"@root/request@1.3.12","_nodeVersion":"10.13.0","_npmVersion":"6.10.1","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-ie3YCRQCRfekWOI30H8sICUVbKFoWlpNjH1TzTjq+KhyBFKftQ/1MdN52BJAnAiUD4vg14/Km2SOsmF781jJAg==","shasum":"b3be35b8c1b4e4e094e38ac297fce103f5be71d4","tarball":"https://registry.npmjs.org/@root/request/-/request-1.3.12.tgz","fileCount":4,"unpackedSize":33582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJduKReCRA9TVsSAnZWagAA12cQAIwdgoRdHWbVw5ZdkIYp\nsFbOOtvZ6yZAHngKgujMgzZRXu76ctEdm/QaH9O6fxRwYojorw9WdWxrWnv9\ntNDFDzrQ6DieOi3h+HLkav7kae2t1EvNP/k9iMrkHkW/N/q5Slc5luHgiw+d\nlP+X5noIjs9St384kLtkFSpB9oRYh8JXGK9zxKDUxMU1MmyiIqivSxSM1NZQ\nZ4VmwVtXyL3rJTrgsTb8CiJolNfxPU6PYIx2IEjIm6yJm4s7W7/RPzHQZ3w8\nA/uYZplI/omMoXZUVHyxe1EnQ8AgJf3aw0CSENLh0tBJ2zUulW5ZFh0as10y\niiZWQ68/LHbL5qtlHjPFUfnXJhsuCt08hYoATl+/95NawoMxP2YpVHkpXwVR\ne5XsfsEURYtMfoDih08zCBvSIq3ckyiZ62PJEmsgdvYgGPwhIcNg5Gjd6863\n01GWZJ5eXYOWN5XocuRPr/0EgptVLGY0S8rVx3yK3opYzv7Ma8T6UAv/gTlE\nW5EMhpU4AFvSofG8d7jnjh5tIO35ehKa7PSzmpQ8Ec9cdBCx5ijWemaEO7YN\nnRlizb30ToM3P4C6tiY76QJv3QOn3d5vXozgqMsopiPBFdSSNS5ZSJZxyFoU\n7u3yqkniippuwNxrSEBNBS/9PFPeDKAJk+xk1wIvjR5y+W2JGwExLgqf3AXu\nuGB9\r\n=/gZh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHlMJ4dF70xxTAMwKPgvJXhHOMhBLWU0ue0DTfKQHcXJAiBMkCTP+y91tmBLzc4Q+PM9A+Ez31HNTPzzaQhQIwnBSA=="}]},"maintainers":[{"email":"coolaj86@gmail.com","name":"coolaj86"},{"email":"john@jshaver.net","name":"thejshaver"},{"email":"turleybw@gmail.com","name":"turleybw"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.3.12_1572381789842_0.9612381095059057"},"_hasShrinkwrap":false},"1.4.0":{"name":"@root/request","version":"1.4.0","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"solderjs@gmail.com","url":"https://solderjs.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"8f5133385b498a466c1bba75c37098d5ae587325","_id":"@root/request@1.4.0","_nodeVersion":"10.13.0","_npmVersion":"6.10.1","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-dlFiB/BRy6RYBj2SHf4wUwq6fc0Uq4vrZa3fjQujpZTZbOjBCbsiaBA1pPZi93YaMLky8Adth/Jr4jWIpJNZ3w==","shasum":"ffea7b0c6c226ec713c79986b2236dd8d5457c27","tarball":"https://registry.npmjs.org/@root/request/-/request-1.4.0.tgz","fileCount":4,"unpackedSize":34931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJduKfNCRA9TVsSAnZWagAAm9MP/0sOt0umMS51js29SASs\nHcMXEJDkWcl5zWfGos5ZzjaZEHUaDCV/1iZIJ//fEGGZBa3q4C4/B7k1lo1/\nrTi5+ZsqQAYwGHVcGqV/JidREa/mCAXJCH6+C8oSKduXIq7WMy7phC//dZXh\nUv0gbatP7mmnGPzhsgGbJBLMsu/Igz4nBO8vZu1KhQxehZ4tePN8alHY+QWC\nZjkCfButqZw7N61WshwE4+wXe3EP9Cx3DoFtfbiBAN6XUtxoozwqeT7LOb1W\nmRLXM7ATVVIb3J5Ug3pf195/ZCqiFwe++DO01b3mTM/A4G5MICHB4Ww8guza\ntM25LyK5dYE1pnIPiEYOOISVZf+oSepFzW5TxEUIQi7dWDcUX/nczrZRmvha\nztbiXIUqChGEcTe168oNgQ9h5C7LzIJCo4nCO9FeFHVJqJvX8FMMm6KUrHJv\n+jJT7mCQS0eS+NXC8o8r0+xZPvn3KEHKmsGXI8MYn1TjTccRjF8nR7BegMO4\npI0UxpB3EopbGnfo/wGC4ry0dl29QcGbafysKuwotj16pitZwQ10iFTKQck4\nII3yfa6V0bXm0gZn4qRenbguAB5fc9EjnqmVtY9DI0FH2Ci5mCb85MtHZHNG\nvbQH1rEZeWux2PkFWLjDcXcB7evyuKwPYq7iSCzYKzFYtTZE01h8O09p5QyR\n/jKe\r\n=RYCN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDEazSb9WapJBpQfIofdQgS+wbkzlWUhvseJGl8uC+/3AiEAxLQj0f6bsNX+uO9107BRKCDv1mWMtLqOKYKh6hNzn9I="}]},"maintainers":[{"email":"coolaj86@gmail.com","name":"coolaj86"},{"email":"john@jshaver.net","name":"thejshaver"},{"email":"turleybw@gmail.com","name":"turleybw"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.4.0_1572382668741_0.2868795510085178"},"_hasShrinkwrap":false},"1.4.1":{"name":"@root/request","version":"1.4.1","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"solderjs@gmail.com","url":"https://solderjs.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"1692b9e7dfd32f8e720bfdf41f724cbfb4255dd6","_id":"@root/request@1.4.1","_nodeVersion":"10.13.0","_npmVersion":"6.10.1","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-2zSP1v9VhJ3gvm4oph0C4BYCoM3Sj84/Wx4iKdt0IbqbJzfON04EodBq5dsV65UxO/aHZciUBwY2GCZcHqaTYg==","shasum":"93a9dbfe8f219dbce3536baf8551e377819d3e3c","tarball":"https://registry.npmjs.org/@root/request/-/request-1.4.1.tgz","fileCount":4,"unpackedSize":34933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJduQlgCRA9TVsSAnZWagAAENwP/iQfdzKpjoowfey2D79h\ne6HYd7r0yj5PNEMUyFlJEkRMWrDSKRtfSfglu4gcMMVhoRnmfJIimjPkpIwJ\n65Qttuc2YvJ4LvYx0qZhhLSDFGb90DwyONTMGAwVVRmLS2IBUTJBuVyAvbRN\n8F6YPCfp4ZtFggp+xSTUf6L2wuGe/DWxO6HbeeiXzBXj5CdkcyAcW9Y4In5l\nybg+f2L3SkQGPX9ALg5twQEIHXmCIVSvxtqXNugW4Pf0jluocysw13rcHaQY\nJc4rBZ2c/4+uZoGMHS7iR/kf/KLtXXU6JwykO2WSz3xohAtg+3BKt0ez1Prj\n8I8lLFA1p85F3cLgYicdy8vwTDivhIYtFw7Atw3nnh+VnyDKnlhazUUFu5JJ\nk8AVeNnkLZg3ML1dCMEFqmapXLdLOSeFeDecj6yOvI9e8lVdk4BK2XRECvwH\nicEjDi2ey06mO2v8gpC+48PfjwB81c8pWWjHXoWWC84mCE69HMm29uVpiEeh\n6zFpXlVt4bvzrEKzspzL0YDdY6CEsGDKaR0rs+DhwT2v97Dzp+FqPkUt9iva\n5RCYFgDc1cZSaExmunh07qvWT4mVN05szaL4PXzrpCin61HMnn1cLaroy1qT\nuQct+YpnQCECREBKRL3T0slam4XP2hrWVPFKcvWOquU6HHeeN0x6UVwVsV/h\ntRPk\r\n=pn8n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRhrzrrl82tRmotDlUUCc3xORziOI3CiK5CVVnkVSE1gIhAKx4OTAbyinnYOEn+DGuOKiWuMgKNMUkQ0MFeDIhFDAp"}]},"maintainers":[{"email":"coolaj86@gmail.com","name":"coolaj86"},{"email":"john@jshaver.net","name":"thejshaver"},{"email":"turleybw@gmail.com","name":"turleybw"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.4.1_1572407647519_0.32439775650482017"},"_hasShrinkwrap":false},"1.4.2":{"name":"@root/request","version":"1.4.2","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"solderjs@gmail.com","url":"https://solderjs.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"87bf5a5fc504a81a8fd2569df9cf559a7713260d","_id":"@root/request@1.4.2","_nodeVersion":"10.13.0","_npmVersion":"6.10.1","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-J8FM4+SJuc7WRC+Jz17m+VT2lgI7HtatHhxN1F2ck5aIKUAxJEaR4u/gLBsgT60mVHevKCjKN0O8115UtJjwLw==","shasum":"a51e93c64eb8b9b0df06f34677e63d8239c4311c","tarball":"https://registry.npmjs.org/@root/request/-/request-1.4.2.tgz","fileCount":4,"unpackedSize":34928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdu9xZCRA9TVsSAnZWagAAv2gP/iIAcVV1l4+n5I1PYWNa\nZd736S9g73wFK51yy8loOYDHtLffVBLYwsQLPTdhiprr8mMPm7aD8WwvSDsu\nlrD60UvuIYciNnFUeDBPbg8jU4vsco5HyJhorr8Tj1cjvm/WXjyhyU4t/vnL\nhqcdIYCcw0RE+qvZ07Zq3oDBdOtURniR1Cc47e7/yuUpyoJ1608G9L2am1nu\nNSsinfUfCiyTQ79q4Y4eYDTwqQ9rTQahDVynA5+Q0BraNfAI9bFce3GRBc4+\nBXmVwZCzpI0tPyBdlEdX8cwxxWUU24AHgd43ymmDQbbiHU5mWBOoN3jZfl7r\nlLtkUrCfjrHfiocJmPZ0bXhZ1hfziRrKvgqqmBHamVgek/zJpCyj5CxijWz3\nzXpuWG0wImNc9z7FQ7VwHJ0BLmIet7Z89+2rJwPxyF61d86v02CH5dI+jCwz\nD9QQfWb9kH892YpQ2H5e0ES7Mu6GbjHGzIh6Urh7cJOGDcToUq8r5mGKnK1Z\nVOK4yQl1nQRRe833eqyh99UaP0HViB7c2nOhTtnN5DyAkxyPSx4wUVJK43Jl\nNXQZzdEGNfgdZuj9ggblTcbxMXcm51/7gL2JSOCXF7UGHyURNqsZS/ofDNlj\nIZ+MqDTd12ur9cs7CBYOHin4DMs8/4ynET5W9pSeLIpJGoca7R/JGt6mrpCA\nqeqn\r\n=bH41\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdSGzNwSjq1t8n3S4zsPKXdEIv8QiQchDWtomc5loLXgIhAOP/VD8IgXAO3Hj+h285cXRfpSYneT4DX5jXNaRfVvpd"}]},"maintainers":[{"email":"coolaj86@gmail.com","name":"coolaj86"},{"email":"john@jshaver.net","name":"thejshaver"},{"email":"turleybw@gmail.com","name":"turleybw"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.4.2_1572592728862_0.29307171989429626"},"_hasShrinkwrap":false},"1.3.13":{"name":"@root/request","version":"1.3.13","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"solderjs@gmail.com","url":"https://solderjs.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [µRequest](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and drop-in replacement for) request.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\nµRequest is designed to be a drop-in replacement for request. It supports HTTPS and follows redirects by default.\n\n```bash\nnpm install --save @root/request\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function(error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar promisify = require('util').promisify;\nvar request = require('@root/request');\nrequest = promisify(request);\n\nrequest('http://www.google.com')\n    .then(function(response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function(error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n## Table of contents\n\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Forms\n\n`urequest` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function(err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function(error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`urequest` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=urequest node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"d90f397d8dbacf5d9484360209795a87a3295be8","_id":"@root/request@1.3.13","_nodeVersion":"10.13.0","_npmVersion":"6.10.1","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-2QEBfVebZIROGNWiMf3axGNc0hiY5U6ta/foWtAo8vvILAk+f5FzprihACS613bvMCMuFvOWKP2lm2HV9J29fQ==","shasum":"367542b5951d2174524ed14cd577883864f69aca","tarball":"https://registry.npmjs.org/@root/request/-/request-1.3.13.tgz","fileCount":4,"unpackedSize":33579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdu93WCRA9TVsSAnZWagAA0x0QAJfqyLJpVO6Srdkpzqg6\nKQHPi5Hu6GtdKdBhZf8DLS+bZPWcRaLJjisNqEioGK5Z5WbHEpf2UVF0Yd1c\nUXQPPc3RnNx71coiJMaGmheunAZR/fImQqoxkuVfKIKjraHesR8QWFe0Rc1U\nTLTpd+gfTVTYKOeirSbCGyTQpXoDVnOu/e7BgMUlp4rSrgfjQWyPuMr0JWIg\nWQewe5mLtfTla6kvY2VmfqlhyhT/5D9fXz5R6NAQWpZXHKaH2Su2fk+jkonk\nBJXO9+IPXYO4GR4InEerya8YJ2yXLBmeBWmAdsFHHRiVadHMXWlldlpQ1Iwc\nYc6RhKqORvSh8UsIXj+A9NYJkwxSxVvcikiazC9M7fptN5Jtth2JiU46hixX\nQ0uDjADplaa5qFFhjXAAL47zvEhBJaPWdJSXUFsmzB1D6h5cUdVhQShi4y9z\n0Wn0tB0BYUb0otxvvilip0ffIU8yM9RZbdgJi5WKMCX9N7sRI4HZigZtJN3k\nZTvRTF7AncahfPUVH+JzgsqMlkEgIq04sm9IoGWpcC34PtO80Em+f7mSnUFz\nKbO4p0CPOLKVIslLAZ4R9GHrG4gNI3F/g0OVR3jOcyYefHAvETTZbq2114al\nzXqJXi/HmI5PD9/BFrKApmD5Ry8pxJLSeyfGXL3KEgG/cml37UCy8uzuUoZS\nLrmQ\r\n=ha0A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFG8z9QxToT7i+He8A8zqk0pcuyNbimiMn/vJW9LChmVAiAyUsaQAh7Xtlun7p+0DQBHJ2OwCPNPin2aKpVhSz6uRA=="}]},"maintainers":[{"email":"coolaj86@gmail.com","name":"coolaj86"},{"email":"john@jshaver.net","name":"thejshaver"},{"email":"turleybw@gmail.com","name":"turleybw"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.3.13_1572593110486_0.10277570742325248"},"_hasShrinkwrap":false},"1.5.0":{"name":"@root/request","version":"1.5.0","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"solderjs@gmail.com","url":"https://solderjs.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"e22baa8eaec729895b46a39f12fb7b9e1348c705","_id":"@root/request@1.5.0","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-J9RUIwVU99/cOVuDVYlNpr4G0A1/3ZxhCXIRiTZzu8RntOnb0lmDBMckhaus5ry9x/dBqJKDplFIgwHbLi6rLA==","shasum":"cc7aea0187f9a2821909e79ff455b1fe17ba8684","tarball":"https://registry.npmjs.org/@root/request/-/request-1.5.0.tgz","fileCount":4,"unpackedSize":35237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaezICRA9TVsSAnZWagAAHYAQAI5EPtbQUOj2BI5n4zZZ\ntBNy1AxN1CoNVg7KdfEOVdmQp97dHeJZY7Cm1zzgU0z1vIqS+srHsmzFvVpx\n6aKE70BSXMtdpBzuDP479gmAFo/p3brhBnvEbZ87/jFu8Ym7xgSbja37Yn01\nq1EI9ju/IFMXgPJzLUmqTMXQdQ34YxBCnJlgQ3wvYBLMX1RU7om9PgZaq/ny\nqZSDSacoaJXLi0F/k4Qutg+XSOBT1S54HprqLmaoHZ6mhGNGuOCz9vHDQ2X5\nNyErjMHtzK2n+RNZJEMFt84cxpKTAQMyVfdOzmZsFSbPKcsY0yYfYUBi7/Go\nqZ33rX+f0mQOQu5mMnEK1qLNu/sJ6QeT4ARwA3pwHQxjwDzuJ3pfYV8EPgif\nd1W9dSrLSj14Lr8N59DKlfLH596PmvdI/opO/GHWVZRFUC4j+4SpPfiKHZHI\nu2LZutBZ2MS7+n+iQV2bPaJpoNrlCesu1niSAaemqs9B4Y+VPL4egrAt8ccS\ncl0BrrEUoz8rPWaMjXEFAoOCUfCf9pjH7lLQWx09X1isc3LT84vh24Wx+b5+\nX2XOyYhZajQ/H2poHUcAMENgcJOc3lgE2Tbt1ATkRCn06v0UlJcYp8xAcaiE\nPPTIosphK9NSbOR4yNLBVCu7FFY+1PiQ0eD3diJoKgnR1BIaWRMiij9JLnz2\nB2f/\r\n=UJF+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDfqcmdZfPy8+MPYfp0ysUl/L7t5Oc7sfpHZQH//EiBqAiBGO5d4e3l4kve0Ewgdb243SCBIu+K2w+FWfGo7iqzMBQ=="}]},"maintainers":[{"email":"coolaj86@gmail.com","name":"coolaj86"},{"email":"john@jshaver.net","name":"thejshaver"},{"email":"turleybw@gmail.com","name":"turleybw"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.5.0_1584000199550_0.11961753423036137"},"_hasShrinkwrap":false},"1.6.0":{"name":"@root/request","version":"1.6.0","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"c2c4b5b2deb46c97686feae1ab9251b08590a170","_id":"@root/request@1.6.0","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-4c7OAnQkXoc2JG71GGOKlrXMrQdOK5BFtrAM1aoxXLt1AUc0AeCnzkqLaWm+NSwTfD9D+yxA4pzTb+SVzxahOA==","shasum":"4a71f9964a45cc04a330c9e2c277e7e884c91bdc","tarball":"https://registry.npmjs.org/@root/request/-/request-1.6.0.tgz","fileCount":4,"unpackedSize":36683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqQmrCRA9TVsSAnZWagAAjDsP/RVE/xApQKLbtLzBcVee\n0qAMrTz5WmG7c1TC0hupvqAYKwuRIhpP1qgFs0juJCMD+iNAzP3EewaFKZzT\nzozXQG8sonZfzwc2mY6pAxXA+9Xfpqzxh90WBiPXdzIDxK4ja7+R4AvUYoFj\nf/cpT+BtwlYNAvc6OIDblZPeoLISj7LEA0HCz3YLWKQWzRqdnbhU3QWKJ3VI\nnAA5Ol2+n0hzayGvxjnvA7UStgfZerkuPAcW1xgmteAypA1A/qGl1Si2yMee\nRpqCECms3j9dlZ0g/6PYl6fhyQGKR+sa0uR2JrR61P61eGeLphRnTFQlChO4\n9gTZlGKb2xQrDijqHjeVWnrWZyvl8S1at7tgTvP7PCCkOc5BdOQtwKo3lkN+\niY8R8D7Ecr9S+HhjZtwsL0iH03m8sXvOy77u2YMCty95qQECWQIznVzCXwsY\n87GJnJ0CdtZC42EeHvUucWcxIWbxtx3RiVFpYf8tbhr6IoEI2TtDdNmAS1Fv\n2AEEFGzIhjmsdv5VLKXSSiafchptNwSR/QvH46L3ldADCup2B0/zCk6TnpM5\nIy4/toSql+RXG2+NvPfV5/XPe4qHlYRDdqgH7h6DY1lxvpjs447LALe+thA6\nJMV2wyi4+XkarjTZYbNItcpqEpAlO9oS3dz8blBb3TlDf7WX/ldgWmw2iXOS\nl/y1\r\n=KUEa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIClT2PVDYiDjrcpR2U3Y6snbdCtbIzATuyuEuWS2MW4WAiAzZu6wmVQI2Kf9kizzPR5hcS3O7JHG9JSnY+j3hH9qiQ=="}]},"maintainers":[{"email":"coolaj86@gmail.com","name":"coolaj86"},{"email":"john@jshaver.net","name":"thejshaver"},{"email":"turleybw@gmail.com","name":"turleybw"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.6.0_1588136362457_0.18271878181320544"},"_hasShrinkwrap":false},"1.6.1":{"name":"@root/request","version":"1.6.1","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"3574e356359e6a619cd68edf5cd36eb85fce5ca3","_id":"@root/request@1.6.1","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-8wrWyeBLRp7T8J36GkT3RODJ6zYmL0/maWlAUD5LOXT28D3TDquUepyYDKYANNA3Gc8R5ZCgf+AXvSTYpJEWwQ==","shasum":"c9811180ef6d2d035ad79bd135bdd2ae3db22e97","tarball":"https://registry.npmjs.org/@root/request/-/request-1.6.1.tgz","fileCount":4,"unpackedSize":36713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqQ1aCRA9TVsSAnZWagAAmacP+wUOHKvmW6xcGsnGiixS\nPwNU2Pr3OX1VcgVEbcvrivqSw9TBtskFFmKmlWxIQ7hAWvc148FVWOrFGbnx\ndXCvDUnr2dsOVxtMCaqWEmKSukXyyPJPFYRme9PVHe5dL/i3rD+tN5uCSDHI\neFfDNwkDj8gx7OnOJCzCRUtt014YD0bJCvDjdJnOUOtP4Q/5HZfYLGSEIjeC\n+mk5uO9Lh6pvRwon0Sb7uNHoNYzIwNOacT6jtZngCknid4406gWPdAdqVheU\nNLM81FfY4HeGLIkd8MXagvEJWIhaFF0c85mxcwPZIS/GIjyW26pjF80gBKRU\ny07kuinS4PKN1ioTc7A32xDtd9h3KW5pB7UV2CN9dlbswwibINMrqEq9rKue\nRpXicMnjFAtrGxSbR3Lxg5l19Zqs8iS2qhPpfEf01PjnlvE6kgThBDr4OrAm\nKvKBUwQLoe9SqJHu6RN6JPqRhVkZk8r+QVuBAE/Gxc5vpYQAojd/vNO/Bdix\nr5BrxOAfUIqSxTJCDDuGx2SmAf4vSBOlYUz7gpCZYFs+Qu+UGgoMMQ+KZQs+\nbAB56fXW1m9r1+8J95BrgR6x1LQynZHiYmmwIvxxQjN2AGlNTIMlWE+5XYn8\nBCBQvIxCeayGpRuGPjxGeJpdsJOTCLQfKbMwaYD8bQHwf1ImjYPDNO71v4vz\npQw/\r\n=WdFM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGmPvuggp0VGvdG8rQPEfqeL5+IVeQekWL24UTVxKbgCAiAI+AhJOY17Ap5ZCRzRt8ShrYGWfMASvypRVvCmkxpvUA=="}]},"maintainers":[{"email":"coolaj86@gmail.com","name":"coolaj86"},{"email":"john@jshaver.net","name":"thejshaver"},{"email":"turleybw@gmail.com","name":"turleybw"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.6.1_1588137306064_0.9142111447464321"},"_hasShrinkwrap":false},"1.7.0":{"name":"@root/request","version":"1.7.0","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"95a12a82850a16c50ea239c7056c8f1807bc7564","_id":"@root/request@1.7.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"dist":{"integrity":"sha512-lre7XVeEwszgyrayWWb/kRn5fuJfa+n0Nh+rflM9E+EpC28yIYA+FPm/OL1uhzp3TxhQM0HFN4FE2RDIPGlnmg==","shasum":"d9be84c82201e64a2578323e98704cb79dd8dd74","tarball":"https://registry.npmjs.org/@root/request/-/request-1.7.0.tgz","fileCount":4,"unpackedSize":40356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgANVRCRA9TVsSAnZWagAAVSQP+wWlYmgdRqD4iHFBd+7P\n0O1BLnXflEVx/VS+kPkUg6OzNaJTHX9/dbGZxG4q2ZLEMg60kbwmdrhBCsPP\nBFn+ckUU4MyZp2X8AwXxZBvV3G8EetkX5ATQUFs4+IqNt/qkj2BV7u5N/BpW\n3y3y8ZbQgm1pEmAX+i4nvoKIZtQ74LaCk2STZNYHYgqARDmz7qMwhwbwV9px\nA8+g4m3k8LL+sp8RJEF8oJjBY031w4MsW00WcLaBiBRLxhciPJS+RniqeMXt\n0GLo0QYQTMdvnOfo24dycMKRHAjAi0m1MbHqopt4/mcwNaoZPsdTo7m1s3f3\nsANCLNTfHBqscWxKUssLk7ICS8FSfaUSpWb/cLcA+VostrvGVPRKQCd1XYFZ\nFxtpgOcXJ+r5VDgMUfR++N7TpXofW1f87xMHfkOd9RWRO65sP+GN3azc8H45\n9/OA8k4TjW1/JRjycyLHh0Z/1QLbkUraqgd/ccT4ZA4Xa/7TRwtIDGqB1iQR\nJKd9Amhh8QeLZ23NPCuuGlYAeWoJHhwyF1fOSxXnBJzBUzH/FmsCt6rXMcJm\nhSLlXDDYsi63MMKE5q8QO9EG5WEFF/kqTEn6mJcxsamRAq8l2AEAFKWei6ul\nJMzGGW7fwGAzc3TfzUaOqNKZBXHJSi4Q2oSNK23skeDMxyv4OWfrk4W46mK/\nRtvZ\r\n=/mZC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4n/UQvIIuF9pR6gqm4WeHN2mAyGlTDq9JMEhvp/7QSAiB4fabru8uta2auBUvarSEYPwUjz0aqBDAqD7DeLeFtZw=="}]},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.7.0_1610667344476_0.2517484783856312"},"_hasShrinkwrap":false},"1.8.0":{"name":"@root/request","version":"1.8.0","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"bc4f6e59c0ab3473cd54f1ee299f28d145e63e58","_id":"@root/request@1.8.0","_nodeVersion":"16.11.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-HufCvoTwqR30OyKSjwg28W5QCUpypSJZpOYcJbC9PME5kI6cOYsccYs/6bXfsuEoarz8+YwBDrsuM1UdBMxMLw==","shasum":"baa1ee1c3ecd66d56178f8b31226ee50caf45947","tarball":"https://registry.npmjs.org/@root/request/-/request-1.8.0.tgz","fileCount":4,"unpackedSize":41335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2ZK9CRA9TVsSAnZWagAAUAsP/0OToqx+HEGosZul+eq2\npL+TQG9BQQSlf1wRibES0J4+qzP9kedH9NjbQiYOcsWD/xAUOOBYg0NTk7WQ\n69xODchK58l6LDVBdeGe4og4j0wavc+phex0Lnhw47KZy+y2Y1Danna+ulux\niICnSFsnF5b5j7jPc7xJKfDnupN6ydG/YLyPyE1KDDiFi6646v3AWQkXKGDN\n/3iJIjZF+rDa3LlWK0ejVixldebS12g+wuRlwHYeIElI5sn5L81cCtaUgxGv\nMPQC84DD/vlv3n0VLfceDWLFQ6QxuZOir++OCaWJmRxW0K7XUM260WVY8HbF\nzzAzzoHwS6N/r8mHXjNb+sDEZgCRGrp1BlzNY7UnDa8+UPpE9Eda6wqUk4tZ\nafEmwN3OZkSpaMPvGcVRzcUNbj7c898oWc/wmskKIaI9xUpw3wb3SiFl9i2S\nONqbnqMaUunqgQn/CO3fByyG+HTblyfBzrXZokxwp8yNJwnbDTlQZb89u4Cs\n9Z5LNagZv2MpBGaKsrAKKoJ+s/SqR54J3dMLWdGUPwR7OEhK1IrbwvtFcno6\nP3Pm/wg9DW0qaZ9etAJ4A85yN7WNWVwppwwRiYAH5apEcQ4jgdFUW/D1Flsm\n10elcR4IcGRqEXWbM0ucSrA6Y6KDYrguQlIyGWz7+vIKsWgrfurMVsCbwTWR\nFGgL\r\n=xbUa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAcwpip9+zM11D2MsgMihgEp8LeclsaousaNAFpbGpnLAiEAjVpmdqvtQvK6iC6VlKRrwITBeYjfp3xAIbeSrPpERME="}]},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.8.0_1634542967019_0.7964058264187079"},"_hasShrinkwrap":false},"1.8.1":{"name":"@root/request","version":"1.8.1","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"0a2e7afa76b9d4e548672acab5d7d7886abfb8b0","_id":"@root/request@1.8.1","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-Ib6jLQj4P4Dnx3LMqdV+TaSDlc7tWz25wKorklQ1rMHzHfc7LKELIuWl3XDQybimOPvIvlDuVX6/Mb10dEdQYg==","shasum":"eba3e367ef862f302df6777a746c9fb6b581841c","tarball":"https://registry.npmjs.org/@root/request/-/request-1.8.1.tgz","fileCount":4,"unpackedSize":41368,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3zWfCRA9TVsSAnZWagAAKkMP/1OnjX49mN6WVsqeGM/g\nP6MiZVQKuETsE9TpnDjubWbZxD8Cb7fkeD5bo/sCsXOMb+ALpnsbC/lSiyXy\nQnqqY8+5Jt+d5MTvdJrJEM0lZAe3k6s9ITXvxEa/q3Oo7grkRTsrwh9/lXhv\ntA2ORxVwoNYsJxLWtmZaaLtUS1xaGG13oiS9dcFwv09YeiOwGzGBNXhndas6\nct2yEVDuaNzjvO6+jcaOe5hGIgxDAn82We8mwCLk0zo+T5r+kdEMmKK7oBwS\nxR/uVn+6EqbUSGFJsd65XzCtQjOM7AdPr9DsgQhcD5f6FeRe7nnvShBcyC7o\nHE1S/dury6BPlaGrQ7136XO+XQhMu0ZdSX0BktQP++JBhQU0Su3r4pmesA52\nmI6Y7PB6LeV6Nqkap/ggT/uZDpAvz+TxQCL7/b3gX4CwXEmvRl7vnAEGA0jv\nKRV7zjpOYQr0uxS0ZAwgxWUKIUdqHBPS0uEVZwUy133uqvOP+gSnRmuw6gZp\nmXFXo79K/XEE5TVL4xRJ22mhr+h7ZhPH/spK6slLyWETAQR4r4jhiZzviaZs\nUfcBmVzTsx17+1lCkMy7tK15w384n147ijFWup2NHrj4lwQtR5gmKGM2n68v\niFDbdF8AC95whaQtEZx1gepJ49J6+Nk4F6thR1QbYXz2SuHt4NVPm64QflMd\nm6Ur\r\n=dIik\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA7rQZ6uTnvYupesom2Fd5dMIQ+mg7H05WwL+EkeBMCBAiEAlEZVJ+yfM55b8YIB+UOHp3WjeQPr2qn70n6YkQ+OnIE="}]},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.8.1_1642018206873_0.32505389033471555"},"_hasShrinkwrap":false},"1.8.2":{"name":"@root/request","version":"1.8.2","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"bb30d5acf62241791e2cadff8c961a885361d17f","_id":"@root/request@1.8.2","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-DvBsWCnuEXTcbokGCX8dHCfAD1f72lQwzyqh2v9f0eDUN1qimYPl969xOP/m3G713KrNtBgQJhwqB7A+Izitjg==","shasum":"795c1174f0286356a6d5295e7df0a55e480cd815","tarball":"https://registry.npmjs.org/@root/request/-/request-1.8.2.tgz","fileCount":4,"unpackedSize":41413,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/nw3kU2zRS0zApbowz2i9gNcKE3nkIGKN+ceQT/jCZAiBvBoAR9Wa3kGyye5uUJPFJpKsGlQJDXrgasssvMitFmQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqDrgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqmmQ//YiU0meUuGRH2ypb4syQD1F9ftHUU+rDfYknK4e6EYi+hniwN\r\nD0TgMLy84ArqcL3VgHZNXm+S95JVQNpXYyyHhzwcSDwjBH3CfaW1p2BuJ34Y\r\nCd7sHqF098qBCmhdMt0Hu/SYrnNQ5S2/Afux8uF9gax2lShDcoLiLGrhQKFL\r\nNUIWrYZPf114cDpl7pU9L7F+tB+pda9cC8AS9nOpZcqDYby12EjLgOXfXN1q\r\niC8ZHRwK1AxSM5Xv+UA4/sBZbpW+Rfdmkd3LWNEgJrHvRCtmvxasR2rWLJN/\r\n3UQf9UZLLRK4wlo3rs736/jLua/cW5zoeK/3K2J9KS/AaQnLdxo9Vqp2QtPc\r\nPS/vZ7NQUT+FYv6IF+XLXfDl+HH91czo2OIrHvwaG0ziepZbjhOiEmj6B4ux\r\n9LbxacqWAGpKly9+gWsyUcfdOEOnrsrMRulG03NGXGlTLDaDxK44l/EBrnXQ\r\nsedXZexePZQjhn5tyv8SpYHF0TLwRFjlEOu6D+Xi50z9wxgKDZy44gn8lRRH\r\nD9RnYFrlrJ6uG3GwB6/bDn5uJRh5zjlxAzDZMOI87549KnK0kL6yjqpMHqi/\r\nYC5uqNxS8dFJz3ZEVElNUMv2XYZdNbpHYZIFmwBDmHEPsnAoDym6S+ETvKfO\r\n86DvxMBXZlsPuBs5MyKvA+jVjyN9gtMFqjo=\r\n=D+JU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.8.2_1655192288222_0.4057486988734318"},"_hasShrinkwrap":false},"1.8.3":{"name":"@root/request","version":"1.8.3","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"961740ffa05027f054a06b3466ce8eeaaf00e992","_id":"@root/request@1.8.3","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-PTsMwobbR5s4ZmzMcRaMUbDoNExgUyNIBSokapMti1TdIDmjN3SWx1o/X1d+8cHxiHjO84xUWuyjL/ynnkgyuQ==","shasum":"f6640d441bf32d737af8a6612824214144f81f95","tarball":"https://registry.npmjs.org/@root/request/-/request-1.8.3.tgz","fileCount":4,"unpackedSize":41495,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRHoU8bF7pbBf581tKQiBtLsGT+ZSFpInVg5QYXxJAUwIhAIsBiotSb3GU8yUdVU1ID5N3Xww0qxY3NhQzJXu1oGJ0"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixp+sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWDxAAlmFTbqmWFFkjAVqS9CCIRR6KhRNstQb99+pp7ddcFNU4ygJT\r\nou+c0VhJqPxu/GQu14578ch+gq/fA3gkYOjOc4kiwvF+gIimb4ZSmFT2xWn3\r\noeC5qv8QBqmWPqapCbP/jbMSwTmc/NHLmJtDWifayF5GVLLcnu9CNYbmSepy\r\nMw3JvfMrD24N2poD/qOgiRYvLB3xhOrAt+Bbpd4173m5VwUUnautiUvFzafV\r\nCT7slauq+f2Zv8BYI9YyQaGCAdkQ6P32krmAd51P486CqM4xtfK8AAro+4Kw\r\nr4B4N6bRRrYmCqwjULPGjF6hbkp3DIEoVo3zD/DYNIcHizrDXaF8r2ceVkQi\r\nJTF72x84AHN4auFsVcLmwldid4hlkpq3VMcCxfLGzF8qvN1xyEn4hJhWGqwP\r\nIrLPDsnTBpbTufSKkKDJOvcXHfilp3eITvANtLlLmcsiKtI6dsLb9VPsTyJb\r\nlPEOAFCH/KACGbXTITPJRaCg54ROzqm1ikic3t980bskgyiAWJzC85D4/rUS\r\nFMvOqTxIk/6pP9ADzwBy/QuKM63HMF+tMCdn05SAfouXduiu8osk80ERY+Mk\r\nVkXe09iVE0pnaAkx2uiWj63YMtKQV9GgqptE90+qqxysPYfvbTEkg0sZD25d\r\nj7h8FrAfbkjq91bJ1MxKg+93CUeoOpzXd6M=\r\n=tCJ8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.8.3_1657184172049_0.5814762006610763"},"_hasShrinkwrap":false},"1.9.0-0":{"name":"@root/request","version":"1.9.0-0","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"index.js":"browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"e397dcc9cbe33f01b87af60205db115f222b3628","_id":"@root/request@1.9.0-0","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-8pbJlRzXEeeMysbpi9qpGGsxQoPgEphz+x+fr8oytGI8JZ3UIKuf1fdHUKSbo8oVWqJBFN1d6ogPqiTD7xMAIA==","shasum":"91fbf3e941812f4c8576248af39595544eeb2bcb","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.0-0.tgz","fileCount":4,"unpackedSize":41554,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE2ox9sse71ALDqP9CYMsdMOuEY2eExmP05AAsC0b3pYAiBLg9N6kswP8n+1yhBXE/W0IBbkhelRdOrWiZZFOzWOLg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjED8PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3Lg/+Ng6o1jDNBDN+JT53aoYPVCeaARQH5hgIMwLxZiOb/fDZBMa1\r\nZMz67i+/v4XLITZXTmXxUyKUprqJ/AH0MBPdYvzA0kfBkN0uk/eHcyNOLK5h\r\nDl2dwS84gDv6WLqLWVTHcKchQMPPU4RNoV3/tT8Ce5tMFXWFB/VojqefpM7Q\r\nw/aBoVV7YrwHS86YSeibmY86NeAzRYprrojdbl/TEA5IXcfNQ/cNJPqOHk+y\r\nGxP0Lksh2ycZP7FOfSymS6GgkMwdR7F1hq3kDdftdmu03EnJ9/t/dF75dRl3\r\nkTHUqCA9WOte9SM4qb4PGPw5kk7RSUDEfXR+pBQ4H16hZnTECXMivQLH9SEl\r\n0/guWBNj4J/BYf9JuXZOzRGJTLKDw4wlmB93FKl8jd9M31h4QSnae0WObXsB\r\neIWZS5hXEVmFrqziQsn/YZXOdwnEb/YroT29PvWjDI2uzeempJfXUV07WCQ3\r\n/tw16zQHpxhjyvb8itsiGM4d+ySsIYGH0EOOBVkOwNP5lxkyLtwxrt+3PQIh\r\na694ln7Ifl7BWmhzm8QpGLVB+C+K5f7SaHUzNUSi9R7yKKZ91zGD+Cbi/fGS\r\njgIJplUMxBGCbWcsiRLvEbJCallytklYdLWJnQzg4MnCz2Muy+ncQdn5xYV6\r\nLk8xALSaZP/UpbB7qNPKW+lnl85qVLsKq7o=\r\n=Kh8S\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.0-0_1662009103271_0.4495959413651487"},"_hasShrinkwrap":false},"1.9.0-1":{"name":"@root/request","version":"1.9.0-1","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"index.js":"browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublish":"./bin/localize-types"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"420eb4f19787a33e270911401fca6c78a9304e61","_id":"@root/request@1.9.0-1","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-WBZsHq+PsPUi5TLgY7KewE4eTCzZhLESkNLrH0WQWR7jme/5Yh+8PYVFSpoZip8IgL+WspdvqcwgcVE9/S6w+w==","shasum":"99d9d0aac32500f679cc0faba39897927cdf2df3","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.0-1.tgz","fileCount":7,"unpackedSize":48777,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEo+BHp9MpfeBIPOKF235fNiPYrQeoZg8yxtejTgyxeeAiEA+CrVI2l9g2nW1ko74HQPd1BGEqg5k5LqiJmOYybqF50="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEEy5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRNg//b8JWMFvf5n0a5cflRfgD7xiHUponkBHJIuOuxvg1tTX/GkK7\r\naA49ITq1peQclK6MMOz34SavhkeXcbEo0e6ZVCWw07B/ebIx3MpHFF6ik07d\r\nHeknlb7il5IDiBFZ4QdRm+VmTN0VIMYjKFyzI+j/NvRH/ob1/J+okl2C2k/T\r\nN7T+Fr374KACtNPrDxuwBdspUlrp7GlvVNsYTjtenTQLNRpHSIrZfgwjWVIG\r\nSVyvfYx4iX7ApEr1sustGuEtbJFQMw0ZPgVrkcb1ahf+baVgFmnigI3IXwYL\r\nm1c2IVb3txbVWA5S1x6wJV/pxbq9m7UMsu8gZYjmSJoWTZ4p/wE6cuG1CWEG\r\no3hoiCvMxNBFcKuKnHe0BWjzNfWVRfvtw1LfIDpjZeIztjtWXKaeoABOQ0Np\r\n2caR19TVTof7baF+cXf0qnXH0hjtZzjAdCZWmGjY4FwuwV8z9K5be1jiIh3R\r\nM3R2+e44Z+hMkFRevVfVr2ibWjD5fzmwA6wE3jBnPt8pBRX3gUyBunDGLAJl\r\nEJcJcRugrQY6mf3m1PGYQhcsS2x/4ypzFql8mxBHqg7LJxyd6WObaYpCRnWc\r\ndWr56GtQPuc6sqw4u5SCduZLOpSsJRuNREZP5tmC8KG71D+Vd1hEnUIJeRUJ\r\ny8JEyE8uxwpc99oIj91uyBSPbsluzdjioOM=\r\n=83qD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.0-1_1662012601208_0.9034591029937598"},"_hasShrinkwrap":false},"1.9.0-2":{"name":"@root/request","version":"1.9.0-2","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"index.js":"browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublish":"./bin/localize-types"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"be8b94c187a2dae7be5cfb59031b7af5965b2c46","_id":"@root/request@1.9.0-2","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-gj+94jaIMRdTk2JVlXqGqNoZtPf/NKiPlbrJZ0xwJTJnG/i6s/Y5s2oYqoTWXQp9lm5hsy+J/xsWiTD52X5p/w==","shasum":"e6dcc8749c4f5224ee1f5f53e0f6b3e25e3d48f8","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.0-2.tgz","fileCount":7,"unpackedSize":48861,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpA3AUdIvA6LUJ8dN8mMjhySAeFWI55XrG7LRxRjXokwIhAJQYdPxmUCG0W/DpY7TEePoFXW+tpUGYVU+H0gfbu73N"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEE+7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrjxw//eCRAy1xlSoaWnhkjicdDEfNBZb6AM/6v5PZtgWv+1K5sps39\r\nTAjlYA2a8XUqJ2KhM3aolWIwcfDMNBoHQI9nbUzXQD8F01gjlGyki+JjQm4e\r\nEdmgUZnF6eeDCFmx9Xm8lR/r8prCgt47dCX6cQS7ojQOxlFaqwaIs35kLF2x\r\nW8DqROzX2+l3ZbKwuTGHmCSOXzWFZZcaFl01c/7Vs8sZadzIhEF8RPDeZPmf\r\nWLvNFIdAU8i6KmBkfg2YMYHzjDXIG1FvGFwRAzkDV/41pWBqhQOhNZkO4xbZ\r\nbEttEfso3cqoFzScPS00AXKyzWQqubPFbSMWIsa7484CS2tZLJAoH3AS0T7N\r\nepijtm+dFRUhwvjkiSqba51vElLduRBtT/tmQt+qeX8aIGB2EqsPjAwMgHJF\r\n/n8qmduy1Kb5NemYUdtaJlQsOEKzY9FmmfTxwKlfoDrPcPTdCqKl8k0hVDMw\r\nwXCf0aaNJ6GK5BC/bxOV/8+V0cpTDXDQwL3VEHnG8JDSjkVIOExgYSUn/uhY\r\ns3pM2z/M3YTO7PPUxtHZx5uOsIEeAjaqFUSlefgy/OVNxx47oq2JTSN6BdLz\r\nSeHLCNv1xEs9sPfnAEIWAZxkRKSbqeCgBASd8DODTmrl9ztLkZ2FWeffEGhm\r\nV0bPZQJbbcZ0LPAJf7MJvttquUArmXrK+FU=\r\n=wmd6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.0-2_1662013371180_0.8285085688864198"},"_hasShrinkwrap":false},"1.9.0-3":{"name":"@root/request","version":"1.9.0-3","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"index.js":"browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublish":"./bin/localize-types"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"88ae1a2086215381d13c8760d43924d1ff74d668","_id":"@root/request@1.9.0-3","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-Xmjx/jNEEPrgYO2qC/WwT6cou9nI5un4nNu2gG7hRg260tePfUJn0v8sWVzEisQ4laDR04ntyD2R9DWdTCTU1w==","shasum":"964eb4451ab0bc8c5e3f5e59ce4a49d120e5d787","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.0-3.tgz","fileCount":7,"unpackedSize":48859,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGg1/JW1NHIiXWODnrBrK44uu7HiHo92/lo4ONPLyGZxAiEA6HP+AW35GOD0q6BM+PtL3X17advSV1v/eyq5DyJNM0g="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEFGVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYnQ/+Lt1FBywpCW6IgsGNe5uN43yoXZAxC9UUmJUUowJ5tHoSHumY\r\nRemm+JPwz7inUqPeGfRrWvo0VzQSYTNJq4NfaHTfGYlD8X2wJ4QnTtO/1tyS\r\nWi4F9WEHF3BIJy0o+o1MxaY7U/5tzJFtfFtvMZxRWZ2JfOcoA06mx5GEuC6S\r\nKatxULuGH90qigUqcwqRnf7rS4YbZUjLNrMVNQcHfy4898y7abwwtNAzHpvu\r\necO5GnOOFTj+oVgAEojm93xwbZumJ24c1RtbiAMIQJjCkHJ2CBDV1KOZI9/l\r\n6klSIwUuLw6rlRlMdawGJI+AlgF8YNmwxmsajjis408cW7il/PkVq/90ltUI\r\nycWgySmJ7Pv1MvSy84B+rwdb+U+/ySuZxeh0/6G6uDrAtPBOWRumk4X0hgLJ\r\nj5ZzAE2EWO6jDLWa3jj9ZwbI/WqrDwZMXiowLea7CKwiQcTnz/wFURUGOeMQ\r\nj1+JZQ2jc6ieXFJi9on/KwugAqhfSIFAMfSslHWSvObzAQarBM+S7Wr19F0J\r\nEDBRBkQ//vo5RHNCmmXKvUDVQ3sxa6CMo3vPeCrXgbeevUYJ+fvAIghopV9i\r\nt7C1LUG1u70R2aXJe8pu1m+nXyRp9cYVKUcak4R5muUI4gaNLE3KEH63Vz3p\r\nAvFsUyH82TBrKyzKPuCzRLyfGgbj0wugLZM=\r\n=Veuk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.0-3_1662013845443_0.18523485463720912"},"_hasShrinkwrap":false},"1.9.0-4":{"name":"@root/request","version":"1.9.0-4","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"index.js":"browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublish":"./bin/localize-types"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"b08ed4b16296ec7b15154f8dba95192088849c34","_id":"@root/request@1.9.0-4","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-bIiPhT7Ozz6dKunUdnvSVW5yRArLq9o7400ND11fD0QsN3+tdFxdbiO6Aj6PCf1dnujpDfrcCJR5Kwg2Lwsn+Q==","shasum":"9411085354e9befd23fa1a3a1ff3cf4ed001b74b","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.0-4.tgz","fileCount":7,"unpackedSize":48971,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALoA3sPcHVSuKVcASW3rJ/ykLYACpvSUtSTp6tZgHmVAiAOWef8aIMhOsNyZDHBi+W+V6MLNp+4Ckt0fOva6XZ2LA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEFIqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2qxAAg2LGTe/BuEfPUgECJCNN2Vr4TLNfE7xxIUNsFYaqj5lkjbWK\r\n7Hdw59zheIcFWeZ+Xohzar157WIRmhdxGQTiSZMbBg3gV/p6sy/nJj0otzSC\r\n9xpB5G6A2/P/6n595wYS3n3McfbrPb7CRdiAErUTW3GtMjop0ADv8kW/r0j2\r\nECkGC357RbNhFrPwj9ij1x0laxNLrHscluzadUkS17/DzR87kVRTMnyLdNAn\r\n1Qk+IiYn8d+A565jgE6iM8YUez2AtlwUuQac8Ua/YVW7joaPHhOwKKAawAG3\r\nGCE1hPDLKVknJ4WOXyltQlQ2qkR2Y0SUU1aTI+QZW3FV4YfJo15OzYp5jQVq\r\nsaavQBzQNhQmw08LeDuFVW4M4SZm81iekw7T0ChNkQp0vBVgTg3frI613V16\r\nPpKWIaCyqDKZeXW4j0UbxDPcNPwlbs+YCPITvQVDFNcCOgcHmcskLyevNlws\r\nUwX491FNz/m6WeLylZOWcqgsjKZn0zYM6A+WWJIlExMun2aF6gO6nT1caVtL\r\npHbE2JO9zL/YpCPCDNT8OAE9fH1itDzDRu4SbWNcJtNrKRU8f7VhhlSXxCe7\r\nGCFZ89SxBmebZg5hWk+XbO8gwOcKZax7uVUsreTEC+Oamv3NM+kutXbetA/e\r\n7TjITO7fPRxfuzRUCYyu1Jyk+87l6Xm+gFU=\r\n=e78J\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.0-4_1662013994376_0.2269313582932726"},"_hasShrinkwrap":false},"1.9.0-5":{"name":"@root/request","version":"1.9.0-5","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"index.js":"browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublish":"./bin/localize-types"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"9aff0c8ff88e57bc3d09db4ea6eee02f4d47ccd1","_id":"@root/request@1.9.0-5","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-pVAgGUMxj1bgHwqabyJUpNxSq5lIsVh0fz2OcW58kA4pJXi73Kx0Tmq6jHvOrXhwxbLSb5SreXO3hmrrP0/kMg==","shasum":"2eed1223862fc08b9a427c91e231b30736943dca","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.0-5.tgz","fileCount":7,"unpackedSize":48971,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeiE9rOBiYWuD39Qo14RoflDla5u3g9N/FTNNibDM+nQIgaXP9mO9J+1caWJinMj9RTLFjkH39Dr+GmFZD55Kku9Q="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEFUUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmosyg/9FKfknU8+UkCBd9O2ZxGYVMUcSzSMyBOHRh7ZRIPTrGWWu62K\r\nZVrS3w5tsLcus8QkMm2yarRkuRqO0yxhKTVx60FWBpA03SDCC/ZR8oiFf8eO\r\nY8LLcnlUni2hm7AIbw9GvOeCucz/8jBkRin2q+Xdv8R4wbvPHnb04WtT+4V2\r\nj9zKnZ1Or4g14KFmoshMDtqWQbHJ+SoGezymJ/9vE3LsBLRlbDCC8/TM/Szp\r\nfihx34hWD+WKzQ8cMFB2qV+alvzOLvXideWo8D6SajT9TN6aivm880HBIDfv\r\nnc961l406kAfYXbJKfhQ2Bak6umjQHwXkp1/H2Gm8c0XHCoGatusDhALEiba\r\nh6DnqOdIuEwjNpJn/Z4Vb8izHULsf6/5GJBa0L/G8JPQN8+kfgwEvWE69gxx\r\n2qxwa8ysNBurqa85q3roMHlujsUVN55fV+4T4k1b3TTUqcCMz8E5vVte/Sms\r\nK9fMcpcQOuZ+OftejY7U9DMIDlN8muUKAbd8cd+mA0S1D3baBujGitx9un+s\r\nvzZ2oEePLj5BYRRePHxq7LgLuFaS9AZkOCDY8hET2Z3aFrPTiHNShC/+/r9K\r\nNHo4MvGElomEZaceFpA70ueYONuxXkZhTZWyksICaCyTx2QETbX2iOGdt8yH\r\n2+PhGLUwfb+UC8y1puPRlOFtKHcDUEE7UXs=\r\n=wooi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.0-5_1662014740387_0.9822504670590784"},"_hasShrinkwrap":false},"1.9.0-6":{"name":"@root/request","version":"1.9.0-6","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"index.js":"browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublish":"./bin/localize-types"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"8076c667bb83737d6ebcc192538783777300046f","_id":"@root/request@1.9.0-6","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-280e+d8IvCijfd57jvG2gHs9BGjkbTUert2MdMIAwEkxh94tkMTJeeyAlonLvB2nDQ734BnduLGRAfPEdEj26A==","shasum":"d886909f03ae93cb5f3aab3d588a1114f12b7d76","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.0-6.tgz","fileCount":8,"unpackedSize":55419,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBb5v/SG7vceuNuBVE8lvn/UJXSJXcFplz7Ayz0PdSEZAiEA6GFxpQ96ex/SPSmvpRHo60tOS5963Ly78/XRfUtPby0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEFXqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4AA/+LfaqcjMzdYI0ET2C5NMSiWHAPNN/SbUUfZKMY4J0AtHsMAc2\r\nwbhJs1XzuKV7XQTJATYFtftMvlxl8FvlVqtZGBHlXzX+ASB8d4gvEfBGe6Lu\r\nXVF8f022oq5UFOApqUONJZ5YONTQD+auTHr5MecqapduqbrXKTT3G5fVuu5d\r\n2PqT22rHMd1wCQwbNDv16LxrQofPpabNVgdaJlbWzRVxjprmcMNg/V7VIbg5\r\nc9tcluB15P4siTkST+oia4OusPX7fbVVPW/diNvN1F7YZZvAXmqqiC/22SyD\r\nGq8NZ8D0paK4hhPRdlDc5gkmlC0dt+5QJMPGPev4MGshjcuzXLN16gKgqcD3\r\n3ZJ68/I1w5DY9703A1X3WRINKaiLTjkySpOWvrytiSAtBoSrr3MIBgOxITTq\r\noga4s8X3SXCY7eSlUugmblGRtH99oLX3eGDaGIOVfRTONe5dbzpjaQIQsIxf\r\n1wQYklUdlXozRCtUWIt9ZoRIYQ5iwBfG9pO3fEHhuNanc8RNjRt4ZDhsD3yj\r\nU+jQB6qPzIQllPSLeR+qQcVeDdKCu3cHO7o+YxA0opHcl9S68bMlDBPFvoCW\r\nvvJvMCzErZgP2VdHUKEzqj2YvbDcIXun5oGn14Z4FUtW9KU68DyQzFoxZjca\r\nAS77RxEUqjvOECVIQKuFAyUJGwRp+A7xEdo=\r\n=+A2u\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.0-6_1662014954570_0.03673807479355218"},"_hasShrinkwrap":false},"1.9.0-7":{"name":"@root/request","version":"1.9.0-7","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"index.js":"browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublish":"./bin/localize-types"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"b06ceb71d6c8d6f41af7860e2a68d61951c4abb9","_id":"@root/request@1.9.0-7","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-ST9Pwzp7upvO7zvK99zWcojgCKLJZeu6zsJTaNhtDCCr7gbrr6owm5npYskySrVBVHwDjcS61dDS170IrPMwbQ==","shasum":"ce022cf3079ba0c7ec45eb0e28efab3acf5f4752","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.0-7.tgz","fileCount":8,"unpackedSize":55419,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBvFtRp2FU3E5Baf20Q4OZzWfP63o72gTHmOuZncD7YXAiANIatr1IQTb7cQEoHgb1iv9tdzeyUltzS5yqBqKpiyYg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEFZiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXVw/+MmoRhAZ2w/kpUD1iK2lTzu6g0ASniT1yR12fFgAeONaU5UY7\r\nJQcbw8lUUEro4jqkO9KnjPZSnOCq9ndtGqm71AGSchq4XR5QGh03hECAbWLS\r\niNJ20wxKKvHqPv+elLhISWc6xX59lW7gHyU9CTfigRIMIGEhr/tgrO7m/x9W\r\nZgkTt+ZYZdW4ZVoIuOUYw9Co+yV1joFCFJQ2w2zH352LaB/W7wrNeA5AxwD4\r\nL4ndR6glspEU5HtQmwDapSRitEygmnxJ6IcIM7OtfCFkK8JgDv0szXKoYfag\r\nOu5V34RL0HFcqC1pcZUmFNeycxRHdu71srchibeyy0oHejhMyqFw5e1MDqRR\r\nYASboF80wb6bswHfSEdYxX+F1Kix7PgF7ZolzoC5q9sa6RVnJrCbp38Y9NUW\r\nAu+Mz776LHv7wDFoNlIhbiVCFj6qrc23l6b/ATbThHvkWsByVnsBCTMcdNNJ\r\ngFRsKPpJ3jHZrYEBB+ZMcCNf+7Yerf2/5wBcOduWY8J7fP1tZsQWvzC+7QdY\r\nyq7K+Jf9ESdYngwCZ9bh1afnd9k2CdQUOc3eVYGang9DIVF3uEzgD12FDTsT\r\ney2tWF3MqtL3+PvA3T3JZt+SsHhQ8G47fCQrfKI6/Q1YGwjXpw2RWJZMuQwZ\r\naUnf0oys1OIRnbtgv/AErsvZvRWXLmV7P/4=\r\n=iDrl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.0-7_1662015074471_0.5465416381267303"},"_hasShrinkwrap":false},"1.9.0-8":{"name":"@root/request","version":"1.9.0-8","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"request.js":"browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublish":"./bin/localize-types"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md","gitHead":"3425dc7a7be47c2459fa62f53996b55fee0d6316","_id":"@root/request@1.9.0-8","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-dxRumBLyLt0gPibyBWqhor4HgFhgd6Wn01l293Cc/UOtp6LWbl7Ph6iUEymQ/4ZM/yQbBzo74pDZTMuQ3UHBOQ==","shasum":"feddedab0ef21c3137c996cb2c2fd617ce100be5","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.0-8.tgz","fileCount":9,"unpackedSize":55604,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+cf6II5v4dhr31ZbkrZRVzUq94MDVZOy1KLXlBcfqgAIhAOztts1xvPoMzFMg4E94sbtgxhz70CORJK24uRsUXPCQ"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEFq0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0DA/9HW73Pq6cqwhLVIx+uE/OcBIE5qLHEX7Ve54B36PQcK5mDwny\r\ncRdRazKEqieOusPRrKDMAPerslP7zDRRKuZHWhcXTv+W91P7NOBSrCMvUMh8\r\nHRsArx9AljaQOXJTHVeZumcnqCdiEtyzXFi7lIkGbIEEt+1pETK/7anNBZsq\r\nrImxqqW9UeSbtnz3ZwFnRg8gpedDpuC4ZSJwpilrNXhLvgpJkIbPC484tWft\r\n9UsJZTCP/fR+jYQYhpY4AilKDJQFGgiUBMMNoq16iY6frK5A3PEcPFulfrCj\r\n///5QEpN7MycWrGwPZ2zqb4ldfBrt45PO/HMW3IjeOd2TugZ2Cter58wvfND\r\n6fS3Tee4eCsVSp/YMwanXGVkBXdaucKwqu9NbHqjW1ntaxtLM7ZgYHDq/zzP\r\nY0F1HfI4EogoCbGSgCEZnNi5yPYEtVKuf8dtOZxEB7Gqd3Z7+BEMMveVO46X\r\nQyObEk4zw4MqktdBhu7Qy9QQgnntFc6V8r11Z68YWUFJ+XRwt7tBJCs43ovr\r\nHwDOXca+/9WUDfAoxOR34S9yEBo1qCQOyTLhFfL8/tzYkYBOAaTVeGqIXY6k\r\nl9OcYymGv2wpzw26TVJRjfDV966NpS5L1G0dFH2l81leglxi7kQIir3hd93y\r\nwSC1vyPi3SxtKoOJWJZW1rgZzQ6kWZJ6jlQ=\r\n=bTjB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.0-8_1662016179961_0.33341491377348254"},"_hasShrinkwrap":false},"1.9.0":{"name":"@root/request","version":"1.9.0","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"request.js":"browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublish":"./bin/localize-types"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"8217ae1e89b4d703c6d51eb4a77771ae363b3127","_id":"@root/request@1.9.0","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-EcdDz2A98KhkJCf5mS72ZM+TySgDasLAqLhbglETprDpUi5Ey/e5PKdM5V9c2Rjp05x6STS+2D7zWzuzF/PKHQ==","shasum":"943f6d8f62686e59d4786a8f5efc3d2a5462d1a7","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.0.tgz","fileCount":9,"unpackedSize":55602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCap9sO/EuosPPs5b1MFKrcRHtg+oF+W5mLs40SmqnWCQIgfRT3YwPglS7VyZ6dvZT2LPGQHqzGPqApbcvnBRA1MQc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEOW0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9fRAAk2Su36Be5TnFfOr7Hdk6cpSGZ8Ce/dV7N4F3CIMKJy0nlTYe\r\nOpEfhpz16ZgyjIFOMOAhSBvMh9JhAw1ooV/X/j0MaE62b0ZDidyLmP703m1P\r\nSmhVMyTCOVA0iXhkySdP9afK98Es7L9nJmJSg2uwVzXNFwQJwepn2keppKKm\r\nVg5EOek44gzT7z1tpTwHTBxXtHCxyo/SFP8tImp2pug+Bn2q1jCTHWmraW7/\r\nTLGyGaHuTcVpenohWfrFjO/gbej82V/0wfSrVFwRSPfWAoM7Q/i4dhU/7y7M\r\nGB44PVfPdnOV+CEhgVxZhD+vw9XasdlgVUi6l+T4I0y+/0rJ6j+oa9uE/QbX\r\nMgtcmBA3nfTVynEpEEr3eeUatcSETDyQgiwqvT4KCaN+mVtjszafMx90czbx\r\nz+exTbYPEWOBqb3/GzetCt8TAuEUnlYq5MttNEVAf/sr5wq79mRlqRwqE/fN\r\nIxYHM91KUU0xSkwbE+7pICTBPSXvUeQuUP8dqiEgYdBNMW+mubmPTtxg0vd9\r\nHAwuGXwX5Y57LDwp+hMrYUAkkvF0dRD4j2U9+5nwdB8w5lLdFux2EO7xaPMc\r\niQNtf7vBLwnqoGID6GZz6X7ON0C0CV1qxc01csRLzU9QgFmDs91at6HW8706\r\nBZg1V/Wo8zXAt2HhtfCeA1KKiqQSHIANA3g=\r\n=r3FV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.0_1662051763834_0.47005861560765383"},"_hasShrinkwrap":false},"1.9.1":{"name":"@root/request","version":"1.9.1","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"./request.js":"./browser.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublish":"./bin/localize-types"},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"b4b55523d2d410fd10bb303ab8edae2cc1e440e7","_id":"@root/request@1.9.1","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-ROVgS5qgTvXDCI9XoJawJCB+QfC9jF7t3pFWmdUibjHqPt+2wV7pYSgth65qb65bK3qDIv9xXYF5FBECKhe8Iw==","shasum":"d830520ed4d4ca94b1eb07b052a635b14c069fd1","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.1.tgz","fileCount":9,"unpackedSize":55606,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBsVZ3Q8nOKeT/R/uv3HCU5UojDIP634VrJ684yndGpGAiEAuHPl/BOZR58+Co+dFywD0i7zzmzwX+MV/CIxbu9ZRWo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjFj6hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqgBAAkIwk5dioJ3p3K1lEd9mQljHlyXD3oH8ceoNeMv0Rc9AbtT7M\r\nJVT+oPzReNfTC3vx58R1bqK89e2kpatBaHq9ICoSk4iNmoY5vpPfBzy2pZvy\r\nRjDPYFCe1CvfRah3Wm5orUzXVfPafNqSvvydd2fx81fRAF7UbLf0k6gtTjjk\r\nAFoRcg7FmQNrxM5BeY9IZIvjGciHNt6Bufcvd4cHO0FSnLSHGmWLWazcbe6O\r\nCNkVQiXQxuelRdenjbL4FiCo5w7WVfd5sA7uxHOZeYG9XZe6E/7kNrhRbmV8\r\nfjvw8lHt205zhDMzwadnOoEnJWqX/zM1l/IFlSzLXA2e9NXOkN/KKe/XOsCS\r\ntk0oZ3ER6ucCfOnkXHAFpoIewOlxIA4EXTufmam0K9whPSjSQrDo2azj76ED\r\nLI8sMQ+yBh7yFw0f1lDVKZnrnxGWM25Lu/UT+EuLNWSIoJ9SqKYAsjdMW3TN\r\n27O/LJLeQQAphni2eX9PtyZWOx5p+xeiVp7DPhqnR3oMzh+8R9G8TQZK9UtW\r\nZXYj6D/n/M7DBxFT5OncNHjdF33KORJjAtLTY4G9ZQ99kblk/plEnhH43x50\r\nYLTBx8/5aYK6PA6AQZOaVrNhu7Hua27llY79u836MU5fKPixfljvBlIRFYFH\r\nyP3+xtW78qdIS7ClQN/S6mZVoZBZIm3rg2g=\r\n=qrmj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.1_1662402209053_0.8706282657245927"},"_hasShrinkwrap":false},"1.9.2":{"name":"@root/request","version":"1.9.2","description":"A lightweight, zero-dependency drop-in replacement for request","main":"index.js","browser":{"./request.js":"./urequest.js"},"directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","version":"npm version -m \"chore(release): bump to v%s\""},"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"keywords":["request","lightweight","alternative","http","https","call"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","gitHead":"7ce7e9d0914020db776ffb048966014c4058c11f","_id":"@root/request@1.9.2","_nodeVersion":"18.9.1","_npmVersion":"8.19.1","dist":{"integrity":"sha512-wVaL9yVV9oDR9UNbPZa20qgY+4Ch6YN8JUkaE4el/uuS5dmhD8Lusm/ku8qJVNtmQA56XLzEDCRS6/vfpiHK2A==","shasum":"3b561b3f3b61d3a6264cdb25cfef7c473749e7d5","tarball":"https://registry.npmjs.org/@root/request/-/request-1.9.2.tgz","fileCount":6,"unpackedSize":50418,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMPT+3ERCFGan3nF5ILD+5Lj60vUf8A1CEZLtm2x1TPgIhAJDyGavElRIuwhZwbTeKBQz7NrKeEani0rSdDKSrGCR3"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNSh3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEfw//RBmu4YG4mRK75WtFpdgvwPPn+jEknHGcUKn3aIRrKgWEimDM\r\n8SQ7xmFrB3p2adBFtVGjFGZf/p8S/vDalZ5LjTw05GkzwhDQ2fizlY5gI76f\r\n27QkEMCbXO+4OL3IPMlwswcOgjrArOLFYcSUHccHLSQIGUPHTMtNw/YeTaeM\r\nEJtxRGz1bc0+MLyTp/AbFF5v2nKJaF0J7UYKtuim4zqUrRCif6zuSVDnDldy\r\nb+WFIVh1Uy/8/LNybRnLW5eBFEc74f8ut7hwnRJ5n1eZ+YJpJbrg4N9cOYL5\r\ntHHCnnK0AgenWJ+TUcTH5YnevHdw/ymZyqWDiVuyd3j1sOQhUq0q4ATPXpES\r\nEnZRAzAuJ51hdVrkjSTv4uYSN1ZHCHJF/ANrdMsiZlRPQh9wXaevgDdNu7a/\r\n+PgmXmuWmADWahIuqe6DHBg4cHYTbIbPtktW+qoMDDU0lsN+YGLGPILi84QM\r\nAtLCHXYDIB0vTtUJVXl1zBzO3S4OnqU35DetxKV/OGbX0XcDYiifXo9a6Xky\r\n6lVL14Upo2WGJhgDAdoylpjaoiCfJ8+wr9+tQMbl574RHzZuHhpmDJhz+p1B\r\n5RgFjTf8DAtrF4Wkt0HN2rtk/m402j1uZhMpNdh7IJWv6XFEJfyOQMEyz5E/\r\n0LdYzPupbiczNPFlCrsBIx9yOu8CrWHG2XE=\r\n=BuyY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request_1.9.2_1664428151731_0.3587129649705809"},"_hasShrinkwrap":false}},"time":{"created":"2019-04-04T07:41:29.237Z","1.3.8":"2019-04-04T07:41:30.104Z","modified":"2022-09-29T05:09:12.069Z","1.3.9":"2019-04-16T18:41:25.884Z","1.3.10":"2019-04-16T18:43:36.541Z","1.3.11":"2019-05-23T19:28:12.674Z","1.3.12":"2019-10-29T20:43:09.967Z","1.4.0":"2019-10-29T20:57:48.875Z","1.4.1":"2019-10-30T03:54:07.648Z","1.4.2":"2019-11-01T07:18:48.998Z","1.3.13":"2019-11-01T07:25:10.628Z","1.5.0":"2020-03-12T08:03:19.686Z","1.6.0":"2020-04-29T04:59:22.724Z","1.6.1":"2020-04-29T05:15:06.224Z","1.7.0":"2021-01-14T23:35:44.647Z","1.8.0":"2021-10-18T07:42:47.159Z","1.8.1":"2022-01-12T20:10:07.107Z","1.8.2":"2022-06-14T07:38:08.422Z","1.8.3":"2022-07-07T08:56:12.237Z","1.9.0-0":"2022-09-01T05:11:43.504Z","1.9.0-1":"2022-09-01T06:10:01.449Z","1.9.0-2":"2022-09-01T06:22:51.453Z","1.9.0-3":"2022-09-01T06:30:45.826Z","1.9.0-4":"2022-09-01T06:33:14.582Z","1.9.0-5":"2022-09-01T06:45:40.580Z","1.9.0-6":"2022-09-01T06:49:14.791Z","1.9.0-7":"2022-09-01T06:51:14.734Z","1.9.0-8":"2022-09-01T07:09:40.135Z","1.9.0":"2022-09-01T17:02:44.038Z","1.9.1":"2022-09-05T18:23:29.245Z","1.9.2":"2022-09-29T05:09:11.949Z"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"description":"A lightweight, zero-dependency drop-in replacement for request","keywords":["request","lightweight","alternative","http","https","call"],"repository":{"type":"git","url":"https://git.rootprojects.org/root/request.js.git"},"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://coolaj86.com/"},"license":"(MIT OR Apache-2.0)","readme":"# [@root/request](https://git.rootprojects.org/root/request.js) | a [Root](https://rootprojects.org) project\n\n> Minimalist HTTP client\n\nA lightweight alternative to (and 80/20 drop-in replacement for) request.\n\nHas the 20% of features that 80%+ of people need, in about 500 LoC.\n\nWritten from scratch, with zero-dependencies.\n\n## Super simple to use\n\n@root/request is designed to be a drop-in replacement for request. It also supports Promises and async/await by default, enhanced stream support, and a few other things as mentioned below.\n\n```bash\nnpm install --save @root/request\n\n# or npm install git+ssh://git@git.therootcompany.com/request.js\n```\n\n```js\nvar request = require('@root/request');\nrequest('http://www.google.com', function (error, response, body) {\n    console.log('error:', error); // Print the error if one occurred\n    console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n    console.log('body:', body); // Print the HTML for the Google homepage.\n});\n```\n\n**Using Promises**\n\n```js\nvar request = require('@root/request');\n\nrequest('http://www.google.com')\n    .then(function (response) {\n        console.log('statusCode:', response.statusCode); // Print the response status code if a response was received\n        console.log('body:', response.body); // Print the HTML for the Google homepage.\n    })\n    .catch(function (error) {\n        console.log('error:', error); // Print the error if one occurred\n    });\n```\n\n**Streaming**\n\nIn order to keep this library lightweight, performant, and keep the code easy to\nread, the streaming behavior is **_slightly different_** from that of\n`request.js`.\n\n```diff\n-var request = require('request');\n+var request = require('@root/request');\n\n-var stream = request({ url, headers });\n+var stream = await request({ url, headers });\n\n let attachment = await new MailgunAPI.Attachment({\n   data: stream\n })\n```\n\nExample:\n\n```js\nvar request = require('@root/request');\n\nvar resp = await request({\n    url: 'http://www.google.com',\n    stream: true // true | 'filename.ext' | stream.Writable\n});\n\n// 'resp' itself is a ReadableStream\nresp.on('data', function () {\n    // got some data\n});\n\nresp.on('end', function () {\n    // the data has ended\n});\n\n// 'resp.stream' is a Promise that is resolved when the read stream is destroyed\nawait resp.stream; // returns `undefined`\nconsole.log('Done');\n```\n\nThe difference is that we don't add an extra layer of stream abstraction.\nYou must use the response from await, a Promise, or the callback.\n\nYou can also give a file path:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: '/tmp/google-index.html'\n});\n```\n\nWhich is equivalent to passing a write stream for the file:\n\n```js\nrequest({\n    url: 'http://www.google.com',\n    stream: fs.createWriteStream('/tmp/google-index.html')\n});\n```\n\nAlso, `await resp.stream.body()` can be used to get back the full body (the same as if you didn't use the `stream` option:\n\n```js\nlet resp = await request({\n    url: 'http://www.google.com',\n    stream: true\n});\nif (!resp.ok) {\n    await resp.stream.body();\n    console.error(resp.body);\n}\n```\n\n## Table of contents\n\n-   [Extra Features](/EXTRA.md)\n-   [Forms](#forms)\n-   [HTTP Authentication](#http-authentication)\n-   [Custom HTTP Headers](#custom-http-headers)\n-   [Unix Domain Sockets](#unix-domain-sockets)\n-   [**All Available Options**](#requestoptions-callback)\n\n## Extra Features\n\nThe following are features that the original `request` did not have, but have been added for convenience in `@root/request`.\n\n-   Support for `async`/`await` & `Promise`s (as explained above)\n-   `request({ userAgent: 'my-api/1.1' })` (for building API clients)\n-   `resp.ok` (just like `fetch`)\n-   `resp.stream` (see above)\n\nSee [EXTRA.md](/EXTRA.md)\n\n## Forms\n\n`@root/request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads.\n\n<!-- For `multipart/related` refer to the `multipart` API. -->\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', { form: { key: 'value' } });\n// or\nrequest.post(\n    { url: 'http://service.com/upload', form: { key: 'value' } },\n    function (err, httpResponse, body) {\n        /* ... */\n    }\n);\n```\n\n<!--\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n-->\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data/tree/v2.5.1) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\nTo use `form-data`, you must install it separately:\n\n```bash\nnpm install --save form-data@2.x\n```\n\n```js\nvar formData = {\n    // Pass a simple key-value pair\n    my_field: 'my_value',\n    // Pass data via Buffers\n    my_buffer: Buffer.from([1, 2, 3]),\n    // Pass data via Streams\n    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n    // Pass multiple values /w an Array\n    attachments: [\n        fs.createReadStream(__dirname + '/attachment1.jpg'),\n        fs.createReadStream(__dirname + '/attachment2.jpg')\n    ],\n    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n    // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n    // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n    custom_file: {\n        value: fs.createReadStream('/dev/urandom'),\n        options: {\n            filename: 'topsecret.jpg',\n            contentType: 'image/jpeg'\n        }\n    }\n};\nrequest.post(\n    { url: 'http://service.com/upload', formData: formData },\n    function optionalCallback(err, httpResponse, body) {\n        if (err) {\n            return console.error('upload failed:', err);\n        }\n        console.log('Upload successful!  Server responded with:', body);\n    }\n);\n```\n\n<!--\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', Buffer.from([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\n-->\n\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n---\n\n## HTTP Authentication\n\n<!--\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\n-->\n\n```js\nrequest.get('http://some.server.com/', {\n    auth: {\n        user: 'username',\n        pass: 'password',\n        sendImmediately: false\n    }\n});\n// or\nrequest.get('http://some.server.com/', {\n    auth: {\n        bearer: 'bearerToken'\n    }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n-   `user` || `username`\n-   `pass` || `password`\n-   `bearer` (optional)\n\n<!--\n- `sendImmediately` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n-->\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({ url: url }, function (error, response, body) {\n    // Do more stuff with 'body' here\n});\n```\n\n<!--\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n-->\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n---\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n    url: 'https://api.github.com/repos/request/request',\n    headers: {\n        'User-Agent': 'request'\n    }\n};\n\nfunction callback(error, response, body) {\n    if (!error && response.statusCode == 200) {\n        var info = JSON.parse(body);\n        console.log(info.stargazers_count + ' Stars');\n        console.log(info.forks_count + ' Forks');\n    }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n---\n\n## UNIX Domain Sockets\n\n`@root/request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH';\n/* Example */ request.get(\n    'http://unix:/absolute/path/to/unix.socket:/request/path'\n);\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n-   `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n-   `method` - http method (default: `\"GET\"`)\n-   `headers` - http headers (default: `{}`)\n\n<!-- TODO\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n-->\n\n---\n\n-   `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.\n-   `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n\n<!-- TODO\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.\n-->\n\n---\n\n-   `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n-   `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n-   `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`)\n-   `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n-   `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n-   `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n\n<!-- TODO\n- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n-->\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n    headers: { 'x-token': 'my-token' }\n});\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n    headers: { special: 'special value' }\n});\n```\n\n### request.METHOD()\n\nThese HTTP method convenience functions act just like `request()` but with a default method already set for you:\n\n-   _request.get()_: Defaults to `method: \"GET\"`.\n-   _request.post()_: Defaults to `method: \"POST\"`.\n-   _request.put()_: Defaults to `method: \"PUT\"`.\n-   _request.patch()_: Defaults to `method: \"PATCH\"`.\n-   _request.del() / request.delete()_: Defaults to `method: \"DELETE\"`.\n-   _request.head()_: Defaults to `method: \"HEAD\"`.\n-   _request.options()_: Defaults to `method: \"OPTIONS\"`.\n\n---\n\n## Debugging\n\nThere are at least <!--three--> two ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=@root/request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('@root/request').debug = true` at any time (this does the same thing\n   as #1).\n\n<!-- TODO\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n-->\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md"}