{"name":"teeny-request","version":"8.0.3","description":"Like request, but smaller.","main":"./build/src/index.js","types":"./build/src/index.d.ts","engines":{"node":">=12"},"scripts":{"test":"c8 mocha build/test","compile":"tsc -p .","pretest":"npm run compile","lint":"gts check","clean":"gts clean","fix":"gts fix","prepare":"npm run compile","docs":"compodoc src/","predocs-test":"npm run docs","docs-test":"linkinator docs","samples-test":"echo no sample tests!","system-test":"echo no system tests!","precompile":"gts clean"},"repository":{"type":"git","url":"git+https://github.com/googleapis/teeny-request.git"},"keywords":["request","node-fetch","fetch"],"author":{"name":"fhinkel"},"license":"Apache-2.0","bugs":{"url":"https://github.com/googleapis/teeny-request/issues"},"homepage":"https://github.com/googleapis/teeny-request#readme","dependencies":{"http-proxy-agent":"^5.0.0","https-proxy-agent":"^5.0.0","node-fetch":"^2.6.1","stream-events":"^1.0.5","uuid":"^9.0.0"},"devDependencies":{"@compodoc/compodoc":"^1.1.9","@types/mocha":"^10.0.0","@types/node-fetch":"^2.5.7","@types/sinon":"^10.0.0","@types/uuid":"^9.0.0","c8":"^7.0.0","codecov":"^3.1.0","gts":"^3.1.0","linkinator":"^4.0.0","mocha":"^10.0.0","nock":"^13.0.0","typescript":"^4.6.3","sinon":"^15.0.0"},"nyc":{"exclude":["build/test"]},"gitHead":"e0bc738cca0926e3be317f37630c8eef592f03f4","_id":"teeny-request@8.0.3","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-jJZpA5He2y52yUhA7pyAGZlgQpcB+xLjcN0eUFxr9c8hP/H7uOXbBNVo/O0C/xVfJLJs680jvkFgVJEEvk9+ww==","shasum":"5cb9c471ef5e59f2fca8280dc3c5909595e6ca24","tarball":"http://registry-npm.ywwl.com/teeny-request/download/teeny-request-8.0.3.tgz","fileCount":13,"unpackedSize":65843,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCp7RGjH7Gb0bfEPsBi5snGTGsXTTsbcRvUypfZgHy2TwIgcmOaJJjzsStSTAsAa5H//z3TXbHamxCcBpzTKxObdAo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9PiDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1Rw//ZplS59jqA0jzzLRmiM64+cOzTb5zYSiRZ9FESocBVXZXYrSX\r\nUBo0HyXSNKK+mvCTu/S9vygqlr9ArqkaAteWWX3XJaACbeF5LNbtmGA2K1da\r\n0kQa9tUwxDREzfL24HbZt5hEctw4/Az9L6AmoiVGGh0mOtBchCfwZYZagY/W\r\nGh2GGVKHvJaCfx6J7ipLwmyWwNA1o1wCnGqjhbd8UqLLFS16oNuLoIq6IAw+\r\n5Ile9AwdGjyFs2grb/bVjIx4CBsvL/+80CM4RZcjCTvuJRS6m/VjBv7j83cr\r\nN18vveWvCRi3bbWpysekagmoynYQqz7a5DkFRDSnzZ1HBVOhqMf9u4XngmeK\r\naOPf1ipmc3lmSZcHTw0a18TL1FavotbirmJSm1CK5Ggva0jCJ9r97YCs1kyi\r\nUTprSWmR+z+oKACRrsWdR1xqj6xzyzpiniWKAnGx15tTIGDKXWuvUfXYs7tR\r\nmGqC8+IqPSK7jAOm10Rkuhr+OdBhqZ5A0eUJTPdquWIaEikVkBkxFX6Sou0z\r\nPIJixSDFcrCZgcVhTwmCY8mPEtqDn1YUjXi6HaxsEfyduDPHWAB1eA1xmVs0\r\njsgfDdXlkBeYWiHdSsnCnkD+rKUT0RQbbNk1o3sIucXr1/1C68BdfiOyP4sx\r\n8CufWtnkzX4L3UyL7WowZxrG7PC0KvqNvK4=\r\n=cns2\r\n-----END PGP SIGNATURE-----\r\n","size":18249,"noattachment":false,"key":"/teeny-request/-/teeny-request-8.0.3.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"justinbeckwith","email":"justin.beckwith@gmail.com"},{"name":"fhinkel","email":"fhinkel@vt.edu"},{"name":"kinwa91","email":"kinwa91@msn.com"},{"name":"google-wombot","email":"node-team-npm+wombot@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/teeny-request_8.0.3_1676998787676_0.8893798094621477"},"_hasShrinkwrap":false,"readme":"[![Build Status](https://travis-ci.org/googleapis/teeny-request.svg?branch=master)](https://travis-ci.org/googleapis/teeny-request)\n\n# teeny-request \n\nLike `request`, but much smaller - and with less options. Uses `node-fetch` under the hood. \nPop it in where you would use `request`. Improves load and parse time of modules. \n\n```js\nconst request = require('teeny-request').teenyRequest;\n\nrequest({uri: 'http://ip.jsontest.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 JSON.\n});\n```\n\nFor TypeScript, you can use `@types/request`. \n\n```ts\nimport {teenyRequest as request} from 'teeny-request';\nimport * as r from 'request'; // Only for type declarations\n\nrequest({uri: 'http://ip.jsontest.com/'}, (error: any, response: r.Response, body: any) => {\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 JSON.\n});\n```\n\n\n\n## teenyRequest(options, callback)\n\nOptions are limited to the following \n\n* uri\n* method, default GET\n* headers\n* json\n* qs\n* useQuerystring\n* timeout in ms\n* gzip\n* proxy\n\n```ts\nrequest({uri:'http://service.com/upload', method:'POST', json: {key:'value'}}, function(err,httpResponse,body){ /* ... */ })\n```\n\nThe callback argument gets 3 arguments:\n\n * An error when applicable (usually from http.ClientRequest object)\n * A response object with statusCode, a statusMessage, and a body\n * The third is the response body (JSON object)\n\n## defaults(options)\n\nSet default options for every `teenyRequest` call.\n\n```ts\nlet defaultRequest = teenyRequest.defaults({timeout: 60000});\n      defaultRequest({uri: 'http://ip.jsontest.com/'}, function (error, response, body) {\n            assert.ifError(error);\n            assert.strictEqual(response.statusCode, 200);\n            console.log(body.ip);\n            assert.notEqual(body.ip, null);\n            \n            done();\n        });\n```        \n\n## Proxy environment variables\nIf environment variables `HTTP_PROXY`, `HTTPS_PROXY`, or `NO_PROXY` are set, they are respected.\n\n## Building with Webpack 4+\nSince 4.0.0, Webpack uses `javascript/esm` for `.mjs` files which handles ESM more strictly compared to `javascript/auto`. If you get the error `Can't import the named export 'PassThrough' from non EcmaScript module`, please add the following to your Webpack config:\n\n```js\n{\n    test: /\\.mjs$/,\n    type: 'javascript/auto',\n},\n```\n\n## Motivation\n`request` has a ton of options and features and is accordingly large. Requiring a module incurs load and parse time. For\n`request`, that is around 600ms.\n\n![Load time of request measured with require-so-slow](https://user-images.githubusercontent.com/101553/44694187-20357700-aa3a-11e8-9116-b8ae794cbc27.png)\n\n`teeny-request` doesn't have any of the bells and whistles that `request` has, but is so much faster to load. If startup time is an issue and you don't need much beyond a basic GET and POST, you can use `teeny-request`.\n\n## Thanks\nSpecial thanks to [billyjacobson](https://github.com/billyjacobson) for suggesting the name. Please report all bugs to them. Just kidding. Please open issues.\n","publish_time":1676998787828,"_cnpm_publish_time":1676998787828,"dist-tags":{"latest":"11.1.1","legacy-10":"7.2.0","legacy-12":"8.0.3","legacy-14":"9.0.0","legacy-18":"10.1.4","legacy-8":"6.0.2"}}