{"id":37462403,"url":"https://github.com/kitten/dns-message","last_synced_at":"2026-01-16T07:05:21.146Z","repository":{"id":332378046,"uuid":"1129977571","full_name":"kitten/dns-message","owner":"kitten","description":"A web-compatible encoder and decoder of DNS message packets (derivative of dns-packet)","archived":false,"fork":false,"pushed_at":"2026-01-13T15:36:28.000Z","size":103,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T18:18:38.227Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/dns-message","language":"TypeScript","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/kitten.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-07T21:20:00.000Z","updated_at":"2026-01-13T15:36:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kitten/dns-message","commit_stats":null,"previous_names":["kitten/dns-message"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/kitten/dns-message","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fdns-message","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fdns-message/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fdns-message/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fdns-message/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitten","download_url":"https://codeload.github.com/kitten/dns-message/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fdns-message/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"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":[],"created_at":"2026-01-16T07:05:20.440Z","updated_at":"2026-01-16T07:05:21.135Z","avatar_url":"https://github.com/kitten.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dns-message\n\n`dns-message` is a web-compatible encoder and decoder of DNS message packets (derivative of [dns-packet](https://github.com/mafintosh/dns-packet))\n\n## Implementation\n\nThe goal of `dns-message` is to be a derivative of [dns-packet](https://github.com/mafintosh/dns-packet) that uses typed arrays and `DataView`s to decode and encode DNS messages, removing the reliance on Node.js Buffer and being compatible with any JavaScript runtime that supports `DataView`s, while also having types baked-in.\n\n## API Reference\n\nFor a full list of reference types, consult this library's typings.\n\n### `interface Packet`\n\nA DNS message input or decoded message.\n\n- accepts `rtype: PacketRType` which is set using `PacketFlag` values\n- flags `PacketFlag` as a bitfield (includes `rtype` and `type`)\n\n### `interface Question`\n\nA DNS question input or decoded payload.\n\n- `qu` reflects the `class` field, which is a bit field usually set to `RecordClass`\n\n### `encode(input: Packet): Uint8Array`\n\n- Accepts a DNS packet of type `Packet`\n\nReturns an encoded `Uint8Array` of the encoded DNS message\n\n### `decode(bytes: ArrayBufferView | ArrayBufferLike): Packet`\n\n- Accepts binary data of a DNS message\n- May throw built-in `RangeError`s\n\nReturns a decoded DNS `Packet`\n\n### `encodingLength(input: Packet): number`\n\n- Accepts a DNS packet of type `Packet`\n\nReturns amount of bytes required for encoding\n\n### `streamEncode(input: Packet): Uint8Array`\n\n- Accepts a DNS packet of type `Packet`\n\nReturns an encoded `Uint8Array` of the encoded DNS message, prefixed with a UInt16-BE length for TCP encoding.\n\n### `streamDecode(bytes: ArrayBufferView | ArrayBufferLike): Packet`\n\n- Accepts binary data of a DNS message, prefixed with a UInt16-BE length\n- May throw built-in `RangeError`s\n\nReturns a decoded DNS `Packet`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitten%2Fdns-message","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitten%2Fdns-message","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitten%2Fdns-message/lists"}