Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
feat: add cid command (#1560)
Browse files Browse the repository at this point in the history
This PR adds a `jsipfs cid` command with tools for formatting, converting and discovering properties of CIDs.

All the docs are here: https://github.com/ipfs-shipyard/js-cid-tool
Will resolve this for JS: ipfs/kubo#5229
go-ipfs counterpart: ipfs/kubo#5385

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
Alan Shaw authored Oct 17, 2018
1 parent 03aeec9 commit a22c791
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"boom": "^7.2.0",
"bs58": "^4.0.1",
"byteman": "^1.3.5",
"cid-tool": "~0.1.0",
"cids": "~0.5.3",
"debug": "^3.1.0",
"err-code": "^1.1.2",
Expand Down
21 changes: 21 additions & 0 deletions src/cli/commands/cid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict'

const path = require('path')

const cidCommandsPath = path.join(
__dirname, '..', '..', '..', 'node_modules', 'cid-tool', 'src', 'cli', 'commands'
)

module.exports = {
command: 'cid <command>',

description: 'Convert, format and discover properties of CIDs.',

builder (yargs) {
return yargs
.commandDir(cidCommandsPath)
},

handler (argv) {
}
}
2 changes: 1 addition & 1 deletion test/cli/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const expect = require('chai').expect
const runOnAndOff = require('../utils/on-and-off')

const commandCount = 81
const commandCount = 82
describe('commands', () => runOnAndOff((thing) => {
let ipfs

Expand Down

0 comments on commit a22c791

Please sign in to comment.