{"_id":"@aaxis/express-request-id","_rev":"1-1f95521281b975e208632ecc11b34cd0","name":"@aaxis/express-request-id","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aaxis/express-request-id","version":"1.0.0","description":"Generate UUID for request and add it to headers","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git+https://github.com/DerekHuShuang/express-request-id.git"},"keywords":["express","middleware","request","id","uuid","aaxis"],"author":{"name":"derek"},"license":"MIT","bugs":{"url":"https://github.com/DerekHuShuang/express-request-id/issues"},"homepage":"https://github.com/DerekHuShuang/express-request-id","devDependencies":{"express":"~4.16.3","mocha":"~5.2.0","should":"~13.2.3","supertest":"~3.3.0"},"dependencies":{"uuid":"^3.3.2"},"gitHead":"0fe3535ffe3568d462be37d674f9fb2f549a5518","_id":"@aaxis/express-request-id@1.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.13.7","dist":{"integrity":"sha512-nJUJUqP22hze1LkzR1B4vPLdDEQLqRzjs4Im15JYzbYpzUmld8KKwIYGwId/RZm4Pz/NjbeRImjan4UbYGSqyQ==","shasum":"ca9999971725e59b1328079ef49cd417e3e6ee44","tarball":"https://registry.npmjs.org/@aaxis/express-request-id/-/express-request-id-1.0.0.tgz","fileCount":17,"unpackedSize":13739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZa3tCRA9TVsSAnZWagAAag0P/3F4Q9gqhsBsfBa2p/5j\njuAUzzQI3vuKVS05apjaFqY9wkvo6N/E8IXBz4W9f8BYMFt+BqKRIxwg0SaY\n13aTxrBdkbQJeOFkP1f44JzOupH0+kZjvOpTcPan66zZrl5Z8SUNnuaH0y96\ngsj5NFPvmM/egzYAYTiCg3DySr1oIS9X/5VJpW8IYHTu7jITVsvilVJ5kWyB\n6ps4P8TpkxGqKn8kuMJIHJRTnXDeB7vfxSUzMRnWtWRbbJjZuM3G5sw4hLem\ndQDDm0Ay43iBDXadP85flhpSgu+EX7ullwY3ml5S1Yh7pLz/jec4UYh90GtS\nC7iQndo39jekEOO++yweu4aGqDurkE1RjJbZmfbdEpcYVLsd9q6KY5fqcfrq\nN3OC47dtTI1A2r1aEsXaQuXrJ6WTnCIM3s5vVgz20HfcfDU9uaFI2Ca6Ny2G\njZPQmBJD2Q4VFhMtkzWJBEzq2XW/SzAZBZas91wdtmYIMaM/1gX+u7hVbw8F\nPUlQlgjpF2uHnotzfNRfMB9FbXmHfVuKuQ7b6T0zkG6O4spjq4d0Y/YDdCHt\nMKhOXo0sPiFYQjg2EDgAUdwFiVNDfS1mDjKHC/0qfp/HZL0HhSPY+qdAKj4d\nhqSGu/iXr+kgxf9j8oEXo9ydmMbtExTLd9sdHPJAOHfF4CInsogVz2jQ/iNL\nz4Vf\r\n=P+/p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7xp7TizEETZRz2rpkPHuVR16K+AZ9Vk8NmFfiAElBgQIgQqM1+O/Sr3LqoT8SP6gOHjp44U46gV8sGvU1OzrL4/0="}]},"maintainers":[{"name":"aaxis","email":"zacharyhou@aaxiscommerce.com"}],"_npmUser":{"name":"aaxis","email":"zacharyhou@aaxiscommerce.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/express-request-id_1.0.0_1583721964959_0.6919274162275557"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-09T02:46:04.716Z","1.0.0":"2020-03-09T02:46:05.098Z","modified":"2022-04-04T10:56:27.153Z"},"maintainers":[{"name":"aaxis","email":"zacharyhou@aaxiscommerce.com"}],"description":"Generate UUID for request and add it to headers","homepage":"https://github.com/DerekHuShuang/express-request-id","keywords":["express","middleware","request","id","uuid","aaxis"],"repository":{"type":"git","url":"git+https://github.com/DerekHuShuang/express-request-id.git"},"author":{"name":"derek"},"bugs":{"url":"https://github.com/DerekHuShuang/express-request-id/issues"},"license":"MIT","readme":"# express-request-id [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]\n\nGenerate UUID for request and add it to `X-Request-Id` header. In case request contains `X-Request-Id` header, uses its value instead.\n\n```js\n\nvar app = require('express')();\nvar addRequestId = require('express-request-id')();\n\napp.use(addRequestId);\n\napp.get('/', function (req, res, next) {\n    res.send(req.id);\n    next();\n});\n\napp.listen(3000, function() {\n    console.log('Listening on port %d', server.address().port);\n});\n\n// curl localhost:3000\n// d7c32387-3feb-452b-8df1-2d8338b3ea22\n```\n\n# API\n\n### express-request-id([options])\n\nReturns middleware function, that appends request id to req object.\n\n#### options\n\n * `uuidVersion` - version of uuid to use (defaults to `v4`). Can be one of methods from [node-uuid](https://github.com/broofa/node-uuid).\n * `setHeader` - boolean, indicates that header should be added to response (defaults to `true`).\n * `setReqHeader` - boolean, indicates that header should be added to request (defaults to `true`).\n * `headerName` - string, indicates the header name to use (defaults to `X-Request-Id`).\n * `attributeName` - string, indicates the attribute name used for the identifier on the request object (defaults to `id`)\n\nThis options fields are passed to node-uuid functions directly:\n\n * Whole `options` object, that can contain fields like: `node`, `clockseq`, `msecs`, `nsecs`.\n * `options.buffer` and `options.offset` to uuid function as second and third parameters.\n\n# License\n\nMIT (c) 2020 Derek Hu (derekhu@aaxiscommerce.com)\n\n[npm-url]: https://npmjs.org/package/express-request-id\n[npm-image]: http://img.shields.io/npm/v/express-request-id.svg\n\n[travis-url]: https://travis-ci.org/floatdrop/express-request-id\n[travis-image]: http://img.shields.io/travis/floatdrop/express-request-id.svg\n","readmeFilename":"readme.md"}