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

Commit 9e410c6

Browse files
Otto-AAAlan Shaw
authored and
Alan Shaw
committed
docs: enhance code style in examples (#1609)
* Use template literal * Use const instead of var * Remove spaces from textarea
1 parent 48e4810 commit 9e410c6

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

examples/browser-add-readable-stream/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* global Ipfs */
44
/* eslint-env browser */
55

6-
const repoPath = 'ipfs-' + Math.random()
6+
const repoPath = `ipfs-${Math.random()}`
77
const ipfs = new Ipfs({ repo: repoPath })
88

99
ipfs.on('ready', () => {

examples/browser-browserify/public/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
</head>
1515
<body>
1616
<h1>JS IPFS - Add data to IPFS from the browser</h1>
17-
<textarea id="source">
18-
</textarea>
17+
<textarea id="source"></textarea>
1918
<button id="store">add to ipfs</button>
2019
<div>
2120
<div>found in ipfs:</div>

examples/browser-browserify/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use strict'
22

3-
var IPFS = require('ipfs')
3+
const IPFS = require('ipfs')
44

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

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

99
function store () {
10-
var toStore = document.getElementById('source').value
10+
const toStore = document.getElementById('source').value
1111

1212
node.files.add(Buffer.from(toStore), (err, res) => {
1313
if (err || !res) {

0 commit comments

Comments
 (0)