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

docs: update block rm description #544

Merged
merged 1 commit into from
Oct 21, 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
9 changes: 4 additions & 5 deletions SPEC/BLOCK.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,11 @@ A great source of [examples][] can be found in the tests for this API.
- force (boolean): Ignores nonexistent blocks.
- quiet (boolean): write minimal output

`callback` must follow `function (err, result) {}` signature, where `err` is an error if the operation was not successful and `result` is an object, containing hash and error strings.
`callback` must follow `function (err, result) {}` signature, where `err` is an error if the operation was not successful and `result` is a list of objects, containing hash and (potentially) error strings.

If no `callback` is passed, a promise is returned.
If an error string is present for a given object in `result`, the block with that hash was not removed and the string will contain the reason why, for example if the block was pinned.

NOTE: If the specified block is pinned it won't be removed and no error
will be returned
If no `callback` is passed, a promise is returned.

**Example:**

Expand All @@ -139,7 +138,7 @@ ipfs.block.rm(cid, function (err, result) {
if (err) {
throw err
}
console.log(result.hash)
console.log(result[0].hash)
})
```

Expand Down