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

Commit

Permalink
fix: repo.gc() response format (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc authored and alanshaw committed Jul 10, 2019
1 parent 666ccba commit a2ec3f6
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit a2ec3f6

Please sign in to comment.