Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 5940e27

Browse files
authoredNov 27, 2017
docs: Update and fix examples (#1112)
* docs: fix ipfs-101 * use relative ipfs instead
1 parent 33e9949 commit 5940e27

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed
 

‎examples/browser-browserify/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"keywords": [],
1212
"license": "MIT",
1313
"devDependencies": {
14+
"ipfs": "file:../../",
1415
"browserify": "^14.0.0",
1516
"concat-stream": "^1.6.0",
1617
"http-server": "^0.9.0"

‎examples/browser-browserify/src/index.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
'use strict'
22

3-
const IPFS = require('../../../src/core') // replace this by line below
4-
// var IPFS = require('ipfs')
3+
var IPFS = require('ipfs')
54

6-
const node = new IPFS({
7-
repo: String(Math.random() + Date.now())
8-
})
5+
const node = new IPFS({ repo: String(Math.random() + Date.now()) })
96

107
node.once('ready', () => console.log('IPFS node is ready'))
118

‎examples/exchange-files-in-browser/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"http-server": "^0.10.0"
1313
},
1414
"dependencies": {
15-
"stream-buffers": "^3.0.1"
15+
"stream-buffers": "^3.0.1",
16+
"ipfs": "file:../../"
1617
}
1718
}

‎examples/exchange-files-in-browser/public/js/app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
'use strict'
21
/* global self */
2+
'use strict'
33

44
const $startButton = document.querySelector('#start')
55
const $stopButton = document.querySelector('#stop')
@@ -33,7 +33,7 @@ function start () {
3333
updateView('starting', node)
3434

3535
// DEV: To test with latest js-ipfs
36-
const IPFS = require('../../../..')
36+
const IPFS = require('ipfs')
3737
node = new IPFS({ repo: 'ipfs-' + Math.random() })
3838

3939
// EXAMPLE

‎examples/ipfs-101/1.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ series([
2727
if (err) { return cb(err) }
2828

2929
console.log('\nFile content:')
30-
process.stdout(data)
30+
process.stdout.write(data)
3131
})
3232
])

‎examples/ipfs-101/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"license": "MIT",
1111
"dependencies": {
1212
"async": "^2.6.0",
13-
"ipfs": "^0.26.0"
13+
"ipfs": "file:../../"
1414
}
1515
}

0 commit comments

Comments
 (0)
This repository has been archived.