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

Commit

Permalink
docs: fix docs for add - moved to root namespace
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
Alan Shaw committed Apr 15, 2019
1 parent 36ac798 commit fa21abb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SPEC/FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ In the browser, assuming `ipfs = new Ipfs(...)`:

```js
const content = Ipfs.Buffer.from('ABC')
const results = await ipfs.files.add(content)
const results = await ipfs.add(content)
const hash = results[0].hash // "Qm...WW"
```

Expand All @@ -104,7 +104,7 @@ const files = [
}
]

const results = await ipfs.files.add(files)
const results = await ipfs.add(files)
```

The `results` array:
Expand Down Expand Up @@ -272,7 +272,7 @@ ipfs.addFromURL('http://example.com/', (err, result) => {
##### `ipfs.addFromStream(stream, [callback])`

This is very similar to `ipfs.files.add({ path:'', content: stream })`. It is like the reverse of cat.
This is very similar to `ipfs.add({ path:'', content: stream })`. It is like the reverse of cat.

```JavaScript
ipfs.addFromStream(<readable-stream>, (err, result) => {
Expand Down

0 comments on commit fa21abb

Please sign in to comment.