Skip to content

Commit

Permalink
fix: update API in the script example
Browse files Browse the repository at this point in the history
addresses ipfs#1783
  • Loading branch information
schollz committed Dec 21, 2018
1 parent 7bcc496 commit 41ee9c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/browser-script-tag/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2>Some suggestions</h2>
<p>Try adding a new file:</p>

<code style="display:block; white-space:pre-wrap; background-color:#d7d6d6">
node.add(new node.types.Buffer('Hello world!'), (err, filesAdded) => {
node.files.add(new node.types.Buffer('Hello world!'), (err, filesAdded) => {
if (err) {
return console.error('Error - ipfs add', err, res)
}
Expand All @@ -40,7 +40,7 @@ <h2>Some suggestions</h2>
<p>You can cat that same file. If you used the exact same string as above ('Hello world!') you should have an hash like this: 'QmQzCQn4puG4qu8PVysxZmscmQ5vT1ZXpqo7f58Uh9QfyY'</p>

<code style="display:block; white-space:pre-wrap; background-color:#d7d6d6">
node.cat('QmQzCQn4puG4qu8PVysxZmscmQ5vT1ZXpqo7f58Uh9QfyY', function (err, data) {
node.files.cat('QmQzCQn4puG4qu8PVysxZmscmQ5vT1ZXpqo7f58Uh9QfyY', function (err, data) {
if (err) {
return console.error('Error - ipfs files cat', err, res)
}
Expand Down

0 comments on commit 41ee9c6

Please sign in to comment.