{"_id":"interface-connection","_rev":"4646871","name":"interface-connection","description":"A test suite and interface you can use to implement a connection interface.","dist-tags":{"beta":"0.4.1","latest":"0.3.3"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"time":{"modified":"2026-04-10T20:20:00.000Z","created":"2015-12-12T04:38:57.201Z","0.4.1":"2019-10-17T12:41:44.706Z","0.4.0":"2019-09-27T09:22:01.768Z","0.3.3":"2018-11-29T13:25:38.387Z","0.3.2":"2017-03-21T14:14:54.231Z","0.3.1":"2017-02-09T16:51:43.442Z","0.3.0":"2016-11-03T08:27:36.651Z","0.2.1":"2016-09-05T22:18:12.168Z","0.2.0":"2016-09-05T21:54:41.167Z","0.1.8":"2016-08-03T13:24:17.465Z","0.1.7":"2016-06-27T09:10:14.231Z","0.1.6":"2016-06-23T15:09:47.167Z","0.1.5":"2016-06-23T09:34:00.462Z","0.1.4":"2016-06-23T09:24:01.086Z","0.1.3":"2016-06-16T10:45:48.792Z","0.1.2":"2016-06-16T10:44:15.093Z","0.1.1":"2016-06-16T10:36:46.263Z","0.1.0":"2016-06-16T10:21:24.052Z","0.0.3":"2015-12-12T04:38:57.201Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/libp2p/interface-connection.git"},"versions":{"0.4.1":{"name":"interface-connection","version":"0.4.1","description":"A test suite and interface you can use to implement a connection interface.","leadMaintainer":"Jacob Heun <jacobheun@gmail.com>","main":"src/index.js","scripts":{"lint":"aegir lint","build":"aegir build","test":"aegir test","test:node":"aegir test -t node","test:browser":"aegir test -t browser -t webworker","release":"aegir release","release-minor":"aegir release --type minor","release-major":"aegir release --type major"},"pre-push":["lint"],"repository":{"type":"git","url":"git+https://github.com/libp2p/interface-connection.git"},"keywords":["IPFS"],"license":"MIT","bugs":{"url":"https://github.com/libp2p/interface-connection/issues"},"homepage":"https://github.com/libp2p/interface-connection","dependencies":{"abortable-iterator":"^2.1.0","chai":"^4.2.0","class-is":"^1.1.0","dirty-chai":"^2.0.1","err-code":"^2.0.0","multiaddr":"^7.1.0","peer-id":"~0.13.2","sinon":"^7.5.0"},"devDependencies":{"aegir":"^20.2.0","it-pair":"^1.0.0","it-pipe":"^1.0.1","mocha":"^6.2.0"},"engines":{"node":">=10.0.0","npm":">=6.0.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Greenkeeper","email":"support@greenkeeper.io"},{"name":"Jacob Heun","email":"jacobheun@gmail.com"},{"name":"James Ray","email":"16969914+jamesray1@users.noreply.github.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"}],"readmeFilename":"README.md","gitHead":"499575cf8c9cc8c0d072c2c04f0f39e909ca9588","_id":"interface-connection@0.4.1","_nodeVersion":"12.7.0","_npmVersion":"6.10.0","dist":{"shasum":"9cff70c2c652bf6942e58e96998450a7ad001098","size":1285143,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.4.1.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmUser":{"name":"jacobheun","email":"jacobheun@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interface-connection_0.4.1_1571316104497_0.7123216280231865"},"_hasShrinkwrap":false,"publish_time":1571316104706,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1571316104706,"_cnpmcore_publish_time":"2021-12-16T11:26:45.068Z"},"0.4.0":{"name":"interface-connection","version":"0.4.0","description":"A test suite and interface you can use to implement a connection interface.","leadMaintainer":"Jacob Heun <jacobheun@gmail.com>","main":"src/index.js","scripts":{"lint":"aegir lint","build":"aegir build","test":"aegir test","test:node":"aegir test -t node","test:browser":"aegir test -t browser -t webworker","release":"aegir release","release-minor":"aegir release --type minor","release-major":"aegir release --type major"},"pre-push":["lint"],"repository":{"type":"git","url":"git+https://github.com/libp2p/interface-connection.git"},"keywords":["IPFS"],"license":"MIT","bugs":{"url":"https://github.com/libp2p/interface-connection/issues"},"homepage":"https://github.com/libp2p/interface-connection","dependencies":{"abortable-iterator":"^2.1.0","chai":"^4.2.0","class-is":"^1.1.0","dirty-chai":"^2.0.1","err-code":"^2.0.0","multiaddr":"^7.1.0","peer-id":"~0.13.2"},"devDependencies":{"aegir":"^20.2.0","it-pair":"^1.0.0","it-pipe":"^1.0.1","mocha":"^6.2.0"},"engines":{"node":">=10.0.0","npm":">=6.0.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Greenkeeper","email":"support@greenkeeper.io"},{"name":"Jacob Heun","email":"jacobheun@gmail.com"},{"name":"James Ray","email":"16969914+jamesray1@users.noreply.github.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"}],"gitHead":"721e475fd235f301bf8bfebcb60ca5f087cd2557","_id":"interface-connection@0.4.0","_nodeVersion":"12.7.0","_npmVersion":"6.10.0","dist":{"shasum":"5c5964b45b03414a9812ea49e34d146c001247d9","size":1285250,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.4.0.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmUser":{"name":"jacobheun","email":"jacobheun@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interface-connection_0.4.0_1569576121585_0.02430473183870996"},"_hasShrinkwrap":false,"publish_time":1569576121768,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1569576121768,"_cnpmcore_publish_time":"2021-12-16T11:26:47.826Z"},"0.3.3":{"name":"interface-connection","version":"0.3.3","description":"A test suite and interface you can use to implement a connection interface.","leadMaintainer":"Jacob Heun <jacobheun@gmail.com>","main":"src/index.js","scripts":{"lint":"aegir lint","build":"aegir build","test":"node -e 'process.exit()'","release":"aegir release --no-test","release-minor":"aegir release --type minor --no-test","release-major":"aegir release --type major --no-test"},"pre-commit":["lint"],"repository":{"type":"git","url":"git+https://github.com/libp2p/interface-connection.git"},"keywords":["IPFS"],"license":"MIT","bugs":{"url":"https://github.com/libp2p/interface-connection/issues"},"homepage":"https://github.com/libp2p/interface-connection","dependencies":{"pull-defer":"~0.2.3"},"devDependencies":{"aegir":"^17.1.1","timed-tape":"~0.1.1"},"engines":{"node":">=8.0.0","npm":">=6.0.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Greenkeeper","email":"support@greenkeeper.io"},{"name":"Jacob Heun","email":"jacobheun@gmail.com"},{"name":"James Ray","email":"16969914+jamesray1@users.noreply.github.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"}],"gitHead":"4e138dba674535e2b394b4508f2332dce2171962","_id":"interface-connection@0.3.3","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"jacobheun","email":"jacobheun@gmail.com"},"dist":{"shasum":"d82dd81efee5f2d40d7cb0fd75e6e858f92fa199","size":9019,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.3.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.3.3.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interface-connection_0.3.3_1543497938228_0.784524645014024"},"_hasShrinkwrap":false,"publish_time":1543497938387,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1543497938387,"_cnpmcore_publish_time":"2021-12-16T11:26:48.070Z"},"0.3.2":{"name":"interface-connection","version":"0.3.2","description":"A test suite and interface you can use to implement a connection interface.","main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release --node","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/libp2p/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/libp2p/interface-connection/issues"},"homepage":"https://github.com/libp2p/interface-connection","dependencies":{"timed-tape":"~0.1.1","pull-defer":"~0.2.2"},"devDependencies":{"aegir":"^11.0.0"},"engines":{"node":">=4.0.0","npm":">=3.0.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Greenkeeper","email":"support@greenkeeper.io"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"}],"gitHead":"7cf11bef91e37b0071940da86bd0cc3fb22359c9","_id":"interface-connection@0.3.2","_shasum":"e4949883f6ea79fb7edd01ee3f4fca47a29fd2c4","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"dist":{"shasum":"e4949883f6ea79fb7edd01ee3f4fca47a29fd2c4","size":75875,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.3.2.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/interface-connection-0.3.2.tgz_1490105693592_0.1484623074065894"},"directories":{},"publish_time":1490105694231,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1490105694231,"_cnpmcore_publish_time":"2021-12-16T11:26:48.525Z"},"0.3.1":{"name":"interface-connection","version":"0.3.1","description":"A test suite and interface you can use to implement a connection interface.","main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/libp2p/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/libp2p/interface-connection/issues"},"homepage":"https://github.com/libp2p/interface-connection","dependencies":{"timed-tape":"~0.1.1","pull-defer":"~0.2.2"},"devDependencies":{"aegir":"^10.0.0"},"engines":{"node":">=4.0.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Greenkeeper","email":"support@greenkeeper.io"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"}],"gitHead":"f7b996fd3c3eefb7611def8f79a83f1c2b4dc0a0","_id":"interface-connection@0.3.1","_shasum":"43a3117dbc695ac9ba7e5e94c78c2dd68de124ae","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"dist":{"shasum":"43a3117dbc695ac9ba7e5e94c78c2dd68de124ae","size":74786,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.3.1.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/interface-connection-0.3.1.tgz_1486659103202_0.5825479433406144"},"directories":{},"publish_time":1486659103442,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1486659103442,"_cnpmcore_publish_time":"2021-12-16T11:26:48.950Z"},"0.3.0":{"name":"interface-connection","version":"0.3.0","description":"A test suite and interface you can use to implement a connection interface.","main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/libp2p/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/libp2p/interface-connection/issues"},"homepage":"https://github.com/libp2p/interface-connection","dependencies":{"timed-tape":"^0.1.1","pull-defer":"^0.2.2"},"devDependencies":{"aegir":"^9.0.0"},"engines":{"node":">=4.0.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"greenkeeperio-bot","email":"support@greenkeeper.io"}],"gitHead":"5a78c4d732f94a0b203c76d76f252d3059f51519","_id":"interface-connection@0.3.0","_shasum":"48d996c81b63c3a7442178e5a6a3c8c31cebaadc","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"48d996c81b63c3a7442178e5a6a3c8c31cebaadc","size":75846,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.3.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/interface-connection-0.3.0.tgz_1478161656120_0.20173059520311654"},"directories":{},"publish_time":1478161656651,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1478161656651,"_cnpmcore_publish_time":"2021-12-16T11:26:49.393Z"},"0.2.1":{"name":"interface-connection","version":"0.2.1","description":"A test suite and interface you can use to implement a connection interface.","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"timed-tape":"^0.1.1","pull-defer":"^0.2.2"},"devDependencies":{"aegir":"^6.0.1"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"},{"name":"greenkeeperio-bot","email":"support@greenkeeper.io"}],"gitHead":"8c9629b00b68fe500a5008df5030dd3524c7845c","_id":"interface-connection@0.2.1","_shasum":"1b9d05df246d5b6dbf09756a98ea9245687aa037","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"dist":{"shasum":"1b9d05df246d5b6dbf09756a98ea9245687aa037","size":241281,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.2.1.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/interface-connection-0.2.1.tgz_1473113889816_0.7876256857998669"},"directories":{},"publish_time":1473113892168,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1473113892168,"_cnpmcore_publish_time":"2021-12-16T11:26:50.243Z"},"0.2.0":{"name":"interface-connection","version":"0.2.0","description":"A test suite and interface you can use to implement a connection interface.","main":"src/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"timed-tape":"^0.1.1","pull-defer":"^0.2.2"},"devDependencies":{"aegir":"^6.0.1"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"},{"name":"greenkeeperio-bot","email":"support@greenkeeper.io"}],"gitHead":"fda59fc8401f50c01768ce0956c61a5679ad97e4","_id":"interface-connection@0.2.0","_shasum":"9149726c443c5b683e359057f618773b419764b6","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"dist":{"shasum":"9149726c443c5b683e359057f618773b419764b6","size":241274,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.2.0.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/interface-connection-0.2.0.tgz_1473112479137_0.23087154072709382"},"directories":{},"publish_time":1473112481167,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1473112481167,"_cnpmcore_publish_time":"2021-12-16T11:26:51.176Z"},"0.1.8":{"name":"interface-connection","version":"0.1.8","description":"A test suite and interface you can use to implement a connection interface.","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"duplexify":"github:diasdavid/duplexify#a22bcdf","timed-tape":"^0.1.0"},"devDependencies":{"aegir":"^4.0.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"}],"gitHead":"2ecebf14ed4f15d421d2251b3fef0e04b914435b","_id":"interface-connection@0.1.8","_shasum":"ab55b2b812b9e6463bf37fd95f8fa895fe700227","_from":".","_npmVersion":"3.8.9","_nodeVersion":"4.4.4","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"dist":{"shasum":"ab55b2b812b9e6463bf37fd95f8fa895fe700227","size":354742,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.1.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.1.8.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/interface-connection-0.1.8.tgz_1470230655042_0.14367629867047071"},"directories":{},"publish_time":1470230657465,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1470230657465,"_cnpmcore_publish_time":"2021-12-16T11:26:52.360Z"},"0.1.7":{"name":"interface-connection","version":"0.1.7","description":"A test suite and interface you can use to implement a connection interface.","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"duplexify":"github:diasdavid/duplexify#048ec46","timed-tape":"^0.1.0"},"devDependencies":{"aegir":"^3.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"}],"gitHead":"4f2058a51511181e111ff4d08509fb5f6885a1cf","_id":"interface-connection@0.1.7","_shasum":"848f828815012c074596bfe1deb3795bbf88add6","_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"}],"dist":{"shasum":"848f828815012c074596bfe1deb3795bbf88add6","size":355681,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.1.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.1.7.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interface-connection-0.1.7.tgz_1467018611659_0.28133138711564243"},"directories":{},"publish_time":1467018614231,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1467018614231,"_cnpmcore_publish_time":"2021-12-16T11:26:54.290Z"},"0.1.6":{"name":"interface-connection","version":"0.1.6","description":"A test suite and interface you can use to implement a connection interface.","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"duplexify":"github:diasdavid/duplexify#048ec46","timed-tape":"^0.1.0"},"devDependencies":{"aegir":"^3.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"}],"gitHead":"a8178c3c77265e7a223e20acd9c70a526461571c","_id":"interface-connection@0.1.6","_shasum":"bff5e341be36bd245c85db2df2a41f2038d3a47c","_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"}],"dist":{"shasum":"bff5e341be36bd245c85db2df2a41f2038d3a47c","size":355611,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.1.6.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interface-connection-0.1.6.tgz_1466694585154_0.90892294049263"},"directories":{},"publish_time":1466694587167,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1466694587167,"_cnpmcore_publish_time":"2021-12-16T11:26:55.316Z"},"0.1.5":{"name":"interface-connection","version":"0.1.5","description":"A test suite and interface you can use to implement a connection interface.","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"duplexify":"^3.4.3","timed-tape":"^0.1.0"},"devDependencies":{"aegir":"^3.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"}],"gitHead":"ee745d23a76dcc339912cfbca0a5732399dcd37a","_id":"interface-connection@0.1.5","_shasum":"62db2160d9de5b5811f7be4207f224aaa806c6f8","_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"}],"dist":{"shasum":"62db2160d9de5b5811f7be4207f224aaa806c6f8","size":355462,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.1.5.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interface-connection-0.1.5.tgz_1466674438408_0.7204206597525626"},"directories":{},"publish_time":1466674440462,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1466674440462,"_cnpmcore_publish_time":"2021-12-16T11:26:56.873Z"},"0.1.4":{"name":"interface-connection","version":"0.1.4","description":"A test suite and interface you can use to implement a connection interface.","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"duplexify":"^3.4.3","timed-tape":"^0.1.0"},"devDependencies":{"aegir":"^3.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"}],"gitHead":"1e4182691a28c18823640c5b45f44edfafceaf26","_id":"interface-connection@0.1.4","_shasum":"7081417ad8c497039d70349df384b3684f779f4b","_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"}],"dist":{"shasum":"7081417ad8c497039d70349df384b3684f779f4b","size":355524,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.1.4.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/interface-connection-0.1.4.tgz_1466673838663_0.856835164129734"},"directories":{},"publish_time":1466673841086,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1466673841086,"_cnpmcore_publish_time":"2021-12-16T11:26:59.011Z"},"0.1.3":{"name":"interface-connection","version":"0.1.3","description":"A test suite and interface you can use to implement a connection interface.","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"duplexify":"^3.4.3","timed-tape":"^0.1.0"},"devDependencies":{"aegir":"^3.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"}],"gitHead":"3af70ac2e8c8c6aecddb9a73f8843d4ddbc80b99","_id":"interface-connection@0.1.3","_shasum":"870d07116ec75c4d32dab82a055139328bcd65b5","_from":".","_npmVersion":"3.8.9","_nodeVersion":"4.4.4","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"dist":{"shasum":"870d07116ec75c4d32dab82a055139328bcd65b5","size":351254,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.1.3.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interface-connection-0.1.3.tgz_1466073947768_0.9242575541138649"},"directories":{},"publish_time":1466073948792,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1466073948792,"_cnpmcore_publish_time":"2021-12-16T11:27:00.675Z"},"0.1.2":{"name":"interface-connection","version":"0.1.2","description":"A test suite and interface you can use to implement a connection interface.","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"duplexify":"^3.4.3","timed-tape":"^0.1.0"},"devDependencies":{"aegir":"^3.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"}],"gitHead":"16a8cdac6f6b13e4c39629a118ffb94ef6bae0b7","_id":"interface-connection@0.1.2","_shasum":"b96340c01f260b0016f99bccaf1a43454ef6e0f2","_from":".","_npmVersion":"3.8.9","_nodeVersion":"4.4.4","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"dist":{"shasum":"b96340c01f260b0016f99bccaf1a43454ef6e0f2","size":351227,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.1.2.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interface-connection-0.1.2.tgz_1466073854099_0.6182032208889723"},"directories":{},"publish_time":1466073855093,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1466073855093,"_cnpmcore_publish_time":"2021-12-16T11:27:02.196Z"},"0.1.1":{"name":"interface-connection","version":"0.1.1","description":"A test suite and interface you can use to implement a connection interface.","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"duplexify":"^3.4.3","timed-tape":"^0.1.0"},"devDependencies":{"aegir":"^3.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"}],"gitHead":"16a8cdac6f6b13e4c39629a118ffb94ef6bae0b7","_id":"interface-connection@0.1.1","_shasum":"e74c17e0404a736fd7ddf8774db73945fd7e4ccd","_from":".","_npmVersion":"3.8.9","_nodeVersion":"4.4.4","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"dist":{"shasum":"e74c17e0404a736fd7ddf8774db73945fd7e4ccd","size":351250,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.1.1.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interface-connection-0.1.1.tgz_1466073405239_0.8731721490621567"},"directories":{},"publish_time":1466073406263,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1466073406263,"_cnpmcore_publish_time":"2021-12-16T11:27:03.373Z"},"0.1.0":{"name":"interface-connection","version":"0.1.0","description":"A test suite and interface you can use to implement a connection interface.","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"exit 0","release":"aegir-release","release-minor":"aegir-release --type minor","release-major":"aegir-release --type major"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"duplexify":"^3.4.3","timed-tape":"^0.1.0"},"devDependencies":{"aegir":"^3.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"}],"gitHead":"16a8cdac6f6b13e4c39629a118ffb94ef6bae0b7","_id":"interface-connection@0.1.0","_shasum":"aca83f8abb0f0575433c4b244bc82fe92e103ddc","_from":".","_npmVersion":"3.8.9","_nodeVersion":"4.4.4","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"dist":{"shasum":"aca83f8abb0f0575433c4b244bc82fe92e103ddc","size":351250,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.1.0.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interface-connection-0.1.0.tgz_1466072483018_0.5446253223344684"},"directories":{},"publish_time":1466072484052,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1466072484052,"_cnpmcore_publish_time":"2021-12-16T11:27:04.433Z"},"0.0.3":{"name":"interface-connection","version":"0.0.3","description":"A test suite and interface you can use to implement a connection interface.","repository":{"type":"git","url":"git+https://github.com/diasdavid/interface-connection.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/interface-connection/issues"},"homepage":"https://github.com/diasdavid/interface-connection","dependencies":{"timed-tape":"^0.1.0"},"gitHead":"0f710752d976853e44449df758b4ff7b8d19541f","_id":"interface-connection@0.0.3","scripts":{},"_shasum":"95097ac4f46cdf2ae0f0e0b5126174ebca75c141","_from":".","_npmVersion":"3.3.10","_nodeVersion":"4.2.1","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"95097ac4f46cdf2ae0f0e0b5126174ebca75c141","size":70393,"noattachment":false,"key":"/interface-connection/-/interface-connection-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-connection/download/interface-connection-0.0.3.tgz"},"directories":{},"publish_time":1449895137201,"_hasShrinkwrap":false,"deprecated":"This is now part of the https://www.npmjs.com/package/libp2p-interfaces module","_cnpm_publish_time":1449895137201,"_cnpmcore_publish_time":"2021-12-16T11:27:05.088Z"}},"readme":"interface-connection\n==================\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)\n[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)\n[![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)\n[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)\n[![](https://img.shields.io/codecov/c/github/libp2p/interface-connection.svg?style=flat-square)](https://codecov.io/gh/libp2p/interface-connection)\n[![](https://img.shields.io/travis/libp2p/interface-connection.svg?style=flat-square)](https://travis-ci.com/libp2p/interface-connection)\n[![Dependency Status](https://david-dm.org/libp2p/interface-connection.svg?style=flat-square)](https://david-dm.org/libp2p/interface-connection)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n\nThis is a test suite and interface you can use to implement a connection. The connection interface contains all the metadata associated with it, as well as an array of the streams opened through this connection. In the same way as the connection, a stream contains properties with its metadata, plus an iterable duplex object that offers a mechanism for writing and reading data, with back pressure. This module and test suite were heavily inspired by abstract-blob-store and interface-stream-muxer.\n\nThe primary goal of this module is to enable developers to pick, swap or upgrade their connection without losing the same API expectations and mechanisms such as back pressure and the ability to half close a connection.\n\nPublishing a test suite as a module lets multiple modules ensure compatibility since they use the same test suite.\n\n## Lead Maintainer\n\n[Jacob Heun](https://github.com/jacobheun/)\n\n## Usage\n\n### Connection\n\nBefore creating a connection from a transport compatible with `libp2p` it is important to understand some concepts:\n\n- **socket**: the underlying raw duplex connection between two nodes. It is created by the transports during a dial/listen.\n- **[multiaddr connection](https://github.com/libp2p/interface-transport#multiaddrconnection)**: an abstraction over the socket to allow it to work with multiaddr addresses. It is a duplex connection that transports create to wrap the socket before passing to an upgrader that turns it into a standard connection (see below).\n- **connection**: a connection between two _peers_ that has built in multiplexing and info about the connected peer. It is created from a [multiaddr connection](https://github.com/libp2p/interface-transport#multiaddrconnection) by an upgrader. The upgrader uses multistream-select to add secio and multiplexing and returns this object.\n- **stream**: a muxed duplex channel of the `connection`. Each connection may have many streams.\n\nA connection stands for the libp2p communication duplex layer between two nodes. It is **not** the underlying raw transport duplex layer (socket), such as a TCP socket, but an abstracted layer that sits on top of the raw socket.\n\nThis helps ensuring that the transport is responsible for socket management, while also allowing the application layer to handle the connection management.\n\n### Test suite\n\n#### JS\n\n```js\ndescribe('your connection', () => {\n  require('interface-connection/src/tests')({\n    async setup () {\n      return YourConnection\n    },\n    async teardown () {\n      // cleanup resources created by setup()\n    }\n  })\n})\n```\n\n#### Go\n\n> WIP\n\n## API\n\n### Connection\n\nA valid connection (one that follows this abstraction), must implement the following API:\n\n- type: `Connection`\n```js\nnew Connection({\n  localAddr,\n  remoteAddr,\n  localPeer,\n  remotePeer,\n  newStream,\n  close,\n  getStreams,\n  stat: {\n    direction,\n    timeline: {\n      open,\n      upgraded\n    },\n    multiplexer,\n    encryption\n  }\n})\n```\n  - `<Multiaddr> conn.localAddr`\n  - `<Multiaddr> conn.remoteAddr`\n  - `<PeerId> conn.localPeer`\n  - `<PeerId> conn.remotePeer`\n  - `<Object> conn.stat`\n  - `<Map> conn.registry`\n  - `Array<Stream> conn.streams`\n  - `Promise<object> conn.newStream(Array<protocols>)`\n  - `<void> conn.removeStream(id)`\n  - `<Stream> conn.addStream(stream, protocol, metadata)`\n  - `Promise<> conn.close()`\n\nIt can be obtained as follows:\n\n```js\nconst { Connection } = require('interface-connection')\n\nconst conn = new Connection({\n  localAddr: maConn.localAddr,\n  remoteAddr: maConn.remoteAddr,\n  localPeer: this._peerId,\n  remotePeer,\n  newStream,\n  close: err => maConn.close(err),\n  getStreams,\n  stats: {\n    direction: 'outbound',\n    timeline: {\n      open: maConn.timeline.open,\n      upgraded: Date.now()\n    },\n    multiplexer,\n    encryption\n  }\n})\n```\n\n#### Creating a connection instance\n\n- `JavaScript` - `const conn = new Connection({localAddr, remoteAddr, localPeer, remotePeer, newStream, close, getStreams, direction, multiplexer, encryption})`\n\nCreates a new Connection instance.\n\n`localAddr` is the [multiaddr](https://github.com/multiformats/multiaddr) address used by the local peer to reach the remote.\n`remoteAddr` is the [multiaddr](https://github.com/multiformats/multiaddr) address used to communicate with the remote peer.\n`localPeer` is the [PeerId](https://github.com/libp2p/js-peer-id) of the local peer.\n`remotePeer` is the [PeerId](https://github.com/libp2p/js-peer-id) of the remote peer.\n`newStream` is the `function` responsible for getting a new muxed+multistream-selected stream.\n`close` is the `function` responsible for closing the raw connection.\n`getStreams` is the `function` responsible for getting the streams muxed within the connection.\n`stats` is an `object` with the metadata of the connection. It contains:\n- `direction` is a `string` indicating whether the connection is `inbound` or `outbound`.\n- `timeline` is an `object` with the relevant events timestamps of the connection (`open`, `upgraded` and `closed`; the `closed` will be added when the connection is closed).\n- `multiplexer` is a `string` with the connection multiplexing codec (optional).\n- `encryption` is a `string` with the connection encryption method identifier (optional).\n\n#### Create a new stream\n\n- `JavaScript` - `conn.newStream(protocols)`\n\nCreate a new stream within the connection.\n\n`protocols` is an array of the intended protocol to use (by order of preference). Example: `[/echo/1.0.0]`\n\nIt returns a `Promise` with an object with the following properties:\n\n```js\n{\n  stream,\n  protocol\n}\n```\n\nThe stream property contains the muxed stream, while the protocol contains the protocol codec used by the stream.\n\n#### Add stream metadata\n\n- `JavaScript` - `conn.addStream(stream, { protocol, ...metadata })`\n\nAdd a new stream to the connection registry.\n\n`stream` is a muxed stream.\n`protocol` is the string codec for the protocol used by the stream. Example: `/echo/1.0.0`\n`metadata` is an object containing any additional, optional, stream metadata that you wish to track (such as its `tags`).\n\n#### Remove a from the registry\n\n- `JavaScript` - `conn.removeStream(id)`\n\nRemoves the stream with the given id from the connection registry.\n\n`id` is the unique id of the stream for this connection.\n\n\n#### Close connection\n\n- `JavaScript` - `conn.close()`\n\nThis method closes the connection to the remote peer, as well as all the streams muxed within the connection.\n\nIt returns a `Promise`.\n\n#### Connection identifier\n\n- `JavaScript` - `conn.id`\n\nThis property contains the identifier of the connection.\n\n#### Connection streams registry\n\n- `JavaScript` - `conn.registry`\n\nThis property contains a map with the muxed streams indexed by their id. This registry contains the protocol used by the stream, as well as its metadata.\n\n#### Remote peer\n\n- `JavaScript` - `conn.remotePeer`\n\nThis property contains the remote `peer-id` of this connection.\n\n#### Local peer\n\n- `JavaScript` - `conn.localPeer`\n\nThis property contains the local `peer-id` of this connection.\n\n#### Get the connection Streams\n\n- `JavaScript` - `conn.streams`\n\nThis getter returns all the muxed streams within the connection.\n\nIt returns an `Array`.\n\n#### Remote address\n\n- `JavaScript` - `conn.remoteAddr`\n\nThis getter returns the `remote` [multiaddr](https://github.com/multiformats/multiaddr) address.\n\n#### Local address\n\n- `JavaScript` - `conn.localAddr`\n\nThis getter returns the `local` [multiaddr](https://github.com/multiformats/multiaddr) address.\n\n#### Stat\n\n- `JavaScript` - `conn.stat`\n\nThis getter returns an `Object` with the metadata of the connection, as follows:\n\n- `status`:\n\nThis property contains the status of the connection. It can be either `open`, `closing` or `closed`. Once the connection is created it is in an `open` status. When a `conn.close()` happens, the status will change to `closing` and finally, after all the connection streams are properly closed, the status will be `closed`.\n\n- `timeline`:\n\nThis property contains an object with the `open`, `upgraded` and `close` timestamps of the connection. Note that, the `close` timestamp is `undefined` until the connection is closed.\n\n- `direction`:\n\nThis property contains the direction of the peer in the connection. It can be `inbound` or `outbound`.\n\n- `multiplexer`:\n\nThis property contains the `multiplexing` codec being used in the connection.\n\n- `encryption`:\n\nThis property contains the encryption method being used in the connection. It is `undefined` if the connection is not encrypted.\n\n#### Tags\n\n- `JavaScript` - `conn.tags`\n\nThis property contains an array of tags associated with the connection. New tags can be pushed to this array during the connection's lifetime.\n","_attachments":{},"homepage":"https://github.com/libp2p/interface-connection","bugs":{"url":"https://github.com/libp2p/interface-connection/issues"},"license":"MIT"}