Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hackergrrl/ssb-web-resolver
https://github.com/hackergrrl/ssb-web-resolver
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hackergrrl/ssb-web-resolver
- Owner: hackergrrl
- Created: 2018-04-16T20:17:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-30T02:00:09.000Z (about 6 years ago)
- Last Synced: 2024-05-13T16:25:56.456Z (6 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ssb-web-resolver
> resolve an ssb-web url
## Usage
```js
var resolve = require('ssb-web-resolver')var url = '%257OUHcZna%2FwRjbWZuxsDOuYeimiYI82rps56ewppYriE%3D.sha256/index.html'
var components = url.split('/')
resolve(sbot, components, function (err, content) {
if (err) throw err
console.log(content)
})
```outputs
```
Austin's Site
...
```## API
```js
var resolve = require('ssb-web-resolver')
```### resolve(sbot, urlComponents, cb)
Recursively resolves a set of SSB url components to raw blob data. Expects the
URL to be URL-encoded.eg. If the raw URL was
`%7OUHcZna/wRjbWZuxsDOuYeimiYI82rps56ewppYriE=.sha256/index.html`, you would
pass `['%257OUHcZna%2FwRjbWZuxsDOuYeimiYI82rps56ewppYriE%3D.sha256',
'index.html']` into `urlComponents`.## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install ssb-web-resolver
```## License
ISC