{"name":"did-resolver","version":"0.0.6-alpha5","description":"Resolve DID documents","main":"lib/resolver.js","types":"lib/resolver.d.ts","repository":{"type":"git","url":"git+https://github.com/uport-project/did-resolver.git"},"author":{"name":"Pelle Braendgaard","email":"pelle.braendgaard@consensys.net"},"license":"MIT","scripts":{"build":"tsc","test":"jest","dev":"tsc --watch","format":"prettier"},"devDependencies":{"@types/jest":"^23.3.10","@types/node":"^10.12.18","jest":"^23.6.0","prettier":"^1.15.3","regenerator-runtime":"^0.12.1","ts-jest":"^23.10.5","tslint":"^5.12.0","tslint-config-prettier":"^1.17.0","tslint-eslint-rules":"^5.4.0","typescript":"^3.2.2"},"jest":{"transform":{"^.+\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json"],"coverageDirectory":"./coverage/","collectCoverageFrom":["src/**/*.{ts,tsx}","!src/**/*.d.ts","!**/node_modules/**"]},"readme":"# Javascript DID Resolver\n\nThis library is intended as a simple common interface for javascript applications to resolve DID documents from Decentralized Identifiers (DIDs).\n\nThis is intended to support the proposed [Decentralized Identifiers](https://w3c-ccg.github.io/did-spec/) spec from the [W3C Credentials Community Group](https://w3c-ccg.github.io).\n\nThe library does not implement any specific DID method, but allows DID method implementors to release npm packages that applications can add.\n\n## Resolving a DID document\n\nThe resolver presents a simple `resolver()` function that returns a ES6 Promise returning the DID document.\n\n```js\nimport resolve from 'did-resolver'\n\nresolve('did:uport:2nQtiQG6Cgm1GYTBaaKAgr76uY7iSexUkqX/some/path#fragment=123').then(doc => console.log)\n\n// You can also use ES7 async/await syntax\nconst doc = await resolve('did:uport:2nQtiQG6Cgm1GYTBaaKAgr76uY7iSexUkqX/some/path#fragment=123')\n```\n\n## Implementing a DID method\n\nEach DID method will have it's own methods for looking up an identifier on it's respective blockchain or other decentralized storage mechanism.\n\nA method implementer calls the `registerMethod('methodname', resolver)`. where `methodname` is the method identifier. The resolver is a function that receives a DID and a parsed version of the DID. It returns a ES6 Promise that looks up the DID document.\n\n```js\nimport { registerMethod } from 'did-resolver'\nregisterMethod('mymethod', (did, parsed) => new Promise(resolve, reject) => {\n  console.log(parsed)\n  // {method: 'mymethod', id: 'abcdefg', did: 'did:mymethod:abcdefg/some/path#fragment=123', path: '/some/path', fragment: 'fragment=123'}\n  const didDoc = ...// lookup doc\n  resolve(didDoc)\n})\n```\n\nThe method resolver should register this so that just requiring it will register the method:\n\n```js\nimport resolve from 'did-resolver'\nimport MyMethod from 'mymethod-did-resolver'\n\nresolve('did:mymethod:abcdefg/some/path#fragment=123').then(doc => console.log)\n```\n\n","readmeFilename":"README.md","gitHead":"029202bad15f9bf6f501fdc4498633cf8479c799","bugs":{"url":"https://github.com/uport-project/did-resolver/issues"},"homepage":"https://github.com/uport-project/did-resolver#readme","_id":"did-resolver@0.0.6-alpha5","_npmVersion":"6.4.1","_nodeVersion":"11.5.0","_npmUser":{"name":"pelleb","email":"pelleb@gmail.com"},"dist":{"integrity":"sha512-pg8Pex2Kze3HmFKhwngw488Fmo/lcPB3gOgnQT0qCbiCr7VLQgQ7jo+XTjiod1Ta4TwFZhfK9VxDXckXigZJPw==","shasum":"8f79a117dd2cf5e1bf9322f6eb93f13f43df5c3e","tarball":"http://registry-npm.ywwl.com/did-resolver/download/did-resolver-0.0.6-alpha5.tgz","fileCount":9,"unpackedSize":21342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJC84CRA9TVsSAnZWagAASAcP/iiP9g0Mt4eb5WoW5R9U\n/4nltRVZisk51ww+JfOIZQVNdnyIMyjeUH2sd0WTxBktPxn8dz2K/MlWmnD/\nQ1AM+7RM+6IW9j4iDl13XzLW7A8XELtD4GozDWqzfvUyyK7mqfkP1xB1IRNh\nX+kTuD/aV21ajQyVC3Yq+jwU4E5DMjWf4apf5dwHj6V8aqyddnMGwnduXYeE\nDu60nJbctP6qIja4Zp1K8EdHkF42zZ8PvCbfQaVtqrwguvRz7eSu5HPeP1wl\nA2X0Hs+C7U395E0x9YtZuePGdk//MCNbOk5QKiZ/c2DX3M7d/R7MTmYB0XrW\nWmDpYV/zZyJmUXeARMsHxGDfLgO9lKZTWL0ugRrFhds3MpvAKp0Z4oAKhY6Y\nTMPf02FAdRgmOUi6h5mFBTtwVy4OTetpQ4W7JfCNfZ1dmcXhcmQdKcN1wQty\nyGNw3BahD89TPOMxDg1k+tb68btOj2Kq3IeTguh5EEeGcZdB+0pPY1Sds+t4\nfzuPCD4OBjopxw6zAJVFpsh31veFpgmVacEyEg36r9tJ7fhcJT3+RnssGxl1\nCQgvMYP3jgzE1IBxEyRDgEzH+4DYoT+t3kYYVf570QEOE0Rn2lVl1WBAlFH5\nuhJKg2cboFjM8QK0Yrbs+d8J9KsijzgIV+VtJBSdrQA3wJi/5WKhfXeI6TGK\n50y4\r\n=GGiV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH1WBYQyHVZtAesWm5P8bc4TL56io3OCo4c4X5uOtP3cAiA7O49InwslijJrrpao8S74zgmrXj9Ips5oRLK+l/z/6g=="}],"size":6113,"noattachment":false,"key":"/did-resolver/-/did-resolver-0.0.6-alpha5.tgz"},"maintainers":[{"name":"pelleb","email":"pelleb@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/did-resolver_0.0.6-alpha5_1545875255621_0.17964348082644066"},"_hasShrinkwrap":false,"publish_time":1545875255743,"_cnpm_publish_time":1545875255743,"dist-tags":{"alpha":"0.0.7-alpha.0","latest":"6.0.0","preview":"5.0.0-feat-publishing-maintenance.1"}}