{"name":"hyperdht-address","version":"1.1.1","description":"hyperdht-address","main":"index.js","exports":{"./package":"./package.json",".":{"types":"./index.d.ts","default":"./index.js"}},"devDependencies":{"b4a":"^1.8.0","brittle":"^3.19.0","lunte":"^1.2.0","prettier":"^3.6.2","prettier-config-holepunch":"^2.0.0"},"scripts":{"format":"prettier . --write","test":"prettier . --check && lunte && brittle-bare test/index.js","lint":"lunte"},"repository":{"type":"git","url":"git+https://github.com/holepunchto/hyperdht-address.git"},"author":{"name":"Holepunch Inc"},"license":"Apache-2.0","bugs":{"url":"https://github.com/holepunchto/hyperdht-address/issues"},"homepage":"https://github.com/holepunchto/hyperdht-address","dependencies":{"compact-encoding":"^3.0.0","hyperschema":"^1.20.1"},"gitHead":"383543e9c03a6050bf9c647a9b547d5c5d3ec3fa","types":"./index.d.ts","_id":"hyperdht-address@1.1.1","_nodeVersion":"24.13.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-Mu/+7SW2cwvHxMXswa5mOrhrS5BJyntViAuB25k8d8wNtA8eAPs4LaIq6TwN1SS/KQY02h1r+gM8cQeN/k360w==","shasum":"ae8b258b33c44a9b9bb1169d1584708cf409e1a2","tarball":"http://registry-npm.ywwl.com/hyperdht-address/download/hyperdht-address-1.1.1.tgz","fileCount":7,"unpackedSize":16201,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBOPqOnz91Vmtg0f77p81UBxk03MEm8VB5/CWPZPRaFVAiAPzBVwuMI4yxWihCPedFh0fFiKeWqzxyUM21zeu+2Vqw=="}],"size":5824,"noattachment":false,"key":"/hyperdht-address/-/hyperdht-address-1.1.1.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"},{"name":"d_cassidy","email":"dominic@cassidy.casa"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hyperdht-address_1.1.1_1778003847190_0.5581421176174457"},"_hasShrinkwrap":false,"readme":"# hyperdht-address\n\nEncode and decode HyperDHT addresses.\n\n## Install\n\n```\nnpm install hyperdht-address\n```\n\n## Usage\n\n```js\nconst { encode, decode } = require('hyperdht-address')\n\nconst buf = encode(key, [{ host: '0.0.0.0', port: 12345 }])\nconst { key, nodes } = decode(buf)\n```\n\n## API\n\n#### `const buf = encode(key, [nodes])`\n\nEncode a 32-byte key and optional array of nodes into a buffer.\n\nEach node has the shape `{ host, port }`.\n\n#### `const { key, nodes } = decode(buf)`\n\nDecode a buffer into an address object with `key` (Buffer) and `nodes` (array of `{ host, port, family }`).\n\n## License\n\nApache-2.0\n","publish_time":1778003847397,"_cnpm_publish_time":1778003847397,"dist-tags":{"latest":"1.1.1"}}