{"id":15390249,"url":"https://github.com/gajus/http-header","last_synced_at":"2025-04-15T21:26:55.582Z","repository":{"id":57268180,"uuid":"168581929","full_name":"gajus/http-header","owner":"gajus","description":"Utilities for working with HTTP headers.","archived":false,"fork":false,"pushed_at":"2019-01-31T20:13:38.000Z","size":12,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T01:34:21.875Z","etag":null,"topics":["header","http","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gajus.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":"2019-01-31T19:17:53.000Z","updated_at":"2023-10-09T09:04:09.000Z","dependencies_parsed_at":"2022-09-02T02:50:16.507Z","dependency_job_id":null,"html_url":"https://github.com/gajus/http-header","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fhttp-header","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fhttp-header/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fhttp-header/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fhttp-header/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gajus","download_url":"https://codeload.github.com/gajus/http-header/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249031822,"owners_count":21201358,"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":["header","http","nodejs"],"created_at":"2024-10-01T15:05:05.337Z","updated_at":"2025-04-15T21:26:55.556Z","avatar_url":"https://github.com/gajus.png","language":"JavaScript","readme":"# http-header\n\n[![Travis build status](http://img.shields.io/travis/gajus/http-header/master.svg?style=flat-square)](https://travis-ci.org/gajus/http-header)\n[![Coveralls](https://img.shields.io/coveralls/gajus/http-header.svg?style=flat-square)](https://coveralls.io/github/gajus/http-header)\n[![NPM version](http://img.shields.io/npm/v/http-header.svg?style=flat-square)](https://www.npmjs.org/package/http-header)\n[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)\n[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social\u0026label=Follow)](https://twitter.com/kuizinas)\n\nUtilities for working with HTTP headers.\n\n## API\n\n```js\nimport {\n  deleteHeader,\n  getHeader,\n  getHeaderName,\n  hasHeader,\n  HeaderNotFoundError,\n  InvalidHeaderNameError,\n  InvalidHeaderValueError,\n  setHeader,\n  setHeaderName\n} from 'http-header';\nimport type {\n  HeaderNameType,\n  HeadersType,\n  HeaderValueType\n} from 'http-header';\n\ndeleteHeader(headers: HeadersType, name: HeaderNameType) =\u003e HeadersType;\ngetHeader(headers: HeadersType, name: HeaderNameType) =\u003e HeaderValueType;\ngetHeaderName(headers: HeadersType, name: HeaderNameType) =\u003e HeaderNameType;\nhasHeader(headers: HeadersType, name: HeaderNameType) =\u003e boolean;\nsetHeader(headers: HeadersType, name: HeaderNameType, value: HeaderValueType) =\u003e HeadersType;\nsetHeaderName(headers: HeadersType, oldName: HeaderNameType, newName: HeaderNameType) =\u003e HeadersType;\n\n```\n\n### Behaviour\n\n#### `HeaderNotFoundError` error\n\n`getHeader` and `getHeaderName` throw `HeaderNotFoundError` if the specified header cannot be found.\n\nUse `hasHeader` to check if the header exists before using `getHeader` or `getHeaderName`, e.g.\n\n```js\nimport {\n  hasHeader,\n  getHeader\n} from 'http-header';\n\nif (hasHeader('Content-Type')) {\n  getHeader('Content-Type');\n}\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Fhttp-header","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgajus%2Fhttp-header","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Fhttp-header/lists"}