Releases: multiformats/js-multiaddr
Releases · multiformats/js-multiaddr
v10.1.1
v10.1.0
v10.0.1
chore: release version v10.0.1
v10.0.0
v9.0.2
chore: release version v9.0.2
v9.0.1
v9.0.0
Features
BREAKING CHANGES
- entry point uses named exports
// before
const multiaddr = require('multiaddr')
multiaddr.resolvers
multiaddr.protocols
// after
const {multiaddr , Multiaddr, protocols, resolvers} = = require('multiaddr')
Multiaddr.resolvers
Multiaddr.protocols
- Multiaddr is a normal class now
toOptions
output changed to match node
// before
multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions()
{ family: 'ipv4', host: '127.0.0.1', transport: 'tcp', port: 4001 }
// after
new Multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions()
{ family: 4, host: '127.0.0.1', transport: 'tcp', port: 4001 }
fromNodeAddress
andnodeAddress
inputs/outputs now match
// before the family type was not the same between them
multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress()
{family: 4, address: '127.0.0.1', port: '4001'}
multiaddr.fromNodeAddress({family: 'IPv4', address: '127.0.0.1', port: '4001'}, 'tcp')
<Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>
// after
new Multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress()
{family: 4, address: '127.0.0.1', port: 4001}
Multiaddr.fromNodeAddress({family: 4, address: '127.0.0.1', port: '4001'}, 'tcp')
<Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>