Comparing version 4.0.0 to 6.0.0
@@ -0,1 +1,11 @@ | ||
<a name="6.0.0"></a> | ||
# [6.0.0](https://github.com/whyrusleeping/js-mafmt/compare/v4.0.0...v6.0.0) (2018-04-05) | ||
<a name="5.0.0"></a> | ||
# [5.0.0](https://github.com/whyrusleeping/js-mafmt/compare/v4.0.0...v5.0.0) (2018-04-05) | ||
<a name="4.0.0"></a> | ||
@@ -2,0 +12,0 @@ # [4.0.0](https://github.com/whyrusleeping/js-mafmt/compare/v3.1.0...v4.0.0) (2018-02-12) |
{ | ||
"name": "mafmt", | ||
"version": "4.0.0", | ||
"version": "6.0.0", | ||
"description": "A multiaddr validator", | ||
@@ -36,3 +36,3 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"aegir": "^12.4.0", | ||
"aegir": "^13.0.6", | ||
"chai": "^4.1.2", | ||
@@ -42,5 +42,6 @@ "pre-commit": "^1.2.2" | ||
"dependencies": { | ||
"multiaddr": "^3.0.2" | ||
"multiaddr": "^4.0.0" | ||
}, | ||
"contributors": [ | ||
"Alan Shaw <alan@tableflip.io>", | ||
"David Dias <daviddias.p@gmail.com>", | ||
@@ -47,0 +48,0 @@ "Jeromy <jeromyj@gmail.com>", |
@@ -13,1 +13,49 @@ js-mafmt | ||
> Javascript implementation of multiaddr validation | ||
## Install | ||
```sh | ||
npm install mafmt | ||
``` | ||
## Usage | ||
```js | ||
const mafmt = require('msfmt') | ||
mafmt.DNS.matches('/dns4/ipfs.io') // true | ||
``` | ||
## API | ||
#### `mafmt.<FORMAT>.matches(multiaddr)` | ||
Where `<FORMAT>` may be: | ||
| `<FORMAT>` | Description | Example(s) | | ||
| --- | --- | --- | | ||
| `DNS` | a "dns4" or "dns6" format multiaddr | `/dnsaddr/ipfs.io` | ||
| `DNS4` | a "dns4" format multiaddr | `/dns4/ipfs.io` | | ||
| `DNS6` | a "dns6" format multiaddr | `/dns6/protocol.ai/tcp/80` | | ||
| `IP` | an "ip4" or "ip6" format multiaddr | `/ip4/127.0.0.1` <br> `/ip6/fc00::` | | ||
| `TCP` | a "tcp" over `IP` format multiaddr | `/ip4/0.0.7.6/tcp/1234` | | ||
| `UDP` | a "udp" over `IP` format multiaddr | `/ip4/0.0.7.6/udp/1234` | | ||
| `UTP` | a "utp" over `UDP` format multiaddr | `/ip4/1.2.3.4/udp/3456/utp` | | ||
| `Websockets` | a "ws" over `TCP` or "ws" over `DNS` format multiaddr | `/ip4/1.2.3.4/tcp/3456/ws` <br> `/dnsaddr/ipfs.io/ws` | | ||
| `WebSocketsSecure` | a "wss" over `TCP` or "wss" over `DNS` format multiaddr | `/ip6/::/tcp/0/wss` <br> `/dnsaddr/ipfs.io/wss` | | ||
| `HTTP` | a "http" over `TCP` or `DNS` or "http" over `DNS` format multiaddr | `/ip4/127.0.0.1/tcp/90/http/baz.jpg` <br> `/dnsaddr/ipfs.io/http/baz.jpg` | | ||
| `WebRTCStar` | an "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` | | ||
| `WebSocketStar` | an "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` <br> `/dnsaddr/localhost/ws/p2p-websocket-star/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4` | | ||
| `WebRTCDirect` | a "p2p-webrtc-direct" over `HTTP` format multiaddr | `/ip4/1.2.3.4/tcp/3456/http/p2p-webrtc-direct` | | ||
| `Reliable` | a `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` <br> `/ip4/127.0.0.1/tcp/20008/ws/ipfs/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj` | | ||
| | | | | ||
Where `multiaddr` may be: | ||
* a [Multiaddr](https://www.npmjs.com/package/multiaddr) | ||
* a String | ||
* a [Buffer](https://www.npmjs.com/package/buffer) | ||
Returns `true`/`false` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
657182
61
+ Addedclass-is@1.1.0(transitive)
+ Addedip-address@5.9.4(transitive)
+ Addedjsbn@1.1.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmultiaddr@4.0.0(transitive)
+ Addedsprintf-js@1.1.2(transitive)
- Removedmultiaddr@3.1.0(transitive)
Updatedmultiaddr@^4.0.0