{"id":13725873,"url":"https://github.com/ahmadnassri/node-har","last_synced_at":"2026-03-11T19:31:24.318Z","repository":{"id":12846076,"uuid":"15521851","full_name":"ahmadnassri/node-har","owner":"ahmadnassri","description":"HTTP Archive (HAR) Dynamic Object","archived":false,"fork":false,"pushed_at":"2023-10-13T14:59:35.000Z","size":64,"stargazers_count":55,"open_issues_count":8,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-02-18T19:15:58.806Z","etag":null,"topics":["javascript","lib","node"],"latest_commit_sha":null,"homepage":"https://www.npmjs.org/package/har","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/ahmadnassri.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}},"created_at":"2013-12-30T06:20:45.000Z","updated_at":"2025-08-27T12:05:27.000Z","dependencies_parsed_at":"2024-02-04T16:19:40.794Z","dependency_job_id":"45864e3f-744b-4ab4-ad48-3c73ec6e0a4e","html_url":"https://github.com/ahmadnassri/node-har","commit_stats":null,"previous_names":["ahmadnassri/har","codeinchaos/httparchive.js"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ahmadnassri/node-har","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadnassri%2Fnode-har","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadnassri%2Fnode-har/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadnassri%2Fnode-har/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadnassri%2Fnode-har/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmadnassri","download_url":"https://codeload.github.com/ahmadnassri/node-har/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadnassri%2Fnode-har/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30395594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T18:46:22.935Z","status":"ssl_error","status_checked_at":"2026-03-11T18:46:17.045Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["javascript","lib","node"],"created_at":"2024-08-03T01:02:38.363Z","updated_at":"2026-03-11T19:31:24.300Z","avatar_url":"https://github.com/ahmadnassri.png","language":"JavaScript","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=UJ2B2BTK9VLRS\u0026on0=project\u0026os0=har"],"categories":["JavaScript"],"sub_categories":[],"readme":"# HAR [![version][npm-version]][npm-url] [![License][npm-license]][license-url]\n\nHTTP Archive (HAR) Dynamic Object, auto generates values \u0026 utility methods for easy manipulation and lookup\n\n[![Build Status][travis-image]][travis-url]\n[![Downloads][npm-downloads]][npm-url]\n[![Code Climate][codeclimate-quality]][codeclimate-url]\n[![Coverage Status][codeclimate-coverage]][codeclimate-url]\n[![Dependencies][david-image]][david-url]\n\n## Features\n\n- Import/export HAR objects\n- Accepts `Date` Objects for all date time fields, automatically converts to ISO format\n- Generates default values for common properties (Dates, IDs, etc...)\n- Automatically calculates `headersSize`\n\n## TODO\n\n- [ ] Automatically parse request `url` to create `queryString` objects and set `Host` header\n- [ ] Automatically update request url when `queryString` is modified\n\n## Install\n\n```sh\nnpm install --save har\n```\n\n## API\n\n```js\nvar HAR = require('har')\n```\n\n### HAR.Log(data)\n\n- **data**: `Object` *(a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object)*\n\n```js\nnew HAR.Log({\n  version: 1.2,\n  creator: creator,\n  browser: browser,\n  comment: 'foo',\n})\n```\n\n#### HAR.Log.addPage(page)\n\n- **page**: `Object` *(a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object)*\n\n```js\nvar page = new HAR.Page({\n  id: 'foo',\n  title: 'hello world',\n  startedDateTime: new Date()\n})\n\nnew HAR.Log().addPage(page)\n```\n\n#### HAR.Log.addEntry(entry)\n\n- **entry**: `Object` *(an [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object)*\n\n```js\nvar entry = new HAR.Entry({\n  startedDateTime: new Date(),\n  request: request,\n  response: response\n})\n\nnew HAR.Log().addEntry(entry)\n```\n\n----\n\n### HAR.CacheEntry(data)\n\n- **data**: `Object` *(a [\"beforeRequest\" or \"afterRequest\"](http://www.softwareishard.com/blog/har-12-spec/#cache) objects)*\n\n```js\nnew HAR.CacheEntry({\n  eTag: 'foo',\n  hitCount: 10,\n  expires: new Date(),\n  lastAccess: new Date(),\n  comment: 'foo'\n})\n```\n\n### HAR.Content(data)\n\n- **data**: `Object` *(a [content](http://www.softwareishard.com/blog/har-12-spec/#content) object)*\n\n```js\nnew Content({\n  compression: 20,\n  mimeType: 'multipart/form-content',\n  text: 'foo=bar',\n  encoding: 'base64',\n  comment: 'hello world'\n})\n```\n\n### HAR.Cookie(data)\n\n- **data**: `Object` *(a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object)*\n\n```js\nnew HAR.Cookie({\n  name: 'foo',\n  value: 'bar',\n  path: '/',\n  domain: 'www.ahmadnassri.com',\n  expires: date,\n  httpOnly: true,\n  secure: true,\n  comment: 'foo'\n})\n```\n\n### HAR.Creator(data)\n\n- **data**: `Object` *(a [creator](http://www.softwareishard.com/blog/har-12-spec/#creator) object)*\n\n```js\nnew HAR.Creator({\n  name: 'Node HAR',\n  version: '1.0'\n})\n```\n\n### HAR.Browser(data)\n\n- **data**: `Object` *(a [browser](http://www.softwareishard.com/blog/har-12-spec/#browser) object)*\n\n```js\nnew HAR.Browser({\n  name: 'My Browser',\n  version: '5.0'\n})\n```\n\n### HAR.Entry(data)\n\n- **data**: `Object` *(an [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object)*\n\n```js\nnew HAR.Entry({\n  startedDateTime: new Date(),\n  request: request,\n  response: response\n})\n```\n\n### HAR.Header(data)\n\n- **data**: `Object` *(a [header](http://www.softwareishard.com/blog/har-12-spec/#headers) object)*\n\n```js\nnew HAR.Header({\n  name: 'foo',\n  value 'bar',\n  comment: 'foo'\n})\n```\n\n### HAR.Page(data)\n\n- **data**: `Object` *(a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object)*\n\n```js\nnew HAR.Page({\n  id: 'foo',\n  title: 'hello world',\n  startedDateTime: new Date(),\n  pageTimings: {\n    onLoad: 0,\n    onContentLoad: 0\n  },\n  comment: 'foo'\n})\n```\n\n### HAR.Param(data)\n\n- **data**: `Object` *(a [postData Param](http://www.softwareishard.com/blog/har-12-spec/#postData) object)*\n\n```js\nnew HAR.Param({\n  comment: 'hello',\n  contentType: 'text/plain',\n  fileName: 'foo.bar',\n  name: 'foo',\n  value: 'bar'\n})\n```\n\n### HAR.PostData(data)\n\n- **data**: `Object` *(a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object)*\n\n```js\nnew HAR.PostData({\n  comment: 'hello world',\n  mimeType: 'multipart/form-data',\n  text: 'foo=bar'\n})\n```\n\n#### HAR.PostData.addParam(param)\n\n- **param**: `Object` *(a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object)*\n\n```js\nnew HAR.PostData().addParam(param)\n```\n\n### HAR.Query(data)\n\n- **data**: `Object` *(a [query](http://www.softwareishard.com/blog/har-12-spec/#queryString) object)*\n\n```js\nnew HAR.Header({\n  name: 'foo',\n  value 'bar',\n  comment: 'foo'\n})\n```\n\n### HAR.Request(data)\n\n- **data**: `Object` *(a [request](http://www.softwareishard.com/blog/har-12-spec/#request) object)*\n\n*Automatically Calculated Values:*\n- `headersSize`\n- `bodySize`\n\n```js\nvar request = new HAR.Request({\n  url: 'https://ahmadnassri.github.io/har-resources/',\n  headers: [\n    new Header('foo', 'bar')\n  ],\n  postData: new PostData({\n    mimeType: 'text/plain',\n    text: 'foo'\n  })\n})\n\n// request.headersSize === 44\n// request.bodySize === 3\n```\n\n#### HAR.Request.addCookie(cookie)\n\n- **cookie**: `Object` *(a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object)*\n\n```js\nnew HAR.Request().addCookie(cookie)\n```\n\n#### HAR.Request.addHeader(header)\n\n- **header**: `Object` *(a [header](http://www.softwareishard.com/blog/har-12-spec/#headers) object)*\n\n```js\nnew HAR.Request().addHeader(header)\n```\n\n#### HAR.Request.addQuery(query)\n\n- **query**: `Object` *(a [queryString](http://www.softwareishard.com/blog/har-12-spec/#queryString) object)*\n\n```js\nnew HAR.Request().addQuery(query)\n```\n\n### HAR.Response(data)\n\n- **data**: `Object` *(a [response](http://www.softwareishard.com/blog/har-12-spec/#response) object)*\n\n*Automatically Calculated Values:*\n- `headersSize`\n- `bodySize`\n- `content.size`\n\n```js\nvar response = new HAR.Response({\n  status: 200,\n  statusText: 'OK'\n  headers: [\n    new Header('foo', 'bar')\n  ],\n  content: new PostData({\n    text: 'foo'\n  })\n})\n\n// response.headersSize === 12\n// response.bodySize === 3\n// response.content.size === 3\n```\n\n#### HAR.Response.addCookie(cookie)\n\n- **cookie**: `Object` *(a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object)*\n\n```js\nnew HAR.Response().addCookie(cookie)\n```\n\n#### HAR.Response.addHeader(header)\n\n- **header**: `Object` *(a [header](http://www.softwareishard.com/blog/har-12-spec/#headers) object)*\n\n```js\nnew HAR.Response().addHeader(header)\n```\n\n## Support\n\nDonations are welcome to help support the continuous development of this project.\n\n[![Gratipay][gratipay-image]][gratipay-url]\n[![PayPal][paypal-image]][paypal-url]\n[![Flattr][flattr-image]][flattr-url]\n[![Bitcoin][bitcoin-image]][bitcoin-url]\n\n## License\n\n[MIT](LICENSE) \u0026copy; [Ahmad Nassri](https://www.ahmadnassri.com)\n\n[license-url]: https://github.com/ahmadnassri/har/blob/master/LICENSE\n\n[travis-url]: https://travis-ci.org/ahmadnassri/har\n[travis-image]: https://img.shields.io/travis/ahmadnassri/har.svg?style=flat-square\n\n[npm-url]: https://www.npmjs.com/package/har\n[npm-license]: https://img.shields.io/npm/l/har.svg?style=flat-square\n[npm-version]: https://img.shields.io/npm/v/har.svg?style=flat-square\n[npm-downloads]: https://img.shields.io/npm/dm/har.svg?style=flat-square\n\n[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har\n[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har.svg?style=flat-square\n[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har.svg?style=flat-square\n\n[david-url]: https://david-dm.org/ahmadnassri/har\n[david-image]: https://img.shields.io/david/ahmadnassri/har.svg?style=flat-square\n\n[gratipay-url]: https://www.gratipay.com/ahmadnassri/\n[gratipay-image]: https://img.shields.io/gratipay/ahmadnassri.svg?style=flat-square\n\n[paypal-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=UJ2B2BTK9VLRS\u0026on0=project\u0026os0=har\n[paypal-image]: http://img.shields.io/badge/paypal-donate-green.svg?style=flat-square\n\n[flattr-url]: https://flattr.com/submit/auto?user_id=ahmadnassri\u0026url=https://github.com/ahmadnassri/har\u0026title=har\u0026language=\u0026tags=github\u0026category=software\n[flattr-image]: http://img.shields.io/badge/flattr-donate-green.svg?style=flat-square\n\n[bitcoin-image]: http://img.shields.io/badge/bitcoin-1Nb46sZRVG3or7pNaDjthcGJpWhvoPpCxy-green.svg?style=flat-square\n[bitcoin-url]: https://www.coinbase.com/checkouts/ae383ae6bb931a2fa5ad11cec115191e?name=har\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmadnassri%2Fnode-har","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmadnassri%2Fnode-har","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmadnassri%2Fnode-har/lists"}