{"name":"multiaddr","version":"2.0.2","description":"multiaddr implementation (binary + string representation of network addresses)","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","test":"aegir-test","test:node":"aegir-test node","test:browser":"aegir-test browser","build":"aegir-build","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major","coverage":"aegir-coverage","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/jbenet/js-multiaddr.git"},"keywords":["multiaddr","binary","string"],"author":{"name":"Juan Benet","email":"juan@benet.ai","url":"http://juan.benet.ai/"},"license":"MIT","bugs":{"url":"https://github.com/jbenet/js-multiaddr/issues"},"homepage":"https://github.com/jbenet/js-multiaddr","dependencies":{"babel-runtime":"^6.6.1","bs58":"^3.0.0","ip":"^1.0.2","lodash.filter":"^4.2.1","lodash.map":"^4.2.1","varint":"^4.0.0","xtend":"^4.0.1"},"devDependencies":{"aegir":"^3.0.4","buffer-loader":"0.0.1","chai":"^3.5.0","pre-commit":"^1.1.2"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Juan Batiz-Benet","email":"juan@benet.ai"},{"name":"Stephen Whitmore","email":"stephen.whitmore@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"}],"gitHead":"9c423dd3313cf7256c12e4c9d94251b5f0f9a90a","_id":"multiaddr@2.0.2","_shasum":"f552a573315fad98a4acc4984b3aca177d7ed73a","_from":".","_npmVersion":"3.8.7","_nodeVersion":"4.3.2","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"},{"name":"jbenet","email":"juan@benet.ai"}],"dist":{"shasum":"f552a573315fad98a4acc4984b3aca177d7ed73a","tarball":"http://registry-npm.ywwl.com/multiaddr/download/multiaddr-2.0.2.tgz","integrity":"sha512-rtLLq7fDAlHQK34JB9LRM/7y9Ebq/LcrVw7f8evMnBKONPOo13ITxnR+gA4BUG0AOps92cn425A9JyoDp+Xe8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrd0FhEsv2zLo6aYh4gj+sPLYixD5Br5MOAwb1RJdw7AiA/RcmehKsLfVO9DTjpJr83pvN2gpKqm5kLjBzgLleB1A=="}],"size":211072,"noattachment":false,"key":"/multiaddr/-/multiaddr-2.0.2.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/multiaddr-2.0.2.tgz_1463855582702_0.56418271898292"},"directories":{},"deprecated":"This module is deprecated, please upgrade to @multiformats/multiaddr","readme":"js-multiaddr\n============\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)\n[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](https://github.com/multiformats/multiformats)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs)\n[![Dependency Status](https://david-dm.org/multiformats/js-multiaddr.svg?style=flat-square)](https://david-dm.org/multiformats/js-multiaddr)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n[![](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n[![](https://img.shields.io/travis/multiformats/js-multiaddr.svg?style=flat-square)](https://travis-ci.com/multiformats/js-multiaddr)\n[![codecov](https://img.shields.io/codecov/c/github/multiformats/js-multiaddr.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-multiaddr)\n\n> JavaScript implementation of [multiaddr](https://github.com/multiformats/multiaddr).\n\n## Lead Maintainer\n\n[Jacob Heun](https://github.com/jacobheun)\n\n## Table of Contents\n\n- [js-multiaddr](#js-multiaddr)\n  - [Lead Maintainer](#lead-maintainer)\n  - [Table of Contents](#table-of-contents)\n  - [Background](#background)\n    - [What is multiaddr?](#what-is-multiaddr)\n  - [Install](#install)\n    - [NPM](#npm)\n    - [Browser: `<script>` Tag](#browser-script-tag)\n  - [Usage](#usage)\n  - [API](#api)\n  - [Resolvers](#resolvers)\n  - [Contribute](#contribute)\n  - [License](#license)\n\n## Background\n\n### What is multiaddr?\n\nA standard way to represent addresses that\n\n- support any standard network protocol\n- are self-describing\n- have a binary packed format\n- have a nice string representation\n- encapsulate well\n\n## Install\n\n### NPM\n```sh\nnpm i multiaddr\n```\n\n### Browser: `<script>` Tag\n\nLoading this module through a script tag will make the `Multiaddr` obj available in\nthe global namespace.\n\n```html\n<script src=\"https://unpkg.com/multiaddr/dist/index.min.js\"></script>\n```\n\n## Usage\n\n```js\n// if we are coming from <= 8.x you can use the factory function \nconst { multiaddr } = require('multiaddr')\nconst addr =  multiaddr(\"/ip4/127.0.0.1/udp/1234\")\n// <Multiaddr /ip4/127.0.0.1/udp/1234>\n\n// or just the class directly\nconst { Multiaddr } = require('multiaddr')\n\nconst addr = new Multiaddr(\"/ip4/127.0.0.1/udp/1234\")\n// <Multiaddr /ip4/127.0.0.1/udp/1234>\n\naddr.bytes\n// <Uint8Array 04 7f 00 00 01 11 04 d2>\n\naddr.toString()\n// '/ip4/127.0.0.1/udp/1234'\n\naddr.protos()\n/* \n[\n  {code: 4, name: 'ip4', size: 32},\n  {code: 273, name: 'udp', size: 16}\n]\n*/\n\n// gives you an object that is friendly with what Node.js core modules expect for addresses\naddr.nodeAddress()\n/*\n{\n  family: 4,\n  port: 1234,\n  address: \"127.0.0.1\"\n}\n*/\n\naddr.encapsulate('/sctp/5678')\n// <Multiaddr /ip4/127.0.0.1/udp/1234/sctp/5678>\n```\n\n## API\n\nhttps://multiformats.github.io/js-multiaddr/\n\n## Resolvers\n\n`multiaddr` allows multiaddrs to be resolved when appropriate resolvers are provided. This module already has resolvers available, but you can also create your own.  Resolvers should always be set in the same module that is calling `multiaddr.resolve()` to avoid conflicts if multiple versions of `multiaddr` are in your dependency tree. \nTo provide multiaddr resolvers you can do:\n\n```js\nconst { Multiaddr } = require('multiaddr')\nconst resolvers = require('multiaddr/src/resolvers')\n\nMultiaddr.resolvers.set('dnsaddr', resolvers.dnsaddrResolver)\n```\n\nThe available resolvers are:\n\n|     Name    | type | Description |\n|-------------|------|-------------|\n| `dnsaddrResolver` | `dnsaddr` | dnsaddr resolution with TXT Records |\n\nA resolver receives a `Multiaddr` as a parameter and returns a `Promise<Array<string>>`.\n\n## Contribute\n\nContributions welcome. Please check out [the issues](https://github.com/multiformats/js-multiaddr/issues).\n\nCheck out our [contributing document](https://github.com/multiformats/multiformats/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\n[MIT](LICENSE) © 2016 Protocol Labs Inc.\n","publish_time":1463855583811,"_cnpm_publish_time":1463855583811,"dist-tags":{"latest":"10.0.1"}}