{"id":15690271,"url":"https://github.com/doowb/request-info","last_synced_at":"2025-05-07T23:45:07.985Z","repository":{"id":48539504,"uuid":"66892740","full_name":"doowb/request-info","owner":"doowb","description":"Get information about an http request.","archived":false,"fork":false,"pushed_at":"2021-07-21T00:41:05.000Z","size":18,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-07T23:45:02.994Z","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/doowb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["doowb"]}},"created_at":"2016-08-30T00:53:04.000Z","updated_at":"2023-07-20T08:54:22.000Z","dependencies_parsed_at":"2022-08-30T08:41:15.873Z","dependency_job_id":null,"html_url":"https://github.com/doowb/request-info","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Frequest-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Frequest-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Frequest-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Frequest-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doowb","download_url":"https://codeload.github.com/doowb/request-info/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973616,"owners_count":21834105,"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-10-03T18:08:27.358Z","updated_at":"2025-05-07T23:45:07.960Z","avatar_url":"https://github.com/doowb.png","language":"JavaScript","funding_links":["https://github.com/sponsors/doowb"],"categories":[],"sub_categories":[],"readme":"# request-info [![NPM version](https://img.shields.io/npm/v/request-info.svg?style=flat)](https://www.npmjs.com/package/request-info) [![NPM monthly downloads](https://img.shields.io/npm/dm/request-info.svg?style=flat)](https://npmjs.org/package/request-info) [![NPM total downloads](https://img.shields.io/npm/dt/request-info.svg?style=flat)](https://npmjs.org/package/request-info)\n\n\u003e Get information about an http request.\n\nPlease consider following this project's author, [Brian Woodward](https://github.com/doowb), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/) (requires [Node.js](https://nodejs.org/en/) \u003e=0.10.0):\n\n```sh\n$ npm install --save request-info\n```\n\n## Usage\n\n```js\nconst info = require('request-info');\nconst express = require('express');\nconst app = express();\n\napp.get('/', (req, res) =\u003e {\n  console.log(info(req)); // see below for details\n});\n```\n\n## API\n\n**Params**\n\n* `req` **{Object}**: http request object (from http or express)\n* `returns` **{Object}**: info object containing `httpVersion`, `ip`, `method`, `referer`, `url`, and `ua` (useragent information)\n\n**Example**\n\n```js\nconst express = require('express');\nconst app = express();\n\napp.get('/', (req, res) =\u003e {\n  console.log(info(req));\n  // {\n  //   httpVersion: '1.1',\n  //   ip: '127.0.0.1',\n  //   method: 'GET',\n  //   referer: 'http://localhost:8080/index.html',\n  //   url: '/',\n  //   ua: {\n  //     ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',\n  //     browser: { name: 'Chrome', version: '52.0.2743.116', major: '52' },\n  //     engine: { version: '537.36', name: 'WebKit' },\n  //     os: { name: 'Mac OS', version: '10.9.5' },\n  //     device: { model: undefined, vendor: undefined, type: undefined },\n  //     cpu: { architecture: undefined }\n  //   }\n  // }\n});\n```\n\n## Acknowledgments\n\nSome of the code has been adapted from https://github.com/joola/joola.io.express/blob/master/index.js#L39-L50\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [generate-webtask](https://www.npmjs.com/package/generate-webtask): Generate a starting point for a webtask.io service. | [homepage](https://github.com/generate/generate-webtask \"Generate a starting point for a webtask.io service.\")\n* [gh-clone](https://www.npmjs.com/package/gh-clone): git clone a repo with only username/repo, or if it's an NPM package you can… [more](https://github.com/jonschlinkert/gh-clone) | [homepage](https://github.com/jonschlinkert/gh-clone \"git clone a repo with only username/repo, or if it's an NPM package you can use just the name of the project.\")\n* [gulp-bundle-webtask](https://www.npmjs.com/package/gulp-bundle-webtask): Gulp plugin for browserifying and bundling your source code before deploying to webtask.io. | [homepage](https://github.com/doowb/gulp-bundle-webtask \"Gulp plugin for browserifying and bundling your source code before deploying to webtask.io.\")\n\n### Author\n\n**Brian Woodward**\n\n* [GitHub Profile](https://github.com/doowb)\n* [Twitter Profile](https://twitter.com/doowb)\n* [LinkedIn Profile](https://linkedin.com/in/woodwardbrian)\n\n### License\n\nCopyright © 2021, [Brian Woodward](https://github.com/doowb).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 20, 2021._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Frequest-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoowb%2Frequest-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Frequest-info/lists"}