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

Commit 118a965

Browse files
shunkinoAlan Shaw
authored and
Alan Shaw
committed
small fix to bundle-browserify for recent js-ipfs-api (#849)
1 parent cffbca7 commit 118a965

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

examples/bundle-browserify/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var ipfs = IPFS()
66

77
function store () {
88
var toStore = document.getElementById('source').value
9-
ipfs.add(Buffer.from(toStore), function (err, res) {
9+
ipfs.files.add(Buffer.from(toStore), function (err, res) {
1010
if (err || !res) {
1111
return console.error('ipfs add error', err, res)
1212
}
@@ -21,8 +21,7 @@ function store () {
2121
}
2222

2323
function display (hash) {
24-
// buffer: true results in the returned result being a buffer rather than a stream
25-
ipfs.cat(hash, {buffer: true}, function (err, res) {
24+
ipfs.files.cat(hash, function (err, res) {
2625
if (err || !res) {
2726
return console.error('ipfs cat error', err, res)
2827
}

examples/bundle-browserify/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
"license": "MIT",
1212
"devDependencies": {
1313
"browserify": "^13.1.1",
14-
"ipfs-api": "^11.1.0",
14+
"ipfs-api": "^24.0.0",
1515
"http-server": "~0.9.0"
1616
},
17-
"dependencies": {
18-
}
17+
"dependencies": {}
1918
}

0 commit comments

Comments
 (0)