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

Commit a22c791

Browse files
author
Alan Shaw
authored
feat: add cid command (#1560)
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 <[email protected]>
1 parent 03aeec9 commit a22c791

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"boom": "^7.2.0",
9393
"bs58": "^4.0.1",
9494
"byteman": "^1.3.5",
95+
"cid-tool": "~0.1.0",
9596
"cids": "~0.5.3",
9697
"debug": "^3.1.0",
9798
"err-code": "^1.1.2",

src/cli/commands/cid.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict'
2+
3+
const path = require('path')
4+
5+
const cidCommandsPath = path.join(
6+
__dirname, '..', '..', '..', 'node_modules', 'cid-tool', 'src', 'cli', 'commands'
7+
)
8+
9+
module.exports = {
10+
command: 'cid <command>',
11+
12+
description: 'Convert, format and discover properties of CIDs.',
13+
14+
builder (yargs) {
15+
return yargs
16+
.commandDir(cidCommandsPath)
17+
},
18+
19+
handler (argv) {
20+
}
21+
}

test/cli/commands.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
const expect = require('chai').expect
55
const runOnAndOff = require('../utils/on-and-off')
66

7-
const commandCount = 81
7+
const commandCount = 82
88
describe('commands', () => runOnAndOff((thing) => {
99
let ipfs
1010

0 commit comments

Comments
 (0)