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

Fix docs for repo.gc() response format #492

Merged
merged 1 commit into from
Jul 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion SPEC/REPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ Where:
- `quiet` writes a minimal output.
- `stream-errors` stream errors.

`callback` must follow `function (err, res) {}` signature, where `err` is an Error if the operation was not successful.
`callback` must follow `function (err, res) {}` signature, where
- `err` is an Error if the whole GC operation was not successful.
- `res` is an array of objects that contains the following properties
- `err` is an Error if it was not possible to GC a particular block.
- `cid` is the [CID][cid] of the block that was Garbage Collected.

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

Expand Down Expand Up @@ -80,3 +84,4 @@ ipfs.repo.version((err, version) => console.log(version))
```

[1]: https://github.com/MikeMcl/bignumber.js/
[cid]: https://www.npmjs.com/package/cids