Package Exports
- dat-link-resolve
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dat-link-resolve) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
dat-link-resolve
resolve urls, links to a dat key using common methods
Supports
- Common dat key representations (
dat://, etc.) - URLs with keys in them (
datproject.org/6161616161616161616161616161616161616161616161616161616161616161) hyperdrive-keyordat-keyheaders- Url to JSON http request that returns
{key: <dat-key>}
Install
npm install dat-link-resolveUsage
var datResolve = require('dat-link-resolve')
datResolve(link, function (err, key) {
console.log('found key', key)
})API
datResolve(link, callback(err, key))
Link can be string or buffer.
Resolution order:
- Validate buffers or any strings with 64 character hashes in them via dat-encoding
- Check headers in http request
- Check JSON request response for
key
Contributing
Contributions welcome! Please read the contributing guidelines first.