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

mafmt

Package Overview
Dependencies
Maintainers
3
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mafmt

A multiaddr validator

  • 6.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26K
increased by3.38%
Maintainers
3
Weekly downloads
 
Created
Source

js-mafmt

Coverage Status Travis CI Circle CI Dependency Status js-standard-style

Javascript implementation of multiaddr validation

Install

npm install mafmt

Usage

const mafmt = require('msfmt')

mafmt.DNS.matches('/dns4/ipfs.io') // true

API

mafmt.<FORMAT>.matches(multiaddr)

Where <FORMAT> may be:

<FORMAT>DescriptionExample(s)
DNSa "dns4" or "dns6" format multiaddr/dnsaddr/ipfs.io
DNS4a "dns4" format multiaddr/dns4/ipfs.io
DNS6a "dns6" format multiaddr/dns6/protocol.ai/tcp/80
IPan "ip4" or "ip6" format multiaddr/ip4/127.0.0.1
/ip6/fc00::
TCPa "tcp" over IP format multiaddr/ip4/0.0.7.6/tcp/1234
UDPa "udp" over IP format multiaddr/ip4/0.0.7.6/udp/1234
UTPa "utp" over UDP format multiaddr/ip4/1.2.3.4/udp/3456/utp
Websocketsa "ws" over TCP or "ws" over DNS format multiaddr/ip4/1.2.3.4/tcp/3456/ws
/dnsaddr/ipfs.io/ws
WebSocketsSecurea "wss" over TCP or "wss" over DNS format multiaddr/ip6/::/tcp/0/wss
/dnsaddr/ipfs.io/wss
HTTPa "http" over TCP or DNS or "http" over DNS format multiaddr/ip4/127.0.0.1/tcp/90/http/baz.jpg
/dnsaddr/ipfs.io/http/baz.jpg
WebRTCStaran "ipfs" over "p2p-webrtc-star" over Websockets or "ipfs" over "p2p-webrtc-star" over WebSocketsSecure format multiaddr/dnsaddr/ipfs.io/wss/p2p-webrtc-star/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4
WebSocketStaran "ipfs" over "p2p-websocket-star" over Websockets or "ipfs" over "p2p-websocket-star" over WebSocketsSecure or "p2p-websocket-star" over Websockets or "p2p-websocket-star" over WebSocketsSecure format multiaddr/ip4/1.2.3.4/tcp/3456/ws/p2p-websocket-star
/dnsaddr/localhost/ws/p2p-websocket-star/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4
WebRTCDirecta "p2p-webrtc-direct" over HTTP format multiaddr/ip4/1.2.3.4/tcp/3456/http/p2p-webrtc-direct
Reliablea WebSockets or WebSocketsSecure or HTTP or WebRTCStar or WebRTCDirect or TCP or UTP format multiaddr/dnsaddr/ipfs.io/wss
Circuit/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4/p2p-circuit/ipfs/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj
IPFS"ipfs" over Reliable or WebRTCStar or "ipfs" format multiaddr/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4
/ip4/127.0.0.1/tcp/20008/ws/ipfs/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj

Where multiaddr may be:

Returns true/false

Keywords

FAQs

Package last updated on 05 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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