{"name":"teeny-request","version":"5.1.2","description":"Like request, but smaller.","main":"./build/src/index.js","types":"./build/src/index.d.ts","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","posttest":"npm run lint","docs":"compodoc src/","predocs-test":"npm run docs","docs-test":"linkinator docs","samples-test":"echo no sample tests!","system-test":"echo no system tests!"},"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":{"https-proxy-agent":"^2.2.1","node-fetch":"^2.2.0","uuid":"^3.3.2"},"devDependencies":{"@compodoc/compodoc":"^1.1.9","@types/mocha":"^5.2.5","@types/nock":"^10.0.0","@types/node-fetch":"^2.1.2","@types/sinon":"^7.0.13","@types/uuid":"^3.4.4","c8":"^5.0.1","codecov":"^3.1.0","gts":"^1.0.0","linkinator":"^1.5.0","mocha":"^6.1.4","nock":"^10.0.2","sinon":"^7.3.2","typescript":"^3.0.1"},"nyc":{"exclude":["build/test"]},"gitHead":"69364cc1f1a41da5c8776afcf18a65fc782b83ce","_id":"teeny-request@5.1.2","_npmVersion":"6.4.1","_nodeVersion":"8.16.0","_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"dist":{"integrity":"sha512-mY4cJVqRsOqW0fRNDZt/dcLD/Pz8LsgVjcvblDl5VDXcuMAt64mH5+iUvgTwsLZG2UVc44dSFCWPL7VcSc/fLA==","shasum":"0223278fc8d30d7fd7a5d3bf72c7710ca302a9d2","tarball":"http://registry-npm.ywwl.com/teeny-request/download/teeny-request-5.1.2.tgz","fileCount":7,"unpackedSize":36294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSbPNCRA9TVsSAnZWagAAqDgP/08QrER7xuBE9UwWWMOe\nAh7MEY0qHqE/dJ17d0HXf7jtiaNXPaOq4OIB7kTIGHYsKc2YtNxanyaZxR9A\nP2Ii90DIkc+e6IDVogQiOfbNdjtehp09jSFnbpQatk1nRNmpSRqHhBDH81P6\nVNvJ1nxjV2s3DA1eXrfriLYLp4vd3WRUaGqe2Ee3uo+13Q3Abzl86hD/sCvH\nLFj8pc4Y0cT1ngIdoCt9FMp20rAoC9pyN1Y16g3LJXO8tU4wVk9E70x2x+Oz\n3BlMI8LPgkRqVHJksTaolinRvd1t67AYEY+wieV8ZPof45mhFovi2Z46dx8s\n6KK7jw46mh7fLBarJW3/JoN3mc80u+QB804nf9VLjy7RduTPAsLb+cSEiY51\n6QSjqKRjUIrmz5YCNLh3wnfF3iwou1O7ypz6bu8V9j2mb9Bx5OjpMUPSdCeU\nqhOLWZKdWNM6urkMcV2Dyuo9CbjhI9ODgbobqnoaSzgpgw5dx2fIVyhytUJt\nyNmWZtnt+XBCgEYjUypBdG/7Z3mazSvK/nCgmhuhlU3k/kGVJq2FVJHXEhRH\n5CaSBj5VN/zMxpypnjzSFzJlK6qMrJ7makCw/Uq+Fu3ZRsxVlL7wNhJnGq/l\nau9fW44KXAfK0M177PwJYqac5lNVbn6L6NltZ9Ec97BuFQWaPSL/n7yC0YFY\nIkkL\r\n=mrBO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsAwMITWmLERalSLz20OHGVE4ieIGxhwdt7YA3a2RuQgIhAJxccIdKymGShPE1AiOXE9e7pYuQfxFD3aLcE4r96wss"}],"size":11129,"noattachment":false,"key":"/teeny-request/-/teeny-request-5.1.2.tgz"},"maintainers":[{"email":"fhinkel@vt.edu","name":"fhinkel"},{"email":"node-team-npm+wombot@google.com","name":"google-wombot"},{"email":"justin.beckwith@gmail.com","name":"justinbeckwith"},{"email":"kinwa91@msn.com","name":"kinwa91"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/teeny-request_5.1.2_1565111245184_0.6598386881996205"},"_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":1565111245373,"_cnpm_publish_time":1565111245373,"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"}}