You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
Adds a `.pins` datastore to `ipfs-repo` and uses that to store pins as cbor
binary keyed by base64 stringified multihashes (n.b. not CIDs).
Each pin has several fields:
```javascript
{
cid: // buffer, the full CID pinned
type: // string, 'recursive' or 'direct'
comments: // string, human-readable comments for the pin
}
```
BREAKING CHANGES:
* pins are now stored in a datastore, a repo migration will be necessary
* ipfs.pins.add now returns an async generator
* ipfs.pins.rm now returns an async generator
Depends on:
- [ ] ipfs/js-ipfs-repo#221
-`timeout` (`number`|`string`) - Throw an error if the request does not complete within the specified milliseconds timeout. If `timeout` is a string, the value is parsed as a [human readable duration](https://www.npmjs.com/package/parse-duration). There is no timeout by default.
@@ -21,9 +21,9 @@ Where:
21
21
22
22
| Type | Description |
23
23
| -------- | -------- |
24
-
|`Promise<{ cid: CID }>`| An array of objects that represent the files that were pinned |
24
+
|`AsyncIterable<CID>`| An async iterable that yields objects containing the CIDs that were pinned |
25
25
26
-
an array of objects is returned, each of the form:
26
+
Each yielded object has the form:
27
27
28
28
```JavaScript
29
29
{
@@ -77,26 +77,27 @@ A great source of [examples][] can be found in the tests for this API.
77
77
78
78
> Remove a hash from the pinset
79
79
80
-
##### `ipfs.pin.rm(hash, [options])`
80
+
##### `ipfs.pin.rm(source, [options])`
81
81
82
82
Where:
83
-
-`hash` is a multihash.
83
+
-`source` is a [CID], an array of CIDs or an (async) iterable that yields CIDs
84
84
-`options` is an object that can contain the following keys
0 commit comments