{"_id":"@uphold/request-logger","_rev":"19-b930ee8257e6d46392f8da50ada44749","name":"@uphold/request-logger","description":"A wrapper for the request module that logs all request events","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"@uphold/request-logger","version":"1.0.0","description":"A wrapper for the request module that logs all request events","keywords":["http","https","logger","request"],"homepage":"https://github.com/uphold/request-logger","bugs":{"url":"https://github.com/uphold/request-logger/issues"},"license":"MIT","author":{"name":"Pedro Branco","email":"branco@uphold.com","url":"https://github.com/pedrobranco"},"files":["index.js"],"main":"index.js","repository":{"type":"git","url":"git+https://github.com/uphold/request-logger.git"},"scripts":{"changelog":"github_changelog_generator --no-issues --header-label='# Changelog' --future-release=v$npm_config_future_release && sed -i '' -e :a -e '$d;N;2,4ba' -e 'P;D' CHANGELOG.md","lint":"eslint index.js test","test":"jest --coverage --verbose","version":"npm run changelog --future-release=$npm_package_version && git add -A CHANGELOG.md"},"dependencies":{"lodash.clonedeep":"^4.5.0","uuid":"^3.0.1"},"devDependencies":{"eslint":"^3.12.2","eslint-config-seegno":"^8.0.1","jest":"^18.1.0","nock":"^9.0.2","request":"^2.79.0"},"peerDependencies":{"request":">=2.27.0"},"engines":{"node":">=6"},"gitHead":"0c2b55edba04abe0a69644c26c00767da91709b2","_id":"@uphold/request-logger@1.0.0","_shasum":"8c4758441d5604d5d55280506fd2f8cffcd95791","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"uphold","email":"opensource@uphold.com"},"dist":{"shasum":"8c4758441d5604d5d55280506fd2f8cffcd95791","tarball":"https://registry.npmjs.org/@uphold/request-logger/-/request-logger-1.0.0.tgz","integrity":"sha512-RXJbVlcUUAMIglH4ckCXPlxi6L3ymjF6nbBrwosh1FYFVXs6UCewAOvNSrGFbaQfk6fp59FpvuVU+/ct2G4gtQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjUxcP1SD3v5VWekzViJeJDcAiL6sJgsl28ac7yXelVgIgZNbQjRSMQ0ufnzTGVA/mZuCw4KzuhjQJRDEQoISIq7I="}]},"maintainers":[{"name":"uphold","email":"opensource@uphold.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/request-logger-1.0.0.tgz_1483972494984_0.8480743588879704"},"directories":{}},"1.1.0":{"name":"@uphold/request-logger","version":"1.1.0","description":"A wrapper for the request module that logs all request events","keywords":["http","https","logger","request"],"homepage":"https://github.com/uphold/request-logger","bugs":{"url":"https://github.com/uphold/request-logger/issues"},"license":"MIT","author":{"name":"Pedro Branco","email":"branco@uphold.com","url":"https://github.com/pedrobranco"},"main":"src","repository":{"type":"git","url":"git+https://github.com/uphold/request-logger.git"},"scripts":{"changelog":"github_changelog_generator --no-issues --header-label='# Changelog' --future-release=v$npm_config_future_release && sed -i '' -e :a -e '$d;N;2,4ba' -e 'P;D' CHANGELOG.md","lint":"eslint src test","test":"jest --coverage --verbose","version":"npm run changelog --future-release=$npm_package_version && git add -A CHANGELOG.md"},"dependencies":{"lodash.clonedeep":"^4.5.0","uuid":"^3.0.1"},"devDependencies":{"eslint":"^3.12.2","eslint-config-seegno":"^8.0.1","jest":"^18.1.0","nock":"^9.0.2","request":"^2.79.0"},"peerDependencies":{"request":">=2.27.0"},"engines":{"node":">=4"},"jest":{"coveragePathIgnorePatterns":["/src/proxy.js"]},"gitHead":"63947016d8a5b8c6705f99c9ef1623ffe593e280","_id":"@uphold/request-logger@1.1.0","_shasum":"8ffb402f493847fc96277677ff242ded5189f17b","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"uphold","email":"opensource@uphold.com"},"dist":{"shasum":"8ffb402f493847fc96277677ff242ded5189f17b","tarball":"https://registry.npmjs.org/@uphold/request-logger/-/request-logger-1.1.0.tgz","integrity":"sha512-ByUR2ME3AIUhZ8uMAvEgF+yy67MnZ43jDn0lU4e34DbQ3pI0pmGMseib/FO/iLCp1hkET66PRkkLtN6GZxn0aA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRCihgTXu96pjHDnjz4YkvnkJy6lAx5iIipl7iCrg1lgIgeOZIDc0QgQ4ZONKzNri/m4rwJm82ypYJ2w+oIqCLZqY="}]},"maintainers":[{"name":"uphold","email":"opensource@uphold.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/request-logger-1.1.0.tgz_1484078283823_0.44238678086549044"},"directories":{}},"1.2.0":{"name":"@uphold/request-logger","version":"1.2.0","description":"A wrapper for the request module that logs all request events","keywords":["http","https","logger","request"],"homepage":"https://github.com/uphold/request-logger","bugs":{"url":"https://github.com/uphold/request-logger/issues"},"license":"MIT","author":{"name":"Pedro Branco","email":"branco@uphold.com","url":"https://github.com/pedrobranco"},"main":"src","repository":{"type":"git","url":"git+https://github.com/uphold/request-logger.git"},"scripts":{"changelog":"github_changelog_generator --no-issues --header-label='# Changelog' --future-release=v$npm_config_future_release && sed -i '' -e :a -e '$d;N;2,4ba' -e 'P;D' CHANGELOG.md","lint":"eslint src test","test":"jest --coverage --verbose","version":"npm run changelog --future-release=$npm_package_version && git add -A CHANGELOG.md"},"dependencies":{"lodash.clonedeep":"^4.5.0","uuid":"^3.0.1"},"devDependencies":{"eslint":"^3.12.2","eslint-config-seegno":"^8.0.1","jest":"^18.1.0","nock":"^9.0.2","request":"^2.79.0"},"peerDependencies":{"request":">=2.27.0"},"engines":{"node":">=4"},"jest":{"coveragePathIgnorePatterns":["/src/proxy.js"]},"gitHead":"ab030c70eb6b1e720d6b7774479a4d77de6eabff","_id":"@uphold/request-logger@1.2.0","_shasum":"e406893711e3de0369553155075890bec064a073","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.4","_npmUser":{"name":"uphold","email":"opensource@uphold.com"},"dist":{"shasum":"e406893711e3de0369553155075890bec064a073","tarball":"https://registry.npmjs.org/@uphold/request-logger/-/request-logger-1.2.0.tgz","integrity":"sha512-wFEjVJmTQukGI0YErchXti9NQp3wqMb3lKh23L3K3QQbbJ6trzbWjVRGYMqbTIvlihRZ7QPxyB/3g09OLL2Nxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHAm8B4bh4316m0CDLe2dcwJzby9RvkFBPoU2VpMSpkVAiAFI9N4EG5j9xjuapUxUs5v7Pz6LzM1bOEpN6QeTYv0Qw=="}]},"maintainers":[{"name":"uphold","email":"opensource@uphold.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/request-logger-1.2.0.tgz_1484220691173_0.6351959411986172"},"directories":{}},"2.0.0":{"name":"@uphold/request-logger","version":"2.0.0","description":"A wrapper for the request module that logs all request events","keywords":["http","https","logger","request"],"homepage":"https://github.com/uphold/request-logger","bugs":{"url":"https://github.com/uphold/request-logger/issues"},"license":"MIT","author":{"name":"Pedro Branco","email":"branco@uphold.com","url":"https://github.com/pedrobranco"},"main":"src","repository":{"type":"git","url":"git+https://github.com/uphold/request-logger.git"},"scripts":{"changelog":"github_changelog_generator --no-issues --header-label='# Changelog' --future-release=v$npm_config_future_release && sed -i '' -e :a -e '$d;N;2,4ba' -e 'P;D' CHANGELOG.md","lint":"eslint src test","test":"jest --coverage --verbose","version":"npm run changelog --future-release=$npm_package_version && git add -A CHANGELOG.md"},"dependencies":{"uuid":"^3.0.1"},"devDependencies":{"eslint":"^3.12.2","eslint-config-seegno":"^8.0.1","jest":"^18.1.0","nock":"^9.0.2","request":"^2.79.0"},"peerDependencies":{"request":">=2.27.0"},"engines":{"node":">=4"},"jest":{"coveragePathIgnorePatterns":["/src/proxy.js"]},"gitHead":"e55623d188d0a4c5caa21ac1b06257323047383c","_id":"@uphold/request-logger@2.0.0","_shasum":"c585c0bdb94210198945c6597e4fe23d6e63e084","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.2","_npmUser":{"name":"uphold-owner","email":"opensource@uphold.com"},"dist":{"shasum":"c585c0bdb94210198945c6597e4fe23d6e63e084","tarball":"https://registry.npmjs.org/@uphold/request-logger/-/request-logger-2.0.0.tgz","integrity":"sha512-UvGS+v87C7VTtQDcFHDLfvfl1zaZaLSwSmAnV35Ne7CzAVvotmZqt9lAIoNpMpaoRpdjVIcnUDwPSeIeA//EoQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAxgnVU6gIaZbFOaF0svU64zaXqUFumWEjwuyWSHWD+FAiAPkQsmkEirCacBzuYEn4jYeM5zauqftOzrisZCUDJvxA=="}]},"maintainers":[{"name":"uphold-owner","email":"opensource@uphold.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/request-logger-2.0.0.tgz_1490986695929_0.36858811927959323"},"directories":{}},"3.0.0":{"name":"@uphold/request-logger","version":"3.0.0","description":"A wrapper for the request module that logs all request events","keywords":["http","https","logger","request"],"homepage":"https://github.com/uphold/request-logger","bugs":{"url":"https://github.com/uphold/request-logger/issues"},"license":"MIT","author":{"name":"Pedro Branco","email":"branco@uphold.com","url":"https://github.com/pedrobranco"},"main":"src","repository":{"type":"git","url":"git+https://github.com/uphold/request-logger.git"},"scripts":{"lint":"eslint src test","release":"release-it","test":"jest --coverage --verbose"},"dependencies":{},"devDependencies":{"@cypress/request":"^3.0.1","eslint":"^8.57.0","eslint-config-uphold":"^6.0.0","jest":"^29.7.0","nock":"^13.5.4","release-it":"^17.1.1"},"peerDependencies":{"@cypress/request":">=3.0.1"},"engines":{"node":">=4"},"jest":{"coveragePathIgnorePatterns":["/src/proxy.js"],"restoreMocks":true},"_id":"@uphold/request-logger@3.0.0","gitHead":"97645dba7cee22b0f940b9337faa8a9edcd19c83","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-LpBpfD7n/qbsw00E6adSIqAJ6SDo76TPk7I3XGjOZfB7A2MoVaesQXSQINhkBbcsFP5oEroQPZh+1hcHke/FSg==","shasum":"c3395ff0f487a20e72bbc8ae5a59e7d1d1a4e2c9","tarball":"https://registry.npmjs.org/@uphold/request-logger/-/request-logger-3.0.0.tgz","fileCount":6,"unpackedSize":15823,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZPGgF+tD5iX5W2cQ1GCL2owSqVrzm1evMtWL8+ZCmPAiAVr5h8snlIFCWlSr1F8/VABBCKo7T3MowiIxS5/uLLBg=="}]},"_npmUser":{"name":"botatuphold","email":"bot@uphold.com"},"directories":{},"maintainers":[{"name":"fixe","email":"tiago.ribeiro@gmail.com"},{"name":"ruimarinho","email":"ruipmarinho@gmail.com"},{"name":"botatuphold","email":"bot@uphold.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request-logger_3.0.0_1712574502893_0.4714597179669493"},"_hasShrinkwrap":false}},"readme":"# request-logger\n\nA wrapper for the [request](https://github.com/cypress-io/request) module that logs all request events.\n\n## Status\n\n[![npm version][npm-image]][npm-url] [![build status][travis-image]][travis-url]\n\n## Installation\n\nInstall the package via **yarn**:\n\n```shell\n❯ yarn add '@uphold/request-logger'\n```\n\nOr via **npm**:\n\n```shell\n❯ npm install '@uphold/request-logger' --save\n```\n\n## Usage\n\nWrap the `request` module using `@uphold/request-logger`. By default, all events will be logged to `stdout`.\n\n```javascript\nconst logger = require('@uphold/request-logger');\nconst request = logger(require('@cypress/request'));\n\nrequest.get('https://www.github.com');\n\n// { headers: …,\n//   id: '6bfc21a0-0dad-48b2-8378-762e5f85f014',\n//   method: 'GET',\n//   type: 'request',\n//   uri: 'https://www.github.com/' }\n// { headers: …,\n//   id: '6bfc21a0-0dad-48b2-8378-762e5f85f014',\n//   statusCode: 301,\n//   type: 'redirect',\n//   uri: 'https://github.com/' }\n// { headers: …,\n//   id: '6bfc21a0-0dad-48b2-8378-762e5f85f014',\n//   method: 'GET',\n//   type: 'request',\n//   uri: 'https://github.com/' }\n// { headers: …,\n//   id: '6bfc21a0-0dad-48b2-8378-762e5f85f014',\n//   statusCode: 200,\n//   type: 'response',\n//   uri: 'https://github.com/' }\n```\n\nYou can optionally define a custom logging function which receives the request object (`data`) and the `request` instance:\n\n```javascript\nconst logger = require('@uphold/request-logger');\nconst request = logger(require('@cypress/request'), data => console.log(`${data.id} ${data.type}: ${data.uri}${data.statusCode ? ` (${data.statusCode})` : ''} ${(data.body ? `${data.body}` : '').length} bytes`));\n\nrequest.get('https://www.github.com', () => {});\n\n// 8a3600f9-0995-4a89-951f-caf7c0a79a69 request: https://www.github.com/ 0 bytes\n// 8a3600f9-0995-4a89-951f-caf7c0a79a69 redirect: https://github.com/ (301) 0 bytes\n// 8a3600f9-0995-4a89-951f-caf7c0a79a69 request: https://github.com/ 0 bytes\n// 8a3600f9-0995-4a89-951f-caf7c0a79a69 response: https://github.com/ (200) 25562 bytes\n```\n\nEach `data` object contains a `type` property indicating the type of event:\n\n- **error** - the request has failed due to an error (e.g. a timeout). `data.error` is defined.\n\n- **request** - the request succeeded. `data.body` may be defined for POST requests.\n\n- **response** - the request returned a response. Note that `request` only buffers the response body if a callback was given, so only in that case will `data.body` be defined.\n\n- **redirect** - the request received a redirect status code (_HTTP 3xx_). `data.uri` will point to the URI of the next request.\n\n- **complete** - the request has been completed. This event is only dispatched on POST requests.\n\nIn every event, a `data.id` parameter is defined to allow matching it to the request it originated from.\n\n## Compatibility\n\nThe recommended node.js version is `>= 6` as it ships with native [ES2015 Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) support. This module supports node.js `4` by means of a polyfill that is loaded under the hood. As usual, keep in mind that polyfills are not as performant as their native counterpart.\n\nThe minimum required `request` version is `2.27.0`, although `2.54.0` is a particularly troubled version which is best avoided.\n\n## Release process\n\nThe release of a version is automated via the [release](https://github.com/uphold/request-logger/.github/workflows/release.yaml) GitHub workflow.\nRun it by clicking the \"Run workflow\" button.\n\n## License\n\nMIT\n\n[npm-image]: https://img.shields.io/npm/v/@uphold/request-logger.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/@uphold/request-logger\n[travis-image]: https://img.shields.io/travis/uphold/request-logger.svg?style=flat-square\n[travis-url]: https://travis-ci.org/uphold/request-logger\n","maintainers":[{"name":"fixe","email":"tiago.ribeiro@gmail.com"},{"name":"ruimarinho","email":"ruipmarinho@gmail.com"},{"name":"botatuphold","email":"bot@uphold.com"}],"time":{"modified":"2024-04-08T11:08:23.287Z","created":"2017-01-09T14:34:55.541Z","1.0.0":"2017-01-09T14:34:55.541Z","1.1.0":"2017-01-10T19:58:04.428Z","1.2.0":"2017-01-12T11:31:33.397Z","2.0.0":"2017-03-31T18:58:17.807Z","3.0.0":"2024-04-08T11:08:23.066Z"},"homepage":"https://github.com/uphold/request-logger","keywords":["http","https","logger","request"],"repository":{"type":"git","url":"git+https://github.com/uphold/request-logger.git"},"author":{"name":"Pedro Branco","email":"branco@uphold.com","url":"https://github.com/pedrobranco"},"bugs":{"url":"https://github.com/uphold/request-logger/issues"},"license":"MIT","readmeFilename":"README.md"}