UNPKG

ipfs

Version:

JavaScript implementation of the IPFS specification

29 lines (24 loc) 561 B
'use strict' const print = require('../utils').print module.exports = { command: 'dns <domain>', describe: 'Resolve DNS links', builder: { recursive: { type: 'boolean', default: true, alias: 'r', desc: 'Resolve until the result is not a DNS link' }, format: { type: 'string' } }, handler ({ getIpfs, domain, resolve, recursive, format }) { resolve((async () => { const ipfs = await getIpfs() const path = await ipfs.dns(domain, { recursive, format }) print(path) })()) } }