From 59189b7baec93c1a52f5863e98d6557acb733b49 Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 27 Nov 2017 10:22:41 +0000 Subject: [PATCH 1/2] docs: fix ipfs-101 --- examples/ipfs-101/1.js | 2 +- examples/ipfs-101/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ipfs-101/1.js b/examples/ipfs-101/1.js index 3cd7a9b325..9f206d543a 100644 --- a/examples/ipfs-101/1.js +++ b/examples/ipfs-101/1.js @@ -27,6 +27,6 @@ series([ if (err) { return cb(err) } console.log('\nFile content:') - process.stdout(data) + process.stdout.write(data) }) ]) diff --git a/examples/ipfs-101/package.json b/examples/ipfs-101/package.json index b0bb44293b..4973b2c618 100644 --- a/examples/ipfs-101/package.json +++ b/examples/ipfs-101/package.json @@ -10,6 +10,6 @@ "license": "MIT", "dependencies": { "async": "^2.6.0", - "ipfs": "^0.26.0" + "ipfs": "file:../../" } } From 11ae7b3c912f20a422a7b946fd253178fe55689f Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 27 Nov 2017 10:22:53 +0000 Subject: [PATCH 2/2] use relative ipfs instead --- examples/browser-browserify/package.json | 1 + examples/browser-browserify/src/index.js | 7 ++----- examples/exchange-files-in-browser/package.json | 3 ++- examples/exchange-files-in-browser/public/js/app.js | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/browser-browserify/package.json b/examples/browser-browserify/package.json index 1e00b7f412..056c197ad8 100644 --- a/examples/browser-browserify/package.json +++ b/examples/browser-browserify/package.json @@ -11,6 +11,7 @@ "keywords": [], "license": "MIT", "devDependencies": { + "ipfs": "file:../../", "browserify": "^14.0.0", "concat-stream": "^1.6.0", "http-server": "^0.9.0" diff --git a/examples/browser-browserify/src/index.js b/examples/browser-browserify/src/index.js index 10d3434756..c964bd1713 100644 --- a/examples/browser-browserify/src/index.js +++ b/examples/browser-browserify/src/index.js @@ -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')) diff --git a/examples/exchange-files-in-browser/package.json b/examples/exchange-files-in-browser/package.json index 6fa24583b8..c6a9f3be6b 100644 --- a/examples/exchange-files-in-browser/package.json +++ b/examples/exchange-files-in-browser/package.json @@ -12,6 +12,7 @@ "http-server": "^0.10.0" }, "dependencies": { - "stream-buffers": "^3.0.1" + "stream-buffers": "^3.0.1", + "ipfs": "file:../../" } } diff --git a/examples/exchange-files-in-browser/public/js/app.js b/examples/exchange-files-in-browser/public/js/app.js index f9f944aa58..789950ff40 100644 --- a/examples/exchange-files-in-browser/public/js/app.js +++ b/examples/exchange-files-in-browser/public/js/app.js @@ -1,5 +1,5 @@ -'use strict' /* global self */ +'use strict' const $startButton = document.querySelector('#start') const $stopButton = document.querySelector('#stop') @@ -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