UNPKG

ipfs

Version:

JavaScript implementation of the IPFS specification

25 lines (18 loc) 530 B
'use strict' const { print, isDaemonOn } = require('../../utils') module.exports = { command: 'rm <key>', describe: 'Remove a raw IPFS block', builder: {}, handler ({ getIpfs, key, resolve }) { resolve((async () => { if (isDaemonOn()) { // TODO implement this once `js-ipfs-http-client` supports it throw new Error('rm block with daemon running is not yet implemented') } const ipfs = await getIpfs() await ipfs.block.rm(key) print('removed ' + key) })()) } }