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

Commit

Permalink
docs: Update and fix examples (#1112)
Browse files Browse the repository at this point in the history
* docs: fix ipfs-101

* use relative ipfs instead
  • Loading branch information
daviddias authored Nov 27, 2017
1 parent 33e9949 commit 5940e27
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions examples/browser-browserify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"keywords": [],
"license": "MIT",
"devDependencies": {
"ipfs": "file:../../",
"browserify": "^14.0.0",
"concat-stream": "^1.6.0",
"http-server": "^0.9.0"
Expand Down
7 changes: 2 additions & 5 deletions examples/browser-browserify/src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
'use strict'

const IPFS = require('../../../src/core') // replace this by line below
// var IPFS = require('ipfs')
var IPFS = require('ipfs')

const node = new IPFS({
repo: String(Math.random() + Date.now())
})
const node = new IPFS({ repo: String(Math.random() + Date.now()) })

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

Expand Down
3 changes: 2 additions & 1 deletion examples/exchange-files-in-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"http-server": "^0.10.0"
},
"dependencies": {
"stream-buffers": "^3.0.1"
"stream-buffers": "^3.0.1",
"ipfs": "file:../../"
}
}
4 changes: 2 additions & 2 deletions examples/exchange-files-in-browser/public/js/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'
/* global self */
'use strict'

const $startButton = document.querySelector('#start')
const $stopButton = document.querySelector('#stop')
Expand Down Expand Up @@ -33,7 +33,7 @@ function start () {
updateView('starting', node)

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

// EXAMPLE
Expand Down
2 changes: 1 addition & 1 deletion examples/ipfs-101/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ series([
if (err) { return cb(err) }

console.log('\nFile content:')
process.stdout(data)
process.stdout.write(data)
})
])
2 changes: 1 addition & 1 deletion examples/ipfs-101/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"license": "MIT",
"dependencies": {
"async": "^2.6.0",
"ipfs": "^0.26.0"
"ipfs": "file:../../"
}
}

0 comments on commit 5940e27

Please sign in to comment.