{"_id":"ip6addr","_rev":"45-5e49a7e83a90cd580c3b079b113665b1","name":"ip6addr","dist-tags":{"latest":"0.2.5"},"versions":{"0.1.0":{"name":"ip6addr","version":"0.1.0","author":{"url":"joyent.com","name":"Joyent"},"license":"MPL-2","_id":"ip6addr@0.1.0","maintainers":[{"name":"pfmooney","email":"patrick.f.mooney@gmail.com"}],"homepage":"https://github.com/joyent/node-ip6addr","bugs":{"url":"https://github.com/joyent/node-ip6addr/issues"},"dist":{"shasum":"3644aa57c255a7ee273c8c3b50720bf72da3ff38","tarball":"https://registry.npmjs.org/ip6addr/-/ip6addr-0.1.0.tgz","integrity":"sha512-ZoHFJ+U+iw+l5MhPKdqb7Zdj8vNey1WmY/12JKf7SrgfTwjOSSwTFgUwYNJhwknp+jDepJrpCVyDxwuUCiJJTw==","signatures":[{"sig":"MEUCIA2AlCDa0suAwcAPUdhCbDkR8ROrkEVgy3mwsNdAgK3TAiEAvZ1Phlip5dQcRHskeItQJRQiJoYaJAdPj2FYLk43DvQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"ip6addr.js","_from":"ip6addr-0.1.0.tgz","_shasum":"3644aa57c255a7ee273c8c3b50720bf72da3ff38","scripts":{"test":"istanbul cover --print none test/runall.js"},"_npmUser":{"name":"pfmooney","email":"patrick.f.mooney@gmail.com"},"_resolved":"file:ip6addr-0.1.0.tgz","repository":{"url":"git://github.com/joyent/node-ip6addr.git","type":"git"},"_npmVersion":"2.5.1","description":"IPv6/IPv4 address parsing and manipulation","directories":{},"_nodeVersion":"0.10.36","dependencies":{"clone":"1.0.0","assert-plus":"0.1.5"},"devDependencies":{"tape":"^3.5.0","istanbul":"^0.3.6"}},"0.1.1":{"name":"ip6addr","version":"0.1.1","author":{"url":"joyent.com","name":"Joyent"},"license":"MPL-2","_id":"ip6addr@0.1.1","maintainers":[{"name":"pfmooney","email":"patrick.f.mooney@gmail.com"}],"homepage":"https://github.com/joyent/node-ip6addr#readme","bugs":{"url":"https://github.com/joyent/node-ip6addr/issues"},"dist":{"shasum":"93514d1ba04e77f154a6305fc45f396136f574b2","tarball":"https://registry.npmjs.org/ip6addr/-/ip6addr-0.1.1.tgz","integrity":"sha512-WMNWEOBFdMQ5fcgXQ5Q9O9q2ZWWx5O8USU2wfTV/1eyKo3+pPuf9SSqcOxucZOqR2IfjfTfmzwlFVodBxG8a8A==","signatures":[{"sig":"MEUCIQDt60VCvIs+Dm5dsFLDKwRjl07Tx24w4TOkp5/l7RAPWwIgdGoe1fDUy2993iiqQtjNcOauzd9D8IdbRf/1FsfXEQI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"ip6addr.js","_from":"ip6addr-0.1.1.tgz","_shasum":"93514d1ba04e77f154a6305fc45f396136f574b2","scripts":{"test":"istanbul cover --print none test/runall.js"},"_npmUser":{"name":"pfmooney","email":"patrick.f.mooney@gmail.com"},"_resolved":"file:ip6addr-0.1.1.tgz","repository":{"url":"git://github.com/joyent/node-ip6addr.git","type":"git"},"_npmVersion":"3.3.9","description":"IPv6/IPv4 address parsing and manipulation","directories":{},"_nodeVersion":"0.10.40","dependencies":{"clone":"1.0.0","assert-plus":"0.1.5"},"devDependencies":{"tape":"^3.5.0","istanbul":"^0.3.6"},"_npmOperationalInternal":{"tmp":"tmp/ip6addr-0.1.1.tgz_1454630888984_0.8538114607799798","host":"packages-9-west.internal.npmjs.com"}},"0.2.0":{"name":"ip6addr","version":"0.2.0","author":{"url":"joyent.com","name":"Joyent"},"license":"MPL-2","_id":"ip6addr@0.2.0","maintainers":[{"name":"pfmooney","email":"patrick.f.mooney@gmail.com"}],"homepage":"https://github.com/joyent/node-ip6addr#readme","bugs":{"url":"https://github.com/joyent/node-ip6addr/issues"},"dist":{"shasum":"76226c88e6db6f9d1e6c448067a661b5e1ee1e32","tarball":"https://registry.npmjs.org/ip6addr/-/ip6addr-0.2.0.tgz","integrity":"sha512-JVE8ko/No1TKn92Q2oBro/ycHURYz05UCHKel4ST3KUGTnOAHyicdxyDXrTjBip5uZSUjJmil3zsqR12Oa2hDA==","signatures":[{"sig":"MEQCICdybTUSNuX1jyZkUxMXwxgLy2ZH/avVUZOsBMoZudQ5AiAryKPNAOS52Gp3nRSoCGSYMB5XPJeoL0hI0s/l+SEGdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"ip6addr.js","_from":"ip6addr-0.2.0.tgz","_shasum":"76226c88e6db6f9d1e6c448067a661b5e1ee1e32","scripts":{"test":"istanbul cover --print none test/runall.js"},"_npmUser":{"name":"pfmooney","email":"patrick.f.mooney@gmail.com"},"_resolved":"file:ip6addr-0.2.0.tgz","repository":{"url":"git://github.com/joyent/node-ip6addr.git","type":"git"},"_npmVersion":"3.3.9","description":"IPv6/IPv4 address parsing and manipulation","directories":{},"_nodeVersion":"0.10.40","dependencies":{"clone":"1.0.0","assert-plus":"0.1.5"},"devDependencies":{"tape":"^3.5.0","istanbul":"^0.3.6"},"_npmOperationalInternal":{"tmp":"tmp/ip6addr-0.2.0.tgz_1468438221723_0.5148740254808217","host":"packages-12-west.internal.npmjs.com"}},"0.2.1":{"name":"ip6addr","version":"0.2.1","keywords":["ip","ipv4","ipv6","cidr","subnet"],"author":{"url":"joyent.com","name":"Joyent"},"license":"MPL-2","_id":"ip6addr@0.2.1","maintainers":[{"name":"melloc","email":"cody.mello@joyent.com"},{"name":"pfmooney","email":"pmooney@pfmooney.com"}],"homepage":"https://github.com/joyent/node-ip6addr#readme","bugs":{"url":"https://github.com/joyent/node-ip6addr/issues"},"dist":{"shasum":"549ee5f2cdae346d72ea9e898f42ca75ff903e3a","tarball":"https://registry.npmjs.org/ip6addr/-/ip6addr-0.2.1.tgz","integrity":"sha512-wPPWpO6sIIqrGB1j899AU6YNX9cFXi2ZJPEuQv28yrSLng/LG+j2rjSKM27pEoJfmBITowiXFeR3G7Sku+jTsQ==","signatures":[{"sig":"MEUCIQCAKU7SG9QuDZZfaNhc8DpYXQJBcFFkdb4/sratAovchgIgCv1ARl+vfVidnznlkHjpfucCaeMo0UFBjK8WEiyxRU4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"ip6addr.js","_from":".","_shasum":"549ee5f2cdae346d72ea9e898f42ca75ff903e3a","gitHead":"ad31250631e8d632ae9743a0dde9a4ae12ef65a0","scripts":{"test":"istanbul cover --print none test/runall.js"},"_npmUser":{"name":"melloc","email":"cody.mello@joyent.com"},"repository":{"url":"git://github.com/joyent/node-ip6addr.git","type":"git"},"_npmVersion":"2.15.1","description":"IPv6/IPv4 address parsing and manipulation","directories":{},"_nodeVersion":"0.10.46","dependencies":{"clone":"1.0.0","assert-plus":"0.1.5"},"devDependencies":{"tape":"^3.5.0","istanbul":"^0.3.6"},"_npmOperationalInternal":{"tmp":"tmp/ip6addr-0.2.1.tgz_1470438166566_0.9747759983874857","host":"packages-12-west.internal.npmjs.com"}},"0.2.2":{"name":"ip6addr","version":"0.2.2","keywords":["ip","ipv4","ipv6","cidr","subnet"],"author":{"url":"joyent.com","name":"Joyent"},"license":"MPL-2.0","_id":"ip6addr@0.2.2","maintainers":[{"name":"melloc","email":"cody.mello@joyent.com"},{"name":"pfmooney","email":"pmooney@pfmooney.com"}],"homepage":"https://github.com/joyent/node-ip6addr#readme","bugs":{"url":"https://github.com/joyent/node-ip6addr/issues"},"dist":{"shasum":"652ee260170392eebcb2a99232476241dcd50001","tarball":"https://registry.npmjs.org/ip6addr/-/ip6addr-0.2.2.tgz","integrity":"sha512-Bn2q1GIFTHR6NL+oEMxrS8ZQckRV0eDVL++GKgCQAi8EYQEOJ9uXqKk7SZL3zs7kgX8oPslPZxqWM94Y2uJThg==","signatures":[{"sig":"MEUCIHajOwD5O+kBkEokhxUJIeOdgUPjV8WACXLWvBqm8G7GAiEAl+bdQjYyNu1WmFA/fxQBGEgA5G9aL70RzQT5hN0DeXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"ip6addr.js","_from":".","_shasum":"652ee260170392eebcb2a99232476241dcd50001","gitHead":"2027b1a54b41ae804300a37cf0e3bf49c22a78a2","scripts":{"test":"istanbul cover --print none test/runall.js"},"_npmUser":{"name":"melloc","email":"cody.mello@joyent.com"},"repository":{"url":"git://github.com/joyent/node-ip6addr.git","type":"git"},"_npmVersion":"2.15.1","description":"IPv6/IPv4 address parsing and manipulation","directories":{},"_nodeVersion":"0.10.46","dependencies":{"assert-plus":"^1.0.0"},"devDependencies":{"tape":"^3.5.0","istanbul":"^0.3.6"},"_npmOperationalInternal":{"tmp":"tmp/ip6addr-0.2.2.tgz_1475787404088_0.16585195483639836","host":"packages-16-east.internal.npmjs.com"}},"0.2.3":{"name":"ip6addr","version":"0.2.3","keywords":["ip","ipv4","ipv6","cidr","subnet"],"author":{"url":"joyent.com","name":"Joyent"},"license":"MPL-2.0","_id":"ip6addr@0.2.3","maintainers":[{"name":"arekinath","email":"alex@cooperi.net"},{"name":"jclulow","email":"josh@sysmgr.org"},{"name":"melloc","email":"cody.mello@joyent.com"},{"name":"pfmooney","email":"pmooney@pfmooney.com"},{"name":"todd.whiteman","email":"todd.whiteman@joyent.com"},{"name":"trentm","email":"trentm@gmail.com"}],"homepage":"https://github.com/joyent/node-ip6addr#readme","bugs":{"url":"https://github.com/joyent/node-ip6addr/issues"},"dist":{"shasum":"660df0d27092434f0aadee025aba8337c6d7d4d4","tarball":"https://registry.npmjs.org/ip6addr/-/ip6addr-0.2.3.tgz","fileCount":6,"integrity":"sha512-qA9DXRAUW+lT47/i/4+Q3GHPwZjGt/atby1FH/THN6GVATA6+Pjp2nztH7k6iKeil7hzYnBwfSsxjthlJ8lJKw==","signatures":[{"sig":"MEUCIQCVNXRG4OVrXYCakRksKRLABiuvB+Bpzsmsfb77tErlDAIgfAK1AcsdXdETVKge00i08GEN6g4yQIlaDSH2KfX5iAk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":45460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZGtgCRA9TVsSAnZWagAATP4P+wRYw8eINkhgdr5EjEBy\nnHqNmd/6H4a/ztC9zaRnt8ghHHslV+OR9CQxnnSpR4QXcD9bLMiPxuyHE7TI\nS88/J7/REGMa3IiYjYCbKKLPkL5lk0PXoaHBaM5OVFmioABqhTWUt1ckxVw0\nNyWFxk0JrsaorLs0M8bQXog0ckSnFjWo0yB+Uc9qbG6JoKx1B/3EnMtzyUjj\nGuKeZhH3RoYMNzPw/fKec/4mk8321zJrTW5tWEFZ5moj0z8SX5nvXVXiVzbY\nOkH4bA7+8A9+xEBFZxV+jGjT11HbqroeoUzefymJIZn7y9qY/pa8ZTOjEOKO\nckyRWdXT+bAsoi9PlSUjuwZ+ZyaJ6On45hqrAyfpocvJbVqOT1Ijf6hIa3b4\n7KBwZcgvQTcXhmuq2W3nZAipxEE3mEuw0NGM4ginVllV8oJGv/2qUKlHpH8i\n/GzxmmMRejFKsDwd9AQah0xXBeujySVuDi5r3A7wv5Zyo1LhPZebaTbrBdQj\nNM059nhUAbhpn9t4oX6BtbG/9+lgrlPY1825yhtwXAmxGgX19AGdPKzSlo6a\nR43DlbR8IapvbELvTtoDoXiEQO079B8qC6jDMqBNAseCMbqj7Xvej8cVaKjR\nlZV67gv5oG4dieFC4TOi3ZDTovrufeGknUztE5zHL3KWhzk3zOJJOZXFpwWu\n0jZ6\r\n=aCRq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"ip6addr.js","gitHead":"b216e138079a4a8ed9ec00fd7a3ee8d60a879898","scripts":{"test":"istanbul cover --print none test/runall.js"},"_npmUser":{"name":"melloc","email":"cody.mello@joyent.com"},"repository":{"url":"git://github.com/joyent/node-ip6addr.git","type":"git"},"_npmVersion":"6.9.0","description":"IPv6/IPv4 address parsing and manipulation","directories":{},"_nodeVersion":"12.8.0","dependencies":{"jsprim":"^1.4.0","assert-plus":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^3.5.0","istanbul":"^0.3.6"},"_npmOperationalInternal":{"tmp":"tmp/ip6addr_0.2.3_1566862176222_0.15297071388917938","host":"s3://npm-registry-packages"}},"0.2.4":{"name":"ip6addr","version":"0.2.4","keywords":["ip","ipv4","ipv6","cidr","subnet"],"author":{"url":"joyent.com","name":"Joyent"},"license":"MPL-2.0","_id":"ip6addr@0.2.4","maintainers":[{"name":"todd.whiteman","email":"todd.whiteman@joyent.com"},{"name":"kusor","email":"kusorbox@gmail.com"},{"name":"wyatt","email":"wpreul@gmail.com"},{"name":"michael.hicks","email":"michael.hicks@joyent.com"},{"name":"bahamat","email":"bahamat@digitalelf.net"},{"name":"chudley","email":"aguycalledrichard@gmail.com"},{"name":"tchameroy","email":"tyler.chameroy@joyent.com"},{"name":"dbuell","email":"dayne.buell@joyent.com"},{"name":"pfmooney","email":"pmooney@pfmooney.com"},{"name":"melloc","email":"cody.mello@joyent.com"}],"homepage":"https://github.com/joyent/node-ip6addr#readme","bugs":{"url":"https://github.com/joyent/node-ip6addr/issues"},"dist":{"shasum":"01d963a29464c9feab26c1367e054e2d65b104e7","tarball":"https://registry.npmjs.org/ip6addr/-/ip6addr-0.2.4.tgz","fileCount":6,"integrity":"sha512-LrIYoxSeUgRogprmfljfbTmAxaG6SM3FluILQmOyATWS7uQEFoc1uTaEFAkRf//m8FXmOWc1HafmeapMkX8a4A==","signatures":[{"sig":"MEQCIGloRbk8f9TOPTcDol8hq3H6914pmMlP9oyIeRUXEe1QAiAPlEzOtWDQzBCbnCz1rKYDLaCSMKNHa0LOO5uOoPe9kw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":45263},"main":"ip6addr.js","gitHead":"c9948b9aeb38aeefe742bd0419f3ebcfd4514387","scripts":{"test":"istanbul cover --print none test/runall.js"},"_npmUser":{"name":"bahamat","email":"bahamat@digitalelf.net"},"repository":{"url":"git+https://github.com/joyent/node-ip6addr.git","type":"git"},"_npmVersion":"6.14.13","description":"IPv6/IPv4 address parsing and manipulation","directories":{},"_nodeVersion":"12.22.7","dependencies":{"jsprim":"^1.4.0","assert-plus":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^3.5.0","istanbul":"^0.3.6"},"_npmOperationalInternal":{"tmp":"tmp/ip6addr_0.2.4_1635970867309_0.7165887316926871","host":"s3://npm-registry-packages"}},"0.2.5":{"name":"ip6addr","version":"0.2.5","keywords":["ip","ipv4","ipv6","cidr","subnet"],"author":{"url":"joyent.com","name":"Joyent"},"license":"MPL-2.0","_id":"ip6addr@0.2.5","maintainers":[{"name":"todd.whiteman","email":"todd.whiteman@joyent.com"},{"name":"kusor","email":"kusorbox@gmail.com"},{"name":"wyatt","email":"wpreul@gmail.com"},{"name":"michael.hicks","email":"michael.hicks@joyent.com"},{"name":"bahamat","email":"bahamat@digitalelf.net"},{"name":"chudley","email":"aguycalledrichard@gmail.com"},{"name":"tchameroy","email":"tyler.chameroy@joyent.com"},{"name":"dbuell","email":"dayne.buell@joyent.com"},{"name":"pfmooney","email":"pmooney@pfmooney.com"},{"name":"melloc","email":"cody.mello@joyent.com"}],"homepage":"https://github.com/joyent/node-ip6addr#readme","bugs":{"url":"https://github.com/joyent/node-ip6addr/issues"},"dist":{"shasum":"06e134f44b4e1a684fd91b24035dca7a53b8f759","tarball":"https://registry.npmjs.org/ip6addr/-/ip6addr-0.2.5.tgz","fileCount":6,"integrity":"sha512-9RGGSB6Zc9Ox5DpDGFnJdIeF0AsqXzdH+FspCfPPaU/L/4tI6P+5lIoFUFm9JXs9IrJv1boqAaNCQmoDADTSKQ==","signatures":[{"sig":"MEQCIE33wJpY9WjWa1x9x1aEQIMw2Tb4FW1sCXKQ+SSQOr4yAiAWlcQ+IBddyoOdUW7+nGAN2oWvAH1F4Wvn49iDEUH/6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":45388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpPp8CRA9TVsSAnZWagAANxUP+gL88gijZ0gLH77GS6x+\nm9r7ds99owcwndANt1MWCWZTJClM7PS/FJvO9iXJRFCpvCj3sKnE5YmwP97Z\nsnFA169AyQASbcMzslcVHywbY2BBr0IiM0FxTLfVIYQ3O2z7zCoLMzbROj5k\nHvhuYjvdO9WTw4oLgyuwTnH2e6XKoZjsoIchqPqJHVSfFVYn/BNwZpG+4AdZ\nP+Vfa2qxWESyBQohAf6UDsV5+gXVv2U1QjQ3Qfvx3iv3Uqv+LVb6Cf0lOozI\n90IsvZ5tMbnMRI3pn4xxYnF2VqYNH9Aw0bdF6SUDUtPJOoagtEIVLlyzDfgj\nY4PZuSLM6sAeBfMZRX6yH0zMmu3uj6hjE+xDkHpGdUARiANKVSZURWWo9fLx\nA9HQjnJquXrM6IMGX6osSoEqx4q5U2fTrftYw32GbgBYjYQO0gQsAukIiwOI\nvnF5Vz3/zsTZWgNE9GhoIpYq8VSdxMQXcANA4dKHnvP3+5P8QpTTmdykb4eY\nt24JkKCFz8qSX4WyZ5+TpyFGOXhyX3+UrpGYFtRJNLNc6UWbeNqkfoGELbPK\ndmmXK2Wf2J5SOyMU6R+rck6GI+MdEDuhDePsWfhIAwXMcER8pVHg3YS14Nrj\nIYYIAntvv1kh+q0FdKWotdrnayegvY06C7Bsfd3WEaUcZ7R+Krcj6eA7CwGN\n6gOz\r\n=oduG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"ip6addr.js","gitHead":"b76beda6a445b31bb7e97d8a5d65024ef72300df","scripts":{"test":"istanbul cover --print none test/runall.js"},"_npmUser":{"name":"bahamat","email":"bahamat@digitalelf.net"},"repository":{"url":"git+https://github.com/joyent/node-ip6addr.git","type":"git"},"_npmVersion":"6.14.13","description":"IPv6/IPv4 address parsing and manipulation","directories":{},"_nodeVersion":"14.18.1","dependencies":{"jsprim":"^2.0.2","assert-plus":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^3.5.0","istanbul":"^0.3.6"},"_npmOperationalInternal":{"tmp":"tmp/ip6addr_0.2.5_1638201980235_0.41907715962150105","host":"s3://npm-registry-packages"}}},"time":{"created":"2015-03-10T20:26:31.451Z","modified":"2025-11-26T18:15:51.772Z","0.1.0":"2015-03-10T20:26:31.451Z","0.1.1":"2016-02-05T00:08:09.526Z","0.2.0":"2016-07-13T19:30:24.174Z","0.2.1":"2016-08-05T23:02:46.810Z","0.2.2":"2016-10-06T20:56:46.649Z","0.2.3":"2019-08-26T23:29:36.366Z","0.2.4":"2021-11-03T20:21:07.427Z","0.2.5":"2021-11-29T16:06:20.368Z"},"bugs":{"url":"https://github.com/joyent/node-ip6addr/issues"},"author":{"url":"joyent.com","name":"Joyent"},"license":"MPL-2.0","homepage":"https://github.com/joyent/node-ip6addr#readme","keywords":["ip","ipv4","ipv6","cidr","subnet"],"repository":{"url":"git+https://github.com/joyent/node-ip6addr.git","type":"git"},"description":"IPv6/IPv4 address parsing and manipulation","maintainers":[{"email":"todd.whiteman@joyent.com","name":"todd.whiteman"},{"email":"kusorbox@gmail.com","name":"kusor"},{"email":"michael.hicks@joyent.com","name":"michael.hicks"},{"email":"bahamat@digitalelf.net","name":"bahamat"},{"email":"Tr@visPaul.me","name":"tpaul"},{"email":"danmcd@edgecast.io","name":"kebesays"},{"email":"pmooney@pfmooney.com","name":"pfmooney"},{"email":"melloc@writev.io","name":"melloc"}],"readme":"# ip6addr\n\nip6addr is a small library for manipulating IP addresses in JavaScript.\nInspired by [ipaddr.js](https://github.com/whitequark/ipaddr.js), ip6addr\nfocuses on better IPv6 support, particularly in cases where IPv4 and IPv6\naddresses are used together.\n\nIf you want to also parse and manipulate MAC addresses, see\n[macaddr](https://github.com/joyent/node-macaddr).\n\n# Installation\n\n    npm install ip6addr\n\n# API\n\n## `parse(input)`\n\nParse the input IP address, which can be either a string or an integer, and\nreturn a representative [`Addr`](#class-addr). When the address is invalid,\nan explanatory `Error` is thrown.\n\n```javascript\n> var addr1 = ip6addr.parse('fd00::0123')\n> addr1.toString()\n'fd00::123'\n> var addr2 = ip6addr.parse('1.2.3.4')\n> addr2.toString()\n'1.2.3.4'\n> var addr3 = ip6addr.parse('::ffff:127.0.0.1')\n> addr3.toString()\n'::ffff:127.0.0.1'\n```\n\n## `createCIDR(cidr, [plen])`\n\nEither parse a string in CIDR notation, such as `'192.168.1.0/24'`, or, when\ngiven an address and a prefix length, create the representative\n[`CIDR`](#class-cidr). When it fails to parse, it throws an `Error`.\n\n```javascript\n> var sub1 = ip6addr.createCIDR('fe80::/10')\n> sub1.toString()\n'fe80::/10'\n> var sub2 = ip6addr.createCIDR('fc00::', 7)\n> sub2.toString()\n'fc00::/7'\n> var sub3 = ip6addr.createCIDR('10.0.0.0', 8)\n> sub3.toString()\n'10.0.0.0/8'\n```\n\n## `createAddrRange(first, last)`\n\nCreate an inclusive range of addresses from `first` address to `last` address,\nrepresented by an [`AddrRange`](#class-addrrange). The `first` address must\ncome before or be the same as the `last` address.\n\n```javascript\n> var r1 = ip6addr.createAddrRange('fd00::123', 'fd00::ea00')\n> r1.first().toString()\n'fd00::123'\n> r1.last().toString()\n'fd00::ea00'\n```\n\n## <a name=\"func-compareaddr\">`compare(addr1, addr2)`</a>\n\nCompares one address with another, and returns:\n\n- A negative number when `addr1` comes before `addr2`\n- A positive number when `addr1` comes after `addr2`\n- 0 when the two addresses are the same\n\nIPv4 addresses are compared against IPv6 addresses in their IPv4-mapped form.\n\n```javascript\n> [ 'fc00::123', '192.168.1.50', '10.0.1.76', '8.8.8.8', '::1' ].sort(ip6addr.compare)\n[ '::1',\n  '8.8.8.8',\n  '10.0.1.76',\n  '192.168.1.50',\n  'fc00::123' ]\n```\n\n## <a name=\"func-comparecidr\">`compareCIDR(cidr1, cidr2)`</a>\n\nCompares one subnet with another. Subnets are compared first by their address\ncomponent, and then by their prefix length. The network with the smaller prefix\nlength (the larger subnet) is considered greater than the network with the\nlarger prefix (the smaller subnet). Like [`compare()`](#func-compareaddr), this\nmethod returns:\n\n- A negative number when subnet `cidr1` comes before `cidr2`\n- A positive number when subnet `cidr1` comes after `cidr2`\n- 0 when the two subnets are the same\n\n```javascript\n> [ 'fc00::/7', '192.168.0.0/24', '192.168.0.0/16', '127.0.0.0/8', '::ffff:0.0.0.0/96' ].sort(ip6addr.compareCIDR)\n[ '::ffff:0.0.0.0/96',\n  '127.0.0.0/8',\n  '192.168.0.0/24',\n  '192.168.0.0/16',\n  'fc00::/7' ]\n```\n\n## <a name=\"class-addr\">`Addr`</a>\n\nAn immutable representation of an IP address.\n\n### `Addr#kind()`\n\nReturns the address family of the object, `ipv4` or `ipv6`.\n\n```javascript\n> ip6addr.parse('::1').kind()\n'ipv6'\n> ip6addr.parse('127.0.0.1').kind()\n'ipv4'\n> ip6addr.parse('::ffff:127.0.0.1').kind()\n'ipv4'\n```\n\n### `Addr#toString([opts])`\n\nReturn the string representation of this address. An options object can be\npassed to control how the address is formatted. Valid options are:\n\n- `format` (default: `auto`), select the notation style to use when printing.\n  Available options are:\n  - `'auto'`, format using the notation style the address was parsed as\n  - `'v4'`, format as an IPv4 address\n  - `'v4-mapped'`, format as an IPv4-mapped IPv6 address\n  - `'v6'`, format the string as IPv6 address\n\n  Attempts to format an IPv6 address with `'v4'` or `'v4-mapped'` will throw an\n  `Error`.\n- `zeroElide` (default: `true`), whether to elide the longest run of zeros in\n  IPv6 addresses as `::` (e.g., `'0:0:0:0:0:0:0:1'` becomes `'::1'`).\n- `zeroPad` (default: `false`), if a field (also referred to as a \"group\" or\n  \"hextet\") would print as less than four characters in an IPv6 address,\n  whether or not to pad it with leading zeros (e.g., `'::1'` becomes `'::0001'`)\n\n```javascript\n> var addr = ip6addr.parse('::ffff:127.0.0.1')\n> addr.toString({ format: 'auto' })\n'::ffff:127.0.0.1'\n> addr.toString({ format: 'v4' })\n'127.0.0.1'\n> addr.toString({ format: 'v4-mapped' })\n'::ffff:127.0.0.1'\n> addr.toString({ format: 'v6' })\n'::ffff:7f00:1'\n> addr.toString({ zeroElide: false })\n'0:0:0:0:0:ffff:127.0.0.1'\n> addr.toString({ zeroElide: false, zeroPad: true })\n'0000:0000:0000:0000:0000:ffff:127.0.0.1'\n```\n\n### `Addr#toBuffer([buf])`\n\nConvert the address to a buffer of sixteen 16-bit integers, representing the\nIPv6 representation of this address. An alternate buffer to write to may be\npassed in instead, rather than creating a new one.\n\n### `Addr#toLong()`\n\nReturn the address represented as a 32-bit integer. If this address cannot be\nrepresented as a 32-bit integer (i.e., it's an IPv6 address), then this method\nwill throw an Error.\n\n```javascript\n> var addr = ip6addr.parse('127.0.0.1')\n> addr.toLong()\n2130706433\n```\n\n### `Addr#offset(num)`\n\nCalculate the offset by `num` from this address. If the offset would result\nin wrap-around, then this method returns `null`.\n\n```javascript\n> var addr1 = ip6addr.parse('fd20::5')\n> addr1.offset(1).toString()\n'fd20::6'\n> addr1.offset(-1).toString()\n'fd20::4'\n> addr1.offset(20).toString()\n'fd20::19'\n> addr1.offset(-20).toString()\n'fd1f:ffff:ffff:ffff:ffff:ffff:ffff:fff1'\n> ip6addr.parse('255.255.255.255').offset(1)\nnull\n> ip6addr.parse('0.0.0.0').offset(-1)\nnull\n> ip6addr.parse('::').offset(-1)\nnull\n```\n\n### `Addr#compare(other)`\n\nCompare another address to this one in the same manner as\n[`compare()`](#func-compareaddr).\n\n## <a name=\"class-cidr\">`CIDR`</a>\n\nAn immutable representation of a subnet.\n\n### `CIDR#contains(input)`\n\nChecks if this subnet contains the address `input`.\n\n```javascript\n> var sub = ip6addr.createCIDR('fe80::', 10)\n> sub.contains('fe80::92b8:d0ff:fe81:f590')\ntrue\n> sub.contains('fe80::507f:baff:fe85:92eb')\ntrue\n> sub.contains('2001:4860:4860::8888')\nfalse\n> sub.contains('172.16.20.5')\nfalse\n> sub.contains('::ffff:127.0.0.1')\nfalse\n```\n\n### `CIDR#first()`\n\nReturns the first address in this subnet.\n\n```javascript\n> var sub = ip6addr.createCIDR('fe80::', 10)\n> sub.first().toString()\n'fe80::1'\n```\n\n### `CIDR#last()`\n\nReturns the last address in this subnet. For IPv4 subnets, this is the address\njust before the broadcast address.\n\n```javascript\n> var sub1 = ip6addr.createCIDR('fe80::', 10)\n> sub1.last().toString()\n'febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff'\n> var sub2 = ip6addr.createCIDR('192.168.1.0', 24)\n> sub2.last().toString()\n'192.168.1.254'\n```\n\n### `CIDR#broadcast()`\n\nReturns the broadcast address for this subnet. If the subnet doesn't have a broadcast\naddress (i.e., it's an IPv6 subnet and therefore uses multicast), then this method\nthrows an Error.\n\n```javascript\n> var sub1 = ip6addr.createCIDR('192.168.1.0', 24)\n> sub1.broadcast().toString()\n'192.168.1.255'\n> var sub2 = ip6addr.createCIDR('192.168.0.0', 16)\n> sub2.broadcast().toString()\n'192.168.255.255'\n```\n\n### `CIDR#compare(other)`\n\nCompare another subnet to this one in the same manner as\n[`compareCIDR()`](#func-comparecidr).\n\n### `CIDR#prefixLength()`\n\nReturns the prefix length of this subnet.\n\n### `CIDR#address()`\n\nReturns the address component of this subnet.\n\n### `CIDR#toString([opts])`\n\nReturns the string representation of this subnet. An options object can be\npassed to control how the subnet is formatted, using the same options that\n`Addr#toString()` takes.\n\n## <a name=\"class-addrrange\">`AddrRange`</a>\n\nAn immutable representation of a range of addresses.\n\n### `AddrRange#contains(addr)`\n\nDetermines whether the input address falls within this address range.\n\n```javascript\n> var range = ip6addr.createAddrRange('fd00::123', 'fd00::ea00')\nundefined\n> range.contains('fd00::123')\ntrue\n> range.contains('fd00::ea00')\ntrue\n> range.contains('fd00::b000')\ntrue\n> range.contains('fd00::122')\nfalse\n> range.contains('fd00::ea01')\nfalse\n> range.contains('8.8.8.8')\nfalse\n```\n\n### `AddrRange#first()`\n\nReturns the first address in this range.\n\n### `AddrRange#last()`\n\nReturns the last address in this range.\n\n# License\n\nThis Source Code Form is subject to the terms of the Mozilla Public License, v.\n2.0.  For the full license text see LICENSE, or http://mozilla.org/MPL/2.0/.\n\nCopyright (c) 2019, Joyent, Inc.\n","readmeFilename":"README.md"}