From 715a76baa2360d8e405ee247d5dec7782b205ded Mon Sep 17 00:00:00 2001 From: A_A <21040751+Otto-AA@users.noreply.github.com> Date: Mon, 1 Oct 2018 20:30:38 +0200 Subject: [PATCH 1/3] Use template literal --- examples/browser-add-readable-stream/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/browser-add-readable-stream/index.js b/examples/browser-add-readable-stream/index.js index 7ae4f87392..7e56c42f65 100644 --- a/examples/browser-add-readable-stream/index.js +++ b/examples/browser-add-readable-stream/index.js @@ -3,7 +3,7 @@ /* global Ipfs */ /* eslint-env browser */ -const repoPath = 'ipfs-' + Math.random() +const repoPath = `ipfs-${Math.random()}` const ipfs = new Ipfs({ repo: repoPath }) ipfs.on('ready', () => { From d81025f92f2ef431cb95e995be3a40b6016e915f Mon Sep 17 00:00:00 2001 From: A_A <21040751+Otto-AA@users.noreply.github.com> Date: Mon, 1 Oct 2018 20:46:57 +0200 Subject: [PATCH 2/3] Use const instead of var --- examples/browser-browserify/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/browser-browserify/src/index.js b/examples/browser-browserify/src/index.js index c964bd1713..3319115cfe 100644 --- a/examples/browser-browserify/src/index.js +++ b/examples/browser-browserify/src/index.js @@ -1,13 +1,13 @@ 'use strict' -var IPFS = require('ipfs') +const IPFS = require('ipfs') const node = new IPFS({ repo: String(Math.random() + Date.now()) }) node.once('ready', () => console.log('IPFS node is ready')) function store () { - var toStore = document.getElementById('source').value + const toStore = document.getElementById('source').value node.files.add(Buffer.from(toStore), (err, res) => { if (err || !res) { From 921120a924df9ca16d6339cff5dcedd94e1c08fd Mon Sep 17 00:00:00 2001 From: A_A <21040751+Otto-AA@users.noreply.github.com> Date: Mon, 1 Oct 2018 20:47:27 +0200 Subject: [PATCH 3/3] Remove spaces from textarea --- examples/browser-browserify/public/index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/browser-browserify/public/index.html b/examples/browser-browserify/public/index.html index 15f3293f24..a2ea58def4 100644 --- a/examples/browser-browserify/public/index.html +++ b/examples/browser-browserify/public/index.html @@ -14,8 +14,7 @@

JS IPFS - Add data to IPFS from the browser

- +
found in ipfs: