-
Notifications
You must be signed in to change notification settings - Fork 10
dWeb URL Parsing
Jared Rice Sr edited this page Jun 28, 2018
·
1 revision
Parsing Library For dWeb URLs (dweb://)
var dWebUrlParse = require('@dwebs/parse')
dWebUrlParse('dweb://584faa05d394190ab1a3f0240607f9bf2b7e2bd9968830a11cf77db0cea36a21+v1.0.0/path/to/file.txt')
/* => {
protocol: 'dweb:',
slashes: true,
auth: null,
host: '584faa05d394190ab1a3f0240607f9bf2b7e2bd9968830a11cf77db0cea36a21',
port: null,
hostname: '584faa05d394190ab1a3f0240607f9bf2b7e2bd9968830a11cf77db0cea36a21',
hash: null,
search: null,
query: null,
pathname: '/path/to/file.txt',
path: '/path/to/file.txt',
href: 'dweb://584faa05d394190ab1a3f0240607f9bf2b7e2bd9968830a11cf77db0cea36a21+v1.0.0/path/to/file.txt',
version: 'v1.0.0'
}*/