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

Commit 89fa357

Browse files
committed
feat: allow repo options to be passed in the ipfs constructor
1 parent 69ae750 commit 89fa357

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/core/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class IPFS extends EventEmitter {
4343

4444
if (typeof options.repo === 'string' ||
4545
options.repo === undefined) {
46-
this._repo = defaultRepo(options.repo)
46+
this._repo = defaultRepo(options.repo, options.repoPath)
4747
} else {
4848
this._repo = options.repo
4949
}

src/core/runtime/repo-browser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const IPFSRepo = require('ipfs-repo')
44

5-
module.exports = (dir) => {
5+
module.exports = (dir, options) => {
66
const repoPath = dir || 'ipfs'
7-
return new IPFSRepo(repoPath)
7+
return new IPFSRepo(repoPath, options)
88
}

src/core/runtime/repo-nodejs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const os = require('os')
44
const IPFSRepo = require('ipfs-repo')
55
const path = require('path')
66

7-
module.exports = (dir) => {
7+
module.exports = (dir, options) => {
88
const repoPath = dir || path.join(os.homedir(), '.jsipfs')
99

10-
return new IPFSRepo(repoPath)
10+
return new IPFSRepo(repoPath, options)
1111
}

0 commit comments

Comments
 (0)