This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed
browser-add-readable-stream Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 33/* global Ipfs */
44/* eslint-env browser */
55
6- const repoPath = ' ipfs-' + Math . random ( )
6+ const repoPath = ` ipfs-${ Math . random ( ) } `
77const ipfs = new Ipfs ( { repo : repoPath } )
88
99ipfs . on ( 'ready' , ( ) => {
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 11'use strict'
22
3- var IPFS = require ( 'ipfs' )
3+ const IPFS = require ( 'ipfs' )
44
55const node = new IPFS ( { repo : String ( Math . random ( ) + Date . now ( ) ) } )
66
77node . once ( 'ready' , ( ) => console . log ( 'IPFS node is ready' ) )
88
99function 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 ) {
You can’t perform that action at this time.
0 commit comments