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

Commit 7ffcaf6

Browse files
committed
docs: update examples and README
1 parent 6441898 commit 7ffcaf6

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,12 @@ The HTTP-API exposed by the js-ipfs daemon follows the [`http-api-spec`](https:/
200200
const repo = <IPFS Repo instance or repo path>
201201

202202
// Create the IPFS node instance
203-
const node = new IPFS(repo)
203+
const node = new IPFS({
204+
repo: repo,
205+
EXPERIMENTAL: {
206+
pubsub: false
207+
}
208+
})
204209

205210
// We need to init our repo, in this case the repo was empty
206211
// We are picking 2048 bits for the RSA key that will be our PeerId

examples/basics/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ const IPFS = require('../../src/core')
1212
/*
1313
* Create a new IPFS instance, using default repo (fs) on default path (~/.ipfs)
1414
*/
15-
const node = new IPFS(path.join(os.tmpDir() + '/' + new Date().toString()))
15+
const node = new IPFS({
16+
repo: path.join(os.tmpDir() + '/' + new Date().toString()),
17+
EXPERIMENTAL: {
18+
pubsub: false
19+
}
20+
})
1621

1722
const fileToAdd = {
1823
path: 'hello.txt',

examples/bundle-browserify/src/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ var IPFS = require('../../../src/core') // replace this by line below
77
// for simplicity, we create a new repo everytime the node
88
// is created, because you can't init already existing repos
99
const repoPath = String(Math.random())
10-
const node = new IPFS(repoPath)
10+
const node = new IPFS({
11+
repo: repoPath,
12+
EXPERIMENTAL: {
13+
pubsub: false
14+
}
15+
})
1116
const concat = require('concat-stream')
1217

1318
node.init({ emptyRepo: true, bits: 2048 }, function (err) {

examples/bundle-webpack/src/components/app.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ class App extends React.Component {
2929
// for simplicity, we create a new repo everytime the node
3030
// is created, because you can't init already existing repos
3131
const repoPath = String(Math.random())
32-
node = new IPFS(repoPath)
32+
node = new IPFS({
33+
repo: repoPath,
34+
EXPERIMENTAL: {
35+
pubsub: false
36+
}
37+
})
3338

3439
node.init({ emptyRepo: true, bits: 2048 }, function (err) {
3540
if (err) {

src/core/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
exports.goOnline = require('./go-online')
24
exports.goOffline = require('./go-offline')
35
exports.isOnline = require('./is-online')

0 commit comments

Comments
 (0)