Decentralized Identity (DID) URI parser and formatter
npm install did-uridid-uri
=======
> I no longer work on Ara nor maintain https://github.com/AraBlocks/did-uri
> This fork is the cannonical and maintained repository for did-uri
Decentralized Identity (DID) URI parser and formatter.
In this module we provide a w3 compliant interface for parsing and serializing
Decentralized Identity (DID) URIs
as specified by Decentralized
Identifiers
specification. This module provides an interface similar to that of theurl module in the Node standard library.
``sh`
$ npm install did-uri
`js`
const did = require('did-uri')
const spec = did.parse('did:ara:68656c6c6f/music?key=mk706c6179206d65')
console.log(spec)
outputs:
`js`
{ reference: 'did:ara:68656c6c6f/music?key=mk706c6179206d65',
did: 'did:ara:68656c6c6f',
method: 'ara',
identifier: '68656c6c6f',
path: '/music',
fragment: '',
query: 'key=mk706c6179206d65',
param: '' }
Parses a given DID uri and returns an object similar to a DID
instance.
Formats a given DID URI or object into a normalized formatted URI.
Parses and creates a new DID instance.
#### did.reference
A reference to the uri that was parsed as input.
#### did.did
The component of the URI containing the protocol, method, and
identifier in the form of did:method:identifier.
#### did.method
The method component of the URI.
#### did.identifier
The identifier component of the URI.
#### did.param
The param (;) component of the URI.
#### did.path
The path component of the URI.
#### did.fragment
The fragment (#) component of the URI.
#### did.query
The query (?) component of the URI.
#### did.parameters
The param string component of the URI parsed into an object.
#### did.queryParameters
The query string component of the URI parsed into an object.
#### did.fragmentParameters
The fragment` string component of the URI parsed into an object.
* Decentralized Identity Spec
* Universal Resolver
* did-universal-resolver-driver
* did-universal-resolver-resolution
MIT