diff --git a/README.md b/README.md index 73827d63..d7855a4a 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ Initialize a repo. - `directory` (default IPFS_PATH if defined, or ~/.ipfs for go-ipfs and ~/.jsipfs for js-ipfs) - The location of the repo. - `pass` (optional) - The passphrase of the key chain. -`callback` is a function with the signature `function (Error, ipfsd)` where `err` is an Error in case something goes wrong and `ipfsd` is the daemon controller instance. +`callback` is a function with the signature `function (err, ipfsd)` where `err` is an Error in case something goes wrong and `ipfsd` is the daemon controller instance. #### `ipfsd.cleanup(callback)` @@ -215,7 +215,7 @@ Start the daemon. `flags` - Flags array to be passed to the `ipfs daemon` command. -`callback` is a function with the signature `function(err, ipfsApi)` that receives an instance of `ipfs-api` on success or an instance of `Error` on failure +`callback` is a function with the signature `function(err, ipfsApi)` that receives an instance of `Error` on failure or an instance of `ipfs-api` on success. #### `ipfsd.stop([timeout, callback])` diff --git a/src/ipfsd-client.js b/src/ipfsd-client.js index 083b6a34..add0329f 100644 --- a/src/ipfsd-client.js +++ b/src/ipfsd-client.js @@ -95,7 +95,7 @@ class DaemonClient { } this.initialized = res.body.initialized - cb() + cb(null, this) }) } diff --git a/src/ipfsd-daemon.js b/src/ipfsd-daemon.js index 4be86328..1a310a5a 100644 --- a/src/ipfsd-daemon.js +++ b/src/ipfsd-daemon.js @@ -187,7 +187,7 @@ class Daemon { if (err) { return callback(err) } this.clean = false this.initialized = true - return callback() + return callback(null, this) }) }) } diff --git a/src/ipfsd-in-proc.js b/src/ipfsd-in-proc.js index 8598027c..74a1ab84 100644 --- a/src/ipfsd-in-proc.js +++ b/src/ipfsd-in-proc.js @@ -162,7 +162,7 @@ class Node extends EventEmitter { if (err) { return callback(err) } self.clean = false self.initialized = true - return callback() + return callback(null, this) }) }) }