UNPKG

ipfs

Version:

JavaScript implementation of the IPFS specification

30 lines (24 loc) 601 B
'use strict' const print = require('../../utils').print module.exports = { command: 'stat', describe: 'Get stats for the currently used repo', builder: { human: { type: 'boolean', default: false } }, handler (argv) { argv.resolve((async () => { const ipfs = await argv.getIpfs() const stats = await ipfs.repo.stat({ human: argv.human }) print(`repo status number of objects: ${stats.numObjects} repo size: ${stats.repoSize} repo path: ${stats.repoPath} version: ${stats.version} maximum storage: ${stats.storageMax}`) })()) } }