{"id":13657577,"url":"https://github.com/floatdrop/express-request-id","last_synced_at":"2025-04-04T19:10:44.898Z","repository":{"id":18257915,"uuid":"21414902","full_name":"floatdrop/express-request-id","owner":"floatdrop","description":"Middleware for setting unique request id","archived":false,"fork":false,"pushed_at":"2023-12-28T15:44:06.000Z","size":30,"stargazers_count":122,"open_issues_count":7,"forks_count":24,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T06:04:36.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/floatdrop.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-02T07:14:55.000Z","updated_at":"2025-03-19T11:26:14.000Z","dependencies_parsed_at":"2024-06-18T12:40:22.095Z","dependency_job_id":"d87fefdc-668d-4a94-948a-15ba4d4a9ba3","html_url":"https://github.com/floatdrop/express-request-id","commit_stats":{"total_commits":37,"total_committers":13,"mean_commits":"2.8461538461538463","dds":0.5945945945945945,"last_synced_commit":"ff8e6b74bd9a17e5488c2a63b87db8dbbc2fc1d4"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fexpress-request-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fexpress-request-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fexpress-request-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fexpress-request-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floatdrop","download_url":"https://codeload.github.com/floatdrop/express-request-id/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245510802,"owners_count":20627266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T05:00:45.569Z","updated_at":"2025-03-28T18:15:58.730Z","avatar_url":"https://github.com/floatdrop.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# express-request-id\n\n[![Tests](https://github.com/floatdrop/express-request-id/workflows/CI/badge.svg)](https://github.com/floatdrop/express-request-id/actions)\n[![npm version](https://img.shields.io/npm/v/express-request-id.svg)](https://npmjs.org/package/express-request-id 'View this project on NPM')\n[![npm downloads](https://img.shields.io/npm/dm/express-request-id)](https://www.npmjs.com/package/express-request-id)\n\n\u003e Generates UUID for request and add it to header.\n\n## Install\n\n```sh\nnpm install express-request-id\n```\n\n## Usage\n\n```js\nimport express from 'express';\nimport requestID from 'express-request-id';\n\napp.use(requestID());\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### requestID(options?)\n\n#### options\n\nType: `object`\n\n##### generator\n\nType: `function`\nDefault: `func(req) { return uuidv4(); }`\n\nDefines function, that generated ID from request. By default used `uuid` module, that generated UUID V4 for every request. \n\n##### headerName\n\nType: `string`\nDefault: `X-Request-Id`\n\nDefines name of header, that should be used for request ID checking and setting.\n\n##### setHeader\n\nType: `bool`\nDefault: `true`\n\nIf `false` – header will not be set.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fexpress-request-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloatdrop%2Fexpress-request-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fexpress-request-id/lists"}