Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libp2p-utils

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libp2p-utils - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

API.md

23

CHANGELOG.md

@@ -0,1 +1,24 @@

<a name="0.2.1"></a>
## [0.2.1](https://github.com/libp2p/js-libp2p-utils/compare/v0.1.3...v0.2.1) (2020-10-08)
### Chores
* update deps ([#9](https://github.com/libp2p/js-libp2p-utils/issues/9)) ([a2ea68f](https://github.com/libp2p/js-libp2p-utils/commit/a2ea68f))
### Features
* is multiaddr private and loopback ([#10](https://github.com/libp2p/js-libp2p-utils/issues/10)) ([d7fa562](https://github.com/libp2p/js-libp2p-utils/commit/d7fa562))
### BREAKING CHANGES
* - The multiaddr dep of this module uses Uint8Arrays and may not be
compatible with previous versions
* chore: remove gh url
<a name="0.2.0"></a>

@@ -2,0 +25,0 @@ # [0.2.0](https://github.com/libp2p/js-libp2p-utils/compare/v0.1.3...v0.2.0) (2020-08-07)

13

package.json
{
"name": "libp2p-utils",
"version": "0.2.0",
"version": "0.2.1",
"description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem",

@@ -32,18 +32,21 @@ "leadMaintainer": "Vasco Santos <santos.vasco10@gmail.com>",

"devDependencies": {
"aegir": "^25.0.0",
"aegir": "^27.0.0",
"it-pair": "^1.0.0",
"it-pipe": "^1.1.0",
"streaming-iterables": "^5.0.2"
"streaming-iterables": "^5.0.3"
},
"dependencies": {
"abortable-iterator": "^3.0.0",
"debug": "^4.1.1",
"debug": "^4.2.0",
"err-code": "^2.0.3",
"ip-address": "^6.1.0",
"multiaddr": "^8.0.0"
"is-loopback-addr": "^1.0.0",
"multiaddr": "^8.0.0",
"private-ip": "^1.0.5"
},
"contributors": [
"Vasco Santos <vasco.santos@moxy.studio>",
"Jacob Heun <jacobheun@gmail.com>",
"Alex Potsides <alex@achingbrain.net>"
]
}

@@ -41,2 +41,4 @@ # js-libp2p-utils

You can check the [API docs](./API.md).
## Contribute

@@ -43,0 +45,0 @@

@@ -5,3 +5,4 @@ 'use strict'

* Verify if two arrays of non primitive types with the "equals" function are equal.
* Compatible with multiaddr, peer-id and Buffer.
* Compatible with multiaddr, peer-id and others.
*
* @param {Array<*>} a

@@ -8,0 +9,0 @@ * @param {Array<*>} b

@@ -13,3 +13,9 @@ 'use strict'

module.exports = (ip, port) => {
/**
* Transform an IP, Port pair into a multiaddr
*
* @param {string} ip
* @param {number|string} port
*/
function ipPortToMultiaddr (ip, port) {
if (typeof ip !== 'string') {

@@ -40,2 +46,4 @@ throw errCode(new Error(`invalid ip provided: ${ip}`), errors.ERR_INVALID_IP_PARAMETER)

module.exports = ipPortToMultiaddr
module.exports.Errors = errors

@@ -6,5 +6,14 @@ 'use strict'

// Convert a duplex iterable into a MultiaddrConnection
// https://github.com/libp2p/interface-transport#multiaddrconnection
module.exports = ({ stream, remoteAddr, localAddr }, options = {}) => {
/**
* Convert a duplex iterable into a MultiaddrConnection.
* https://github.com/libp2p/interface-transport#multiaddrconnection
*
* @param {object} streamProperties
* @param {DuplexStream} streamProperties.stream
* @param {Multiaddr} streamProperties.remoteAddr
* @param {Multiaddr} streamProperties.localAddr
* @param {object} [options]
* @param {AbortSignal} [options.signal]
*/
function streamToMaConnection ({ stream, remoteAddr, localAddr }, options = {}) {
const { sink, source } = stream

@@ -51,1 +60,3 @@ const maConn = {

}
module.exports = streamToMaConnection
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc