{"id":16758433,"url":"https://github.com/kessler/level-http-recorder","last_synced_at":"2025-08-02T23:09:13.368Z","repository":{"id":14691763,"uuid":"17411608","full_name":"kessler/level-http-recorder","owner":"kessler","description":"A rudimentary middleware / handler that records http requests to a local level db","archived":false,"fork":false,"pushed_at":"2017-06-05T20:20:32.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T22:44:24.581Z","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":"RobotsAndPencils/buford","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kessler.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}},"created_at":"2014-03-04T18:06:56.000Z","updated_at":"2016-01-19T03:49:11.000Z","dependencies_parsed_at":"2022-09-23T22:21:36.959Z","dependency_job_id":null,"html_url":"https://github.com/kessler/level-http-recorder","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/kessler/level-http-recorder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Flevel-http-recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Flevel-http-recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Flevel-http-recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Flevel-http-recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kessler","download_url":"https://codeload.github.com/kessler/level-http-recorder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Flevel-http-recorder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268470799,"owners_count":24255391,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-13T04:05:17.460Z","updated_at":"2025-08-02T23:09:13.318Z","avatar_url":"https://github.com/kessler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# level-http-recorder [![Build Status](https://secure.travis-ci.org/kessler/level-http-recorder.png?branch=master)](http://travis-ci.org/kessler/level-http-recorder) [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nA rudimentary middleware / handler that records http requests to a local level db.\n\nCompatible with various web frameworks that use standard middleware interface ```function (req, res, next) {}```\n\nThis module expects the given db to support:\n- levelup interface \n- bytewise key encoding\n- json value encoding\n\n## normal use:\n```js\nvar stack = require('stack')\nvar db = require('level-bytewise')('./mydb')\nvar http = require('http')\n\nvar levelHttpRecorder = require('level-http-recorder')(db)\n\nhttp.createServer(stack(levelHttpRecorder))\n\n```\n\n### modify before a request is persisted\n```javascript\nvar stack = require('stack')\nvar db = require('level-bytewise')('./mydb')\nvar http = require('http')\n\nvar levelHttpRecorder = require('level-http-recorder')(db, function (requestData, request) {\n    // do stuff to request data\n    // DO NOT modify request!\n    requestData.myField = 'foo'\n})\n\nhttp.createServer(stack(levelHttpRecorder))\n```\n\n### schema\nEvery recorded request will have the following fields, represented here as the field name: the field name used to populate the value from the request object\n\n```javascript\n    var result = {\n        ip: request.ip, // if request had an ip property, this will be it\n        requestId: [12312312312233,2] // the leveldb key of the request,\n        method: request.method,\n        httpVersion: request.httpVersion,\n        headers: request.headers,\n        url: request.url,\n        trailers: request.trailers,\n        time: Date.utc(),\n        query: {}, // a parsed query string\n        body: ... // if there is a body to the request and config.writeBody === true || request.writeBody === true - this field will hold the entire body. It is advisable to employ limit restrictions\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Flevel-http-recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkessler%2Flevel-http-recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Flevel-http-recorder/lists"}