Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 59a45d0

Browse files
committed
feat(pinning): add pin.ls + rm spec
1 parent fa784b3 commit 59a45d0

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

API/pinning-api/README.md

+22-7
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,49 @@ Example:
2525
ipfs.pin.add(hash, function (err) {})
2626
```
2727

28-
2928
#### `ls`
3029

31-
>
30+
> List all the objects pinned to local storage or under a specific hash.
3231
3332
##### `Go` **WIP**
3433

35-
##### `JavaScript` - ipfs.SOMETHING(data, [callback])
34+
##### `JavaScript` - ipfs.pin.ls([hash, options, callback])
3635

37-
`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of:
36+
Where:
37+
38+
- `hash` is an IPFS multihash.
39+
- `options` is an object that can contain the following keys:
40+
- `type` - Return also the type of pin (direct, indirect or recursive)
41+
42+
`callback` must follow `function (err, pinset) {}` signature, where `err` is an error if the operation was not successful. `pinset` is an array of objects with keys `hash` and `type`.
3843

3944
If no `callback` is passed, a promise is returned.
4045

4146
Example:
4247

48+
```JavaScript
49+
ipfs.pin.ls(function (err, pinset) {})
50+
```
4351

4452

4553
#### `rm`
4654

47-
>
55+
> Remove an hash from the pinset
4856
4957
##### `Go` **WIP**
5058

51-
##### `JavaScript` - ipfs.SOMETHING(data, [callback])
59+
##### `JavaScript` - ipfs.pin.rm(hash, [callback])
60+
61+
Where `hash` is a multihash.
5262

53-
`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of:
63+
`callback` must follow `function (err) {}` signature, where `err` is an error if the operation was not successful.
5464

5565
If no `callback` is passed, a promise is returned.
5666

5767
Example:
5868

69+
```JavaScript
70+
ipfs.pin.rm(hash, function (err, pinset) {})
71+
```
72+
73+

0 commit comments

Comments
 (0)