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 Apr 29, 2020. It is now read-only.
The `import` object is a duplex pull stream that takes objects of the form:
117
107
118
108
```js
119
109
{
120
110
path:'a name',
121
-
content: (Buffer or Readable stream)
111
+
content: (Buffer, pull-stream emitting Buffers or a Readable stream)
122
112
}
123
113
```
124
114
@@ -152,85 +142,14 @@ The input's file paths and directory structure will be preserved in the [`dag-pb
152
142
-`rawLeaves` (boolean, defaults to false): When a file would span multiple DAGNodes, if this is true the leaf nodes will not be wrapped in `UnixFS` protobufs and will instead contain the raw file bytes
153
143
-`leafType` (string, defaults to `'file'`) what type of UnixFS node leaves should be - can be `'file'` or `'raw'` (ignored when `rawLeaves` is `true`)
154
144
155
-
### Exporter
156
-
157
-
#### Exporter example
158
-
159
-
```js
160
-
// Create an export source pull-stream cid or ipfs path you want to export and a
161
-
// <dag or ipld-resolver instance> to fetch the file from
162
-
constfilesStream=Exporter(<cid or ipfsPath>, <dag or ipld-resolver instance>)
### new Exporter(<cidoripfsPath>, <dagoripld-resolver>, <options>)
175
-
176
-
Uses the given [dag API][] or an [ipld-resolver instance][] to fetch an IPFS [UnixFS][] object(s) by their multiaddress.
177
-
178
-
Creates a new readable stream in object mode that outputs objects of the form
179
-
180
-
```js
181
-
{
182
-
path:'a name',
183
-
content: (Buffer or Readable stream)
184
-
}
185
-
```
186
-
187
-
#### `offset` and `length`
188
-
189
-
`offset` and `length` arguments can optionally be passed to the reader function. These will cause the returned stream to only emit bytes starting at `offset` and with length of `length`.
190
-
191
-
See [the tests](test/reader.js) for examples of using these arguments.
0 commit comments