{"_id":"@akrdevtech/lib-express-request-id","_rev":"5-7de8ff579e64d58156191f37105b806f","name":"@akrdevtech/lib-express-request-id","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@akrdevtech/lib-express-request-id","version":"1.0.0","keywords":["express","middleware","request id","uuid","transaction id"],"author":{"name":"Akhil Krishnan R"},"license":"ISC","_id":"@akrdevtech/lib-express-request-id@1.0.0","maintainers":[{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"}],"homepage":"https://github.com/akrdevtech/lib-express-request-id#readme","bugs":{"url":"https://github.com/akrdevtech/lib-express-request-id/issues"},"dist":{"shasum":"538ab2ce164ed5a01705029c763d5dd6a1eb6ba7","tarball":"https://registry.npmjs.org/@akrdevtech/lib-express-request-id/-/lib-express-request-id-1.0.0.tgz","fileCount":8,"integrity":"sha512-WfWNDkIQac+kFKrWOAr3+2YBF6hiTxx7Sc0yqfojwwHkED3CrfMvPyQOKfF5T+3XgBocMFwT0wZwq3VWrzKdZg==","signatures":[{"sig":"MEUCIQDZWLIxAyuguRW6x3fTOzw/wZeVHwekfA0oj740PHiEAAIgUZkb/CftN5bqlDvoR/OLWQCUQSTeVqzCVElQVMSnxBY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje3ilACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmriHA/+IFph3k5QauZX5slIZZYlZLm9Rl9dtTCKMMGMI2ohJe4it7Dz\r\n1pfjrNUX0p3cNKwMkGnAPcrov1VyHvGQvmQpSeBuvsqi6+Ur/hADvItfSrsw\r\nDsMHwzrYKbtiBHOTzQBwlnK6xH2WpbPNOLYP+Qcw8W4+XzZ42hMfeaADqNV6\r\ng/DnZSE4Q1DL9iDbSOENKOWiUvrbiR/z0dVGEkSzxtAaD3MZM2NQuE1RPIM/\r\nI5HCfVFDPhuX0BqyqAKPmdp/6V/WEE3aX+2ggqXYeKHIGDCh0K+q10TGgiHz\r\nkK4hMtPLnrEptrur1/KRks2+XfnWslACqTXHwBi9tidoGFmY5cppU1ZOISut\r\n3oktyYCAIaQx4fEz7X5oO6LummS/Dz1lTPKennFbbskqn+VLSsqwRfofBvJq\r\nLGIXlpETyKFW/d9rOfCZO2TIptK9zVoOF88I0Hn2hdGu6gY9RgAcYGeg3zLP\r\nmODs0/CuQkN8fmNZyklnBCx6i53drGCqKBLcnEIKrshSmbswfciiDk+yFG+x\r\n/kLXEynn1FAxzMXuN5tb6OsfOepFK857/cehT/85GmIMWb/LRF9IVUnjZDrO\r\nEsi9Inev+zxw+72wPmkxh2XoNxgSMYdCmnIvy5RcK+JaXExOh88b7nOLCkyT\r\ncBgO13glIr6T722/PSog9FTcxsfr23uVwAo=\r\n=uOeL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"./dist\\index.d.ts","gitHead":"ccf10b11429ee4b75e83bdfeca51879ccda1b7b2","scripts":{"tsc":"tsc","lint":"eslint . --ext .ts","test":"echo \"Error: no test specified\" && exit 1","build":"tsc --build tsconfig.json","lint:fix":"eslint . --fix --ext .ts","prebuild":"npm run lint:fix"},"_npmUser":{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"},"repository":{"url":"git+https://github.com/akrdevtech/lib-express-request-id.git","type":"git"},"_npmVersion":"8.3.1","description":"Request/ Transaction id generator for Express Js","directories":{},"_nodeVersion":"16.14.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","eslint":"^8.27.0","express":"^4.18.2","ts-jest":"^29.0.3","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/express":"^4.17.14","@typescript-eslint/parser":"^5.42.1","@typescript-eslint/eslint-plugin":"^5.42.1"},"_npmOperationalInternal":{"tmp":"tmp/lib-express-request-id_1.0.0_1669036197601_0.0547049299251241","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@akrdevtech/lib-express-request-id","version":"1.0.1","keywords":["express","middleware","request id","uuid","transaction id"],"author":{"name":"Akhil Krishnan R"},"license":"ISC","_id":"@akrdevtech/lib-express-request-id@1.0.1","maintainers":[{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"}],"homepage":"https://github.com/akrdevtech/lib-express-request-id#readme","bugs":{"url":"https://github.com/akrdevtech/lib-express-request-id/issues"},"dist":{"shasum":"7d3b6ac6736fb89e41d3b4cea6f1422c286e4770","tarball":"https://registry.npmjs.org/@akrdevtech/lib-express-request-id/-/lib-express-request-id-1.0.1.tgz","fileCount":8,"integrity":"sha512-ujdNAWn+wG4HFh8PV4/93BJwmHiPhe38fOkAvGc7e6/sLCUTEYUroibcH74mkgYkFJPNW3PUUTAFKY5C2tHPSQ==","signatures":[{"sig":"MEQCIAUzipn3eR5rQab4LBXzLIRgftvAbg2nf/63JqoMhtqIAiBz4ndaSvhMjqKrgEVYFeCSbrUuFGRpD9WT4vfGshCNYg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7125},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"3e6a058e2c013fa0ebd88e0e447e0f50be6c46a3","scripts":{"tsc":"tsc","lint":"eslint . --ext .ts","test":"echo \"Error: no test specified\" && exit 1","build":"tsc --build tsconfig.json","lint:fix":"eslint . --fix --ext .ts","prebuild":"npm run lint:fix"},"_npmUser":{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"},"repository":{"url":"git+https://github.com/akrdevtech/lib-express-request-id.git","type":"git"},"_npmVersion":"8.19.4","description":"Request/ Transaction id generator for Express Js","directories":{},"_nodeVersion":"16.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","eslint":"^8.27.0","express":"^4.18.2","ts-jest":"^29.0.3","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/express":"^4.17.14","@typescript-eslint/parser":"^5.42.1","@typescript-eslint/eslint-plugin":"^5.42.1"},"_npmOperationalInternal":{"tmp":"tmp/lib-express-request-id_1.0.1_1756917729708_0.2753943860255017","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@akrdevtech/lib-express-request-id","version":"1.0.2","keywords":["express","middleware","request id","uuid","transaction id"],"author":{"name":"Akhil Krishnan R"},"license":"ISC","_id":"@akrdevtech/lib-express-request-id@1.0.2","maintainers":[{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"}],"homepage":"https://github.com/akrdevtech/lib-express-request-id#readme","bugs":{"url":"https://github.com/akrdevtech/lib-express-request-id/issues"},"dist":{"shasum":"f63caad6592f70352afffe15b91df413fbeb590a","tarball":"https://registry.npmjs.org/@akrdevtech/lib-express-request-id/-/lib-express-request-id-1.0.2.tgz","fileCount":9,"integrity":"sha512-ULtKs6rY4YdS3e5dtK3Fwy85e9nmDHMizMNaoZLMCOZULoGAfufsFlj0CSjaq1Sn1ofSNUlOQIYrabrUckFuNA==","signatures":[{"sig":"MEUCIQD9A1tZxjG9zPYXnAEhEq1PV+x02p7ThcwUznPAQ+5BvgIgM0ll4q7GvdglC0wcTcbk09eGKmT/vaE8ZI0zXAzN1SE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7294},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"36760bab959d199b35c781852cf8981aeac372b7","scripts":{"tsc":"tsc","lint":"eslint . --ext .ts","test":"echo \"Error: no test specified\" && exit 1","build":"tsc --build tsconfig.json","lint:fix":"eslint . --fix --ext .ts","prebuild":"npm run lint:fix"},"_npmUser":{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"},"repository":{"url":"git+https://github.com/akrdevtech/lib-express-request-id.git","type":"git"},"_npmVersion":"9.8.1","description":"Request/ Transaction id generator for Express Js","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^30.1.3","eslint":"^9.34.0","express":"^5.1.0","ts-jest":"^29.4.1","prettier":"^3.6.2","typescript":"^5.9.2","@types/jest":"^30.0.0","@types/express":"^5.0.3","@typescript-eslint/parser":"^8.42.0","@typescript-eslint/eslint-plugin":"^8.42.0"},"_npmOperationalInternal":{"tmp":"tmp/lib-express-request-id_1.0.2_1756921212158_0.23367060897802006","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@akrdevtech/lib-express-request-id","version":"1.0.3","keywords":["express","middleware","request id","uuid","transaction id"],"author":{"name":"Akhil Krishnan R"},"license":"ISC","_id":"@akrdevtech/lib-express-request-id@1.0.3","maintainers":[{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"}],"homepage":"https://github.com/akrdevtech/lib-express-request-id#readme","bugs":{"url":"https://github.com/akrdevtech/lib-express-request-id/issues"},"dist":{"shasum":"a516e559ccd64845bdfed9068beb623e56ef130a","tarball":"https://registry.npmjs.org/@akrdevtech/lib-express-request-id/-/lib-express-request-id-1.0.3.tgz","fileCount":16,"integrity":"sha512-AFR1rFskLg3NP05Q8IWJiuOtXZ9cNtUQrsv0EnOW2uyvANkT1BBUihLEF/7BnO1XTMJLmyUY9418VyCs1eSf7Q==","signatures":[{"sig":"MEYCIQD7ifbjf14nXxj4myzPmY4OUJdfPsqBtnY3OPf6nXq9mgIhAN3zofqKUCfZnEGkTMExgNHfRC9YEjQ3Uc23Y72+PfxL","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10243},"main":"dist/cjs/index.js","types":"dist/cjs/index.d.ts","module":"dist/esm/index.js","exports":{".":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"gitHead":"fdc40134ad1b69fa423d6071fd9b7d4a4a98bb6f","scripts":{"lint":"eslint . --ext .ts","test":"echo \"Error: no test specified\" && exit 1","build":"npm run build:cjs && npm run build:esm","publish":"npm publish","lint:fix":"eslint . --fix --ext .ts","build:cjs":"tsc --build tsconfig.json","build:esm":"tsc --build tsconfig.esm.json","publish:up":"npm run version:up && npm run publish","version:up":"npm version patch && npm install && npm run build"},"_npmUser":{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"},"repository":{"url":"git+https://github.com/akrdevtech/lib-express-request-id.git","type":"git"},"_npmVersion":"9.8.1","description":"Request/ Transaction id generator for Express Js","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^30.1.3","eslint":"^9.34.0","express":"^5.1.0","ts-jest":"^29.4.1","prettier":"^3.6.2","typescript":"^5.9.2","@types/jest":"^30.0.0","@types/express":"^5.0.3","@typescript-eslint/parser":"^8.42.0","@typescript-eslint/eslint-plugin":"^8.42.0"},"_npmOperationalInternal":{"tmp":"tmp/lib-express-request-id_1.0.3_1756924740017_0.2512544669185006","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@akrdevtech/lib-express-request-id","version":"1.0.4","description":"Request/ Transaction id generator for Express Js","main":"dist/cjs/index.js","module":"dist/esm/index.js","types":"dist/cjs/index.d.ts","exports":{".":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.js"}},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build:cjs":"tsc --build tsconfig.json","build:esm":"tsc --build tsconfig.esm.json","build":"npm run build:cjs && npm run build:esm","lint":"eslint . --ext .ts","lint:fix":"eslint . --fix --ext .ts","version:up":"npm version patch && npm install && npm run build","publish":"npm publish","publish:up":"npm run version:up && npm run publish"},"repository":{"type":"git","url":"git+https://github.com/akrdevtech/lib-express-request-id.git"},"keywords":["express","middleware","request id","uuid","transaction id"],"author":{"name":"Akhil Krishnan R"},"license":"ISC","bugs":{"url":"https://github.com/akrdevtech/lib-express-request-id/issues"},"homepage":"https://github.com/akrdevtech/lib-express-request-id#readme","devDependencies":{"@types/express":"^5.0.3","@types/jest":"^30.0.0","@typescript-eslint/eslint-plugin":"^8.42.0","@typescript-eslint/parser":"^8.42.0","eslint":"^9.34.0","express":"^5.1.0","jest":"^30.1.3","prettier":"^3.6.2","ts-jest":"^29.4.1","typescript":"^5.9.2"},"_id":"@akrdevtech/lib-express-request-id@1.0.4","gitHead":"bd7b045dca95c8ef619a3e7523e78a47e8fc4c16","_nodeVersion":"22.17.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-7Ir4oKJdYhWlEBCoVNZ5OWGpavgJ05OxP02Y9eEK1As68jro8glHWvakMa1YrkcoyKoyBntWV3BOBYBVcbOHEQ==","shasum":"6f2aaed62d25a1ca89c7c1a569e8e74212ba1960","tarball":"https://registry.npmjs.org/@akrdevtech/lib-express-request-id/-/lib-express-request-id-1.0.4.tgz","fileCount":16,"unpackedSize":10243,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGi5fZW9u2wPyEUeyhaRiWuJIRNpvu9F6JBpgFDZDfBEAiEA74fB3q2x/QEmldTCDitFhuPMN7lefllIWdBzzPO63DQ="}]},"_npmUser":{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"},"directories":{},"maintainers":[{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lib-express-request-id_1.0.4_1756924842258_0.16847060548053494"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-21T13:09:57.538Z","modified":"2025-09-03T18:40:42.639Z","1.0.0":"2022-11-21T13:09:57.737Z","1.0.1":"2025-09-03T16:42:09.903Z","1.0.2":"2025-09-03T17:40:12.360Z","1.0.3":"2025-09-03T18:39:00.190Z","1.0.4":"2025-09-03T18:40:42.436Z"},"bugs":{"url":"https://github.com/akrdevtech/lib-express-request-id/issues"},"author":{"name":"Akhil Krishnan R"},"license":"ISC","homepage":"https://github.com/akrdevtech/lib-express-request-id#readme","keywords":["express","middleware","request id","uuid","transaction id"],"repository":{"type":"git","url":"git+https://github.com/akrdevtech/lib-express-request-id.git"},"description":"Request/ Transaction id generator for Express Js","maintainers":[{"name":"akrdevtech","email":"akhilkrishnan.freelancer@gmail.com"}],"readme":"\n# Express Request/Transaction Id Middleware\n## Description\nAppend transaction id to every request to the express server application. We can specify the existing id header or populate a new transaction id. \n-   TypeScript support.\n-   Populate id from existing header or generate a random uuid\n-   Setup a custom response header to pipe the transaction id to the requester\n-   Pass in any custom logic to generate a transaction id of your own\n\n## Quick Links\n\n-   [Example Usage](https://www.npmjs.com/package/@akrdevtech/lib-express-request-id#Example-Usage)\n-   [Custom Id Generator Usage Example](https://www.npmjs.com/package/@akrdevtech/lib-express-request-id#Custom-Id-Generator-Usage-Example)\n-   [API](https://www.npmjs.com/package/@akrdevtech/lib-express-request-id#API)\n## Usage\n### Install\n```sh\nnpm i @akrdevtech/lib-express-request-id\n```\n### [](https://www.npmjs.com/package/@akrdevtech/lib-express-request-id#Example-Usage) Example Usage\n\n```js script\nimport * as express from 'express'\nimport { expressRequestId } from  '@akrdevtech/lib-express-request-id';\n\nconst app = express();\n\napp.use(expressRequestId());\n\napp.get('/', [\n  (req, res) => { \n    res.send(`Hello World! ${req.txId}`) // Hello World! 44bd3872-f16c-46fc-a775-97d83c796432\n  } \n]);\n\nconst port = 8000;\napp.listen(port, () => {console.log(`⚡️ Service started : PORT → ${port}}`);\n```\n\n### [](https://www.npmjs.com/package/@akrdevtech/lib-express-request-id#Custom-Id-Generator-Usage-Example) Custom Id Generator Usage Example\n\n```js script\nimport * as express from 'express'\nimport { expressRequestId } from  '@akrdevtech/lib-express-request-id';\n\nconst app = express()\n\nconst customIdGen = (req: express.Request): string => {\n\tconst id:string = // your random id generator logic here\n\treturn id\n}\n\napp.use(expressRequestId({ customIdGenerator: customIdGen ));\n\napp.get('/', [\n  (req, res) => { \n    res.send(`Hello World! ${req.txId}`)\n  } \n]);\n\nconst port = 8000;\napp.listen(port, () => {console.log(`⚡️ Service started : PORT → ${port}}`);\n```\n\n##  [](https://www.npmjs.com/package/@akrdevtech/lib-express-request-id#API)API\n\n### expressRequestId(options?)\nOptions contains the following attributes\n- **`requestHeaderName`** - Defines name of header, that should be used for checking and setting request ID.\n\t- Type: `string`\n\t- Default: `\"x-transaction-id\"`\n- **`responseHeaderName`** - Defines name of header, that should be used for setting the id in reponse.\n\t- Type: `string`\n\t- Default: `\"x-transaction-id\"`\n- **`setResponseHeader`** - Specifies whether the transaction id is to be set in the response header\n\t- Type: `boolean`\n\t- Default: `true`\n- **`attributeName`** - Specifies the attribute name through which we can access the id from request object\n\t- Type: `string`\n\t- Default: `'txId'`\n-  **`customIdGenerator`** - Defines a custom method that takes in optional attribute as request object and returns an id string\n\t- Type: `Function`\n\t- Interface: `(request?: Express.Request)=>string`\n\t- Default: `(request?: Express.Request)=>string(UUID v4)`","readmeFilename":"README.md"}