@@ -86,6 +86,10 @@ var ipfs = ipfsAPI('/ip4/127.0.0.1/tcp/5001')
8686
8787// or using options
8888var ipfs = ipfsAPI ({host: ' localhost' , port: ' 5001' , protocol: ' http' })
89+
90+ // or specifying a specific API path
91+ var ipfs = ipfsAPI ({host: ' 1.1.1.1' , port: ' 80' , ' api-path' : ' /ipfs/api/v0' })
92+
8993```
9094### Importing a sub-module and usage
9195``` javascript
@@ -197,7 +201,7 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
197201 - [` ipfs .dag .put (dagNode, options, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DAG.md#dagput)
198202 - [` ipfs .dag .get (cid [, path, options], callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DAG.md#dagget)
199203 - [` ipfs .dag .tree (cid [, path, options], callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DAG.md#dagtree)
200-
204+
201205- [object](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/OBJECT.md).
202206 - [` ipfs .object .new ([template][, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/OBJECT.md#objectnew)
203207 - [` ipfs .object .put (obj, [options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/OBJECT.md#objectput)
@@ -223,30 +227,30 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
223227 - ` ipfs .bootstrap .list `
224228 - ` ipfs .bootstrap .add `
225229 - ` ipfs .bootstrap .rm `
226-
230+
227231- [bitswap](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/)
228232 - ` ipfs .bitswap .wantlist ()`
229233 - ` ipfs .bitswap .stat ()`
230234 - ` ipfs .bitswap .unwant ()`
231-
235+
232236- [dht](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/)
233237 - [` ipfs .dht .findprovs ()` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DHT.md#findprovs)
234238 - [` ipfs .dht .get ()` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DHT.md#get)
235239 - [` ipfs .dht .put ()` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DHT.md#put)
236-
240+
237241- [pubsub](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md)
238242 - [` ipfs .pubsub .subscribe (topic, handler, options, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubsubscribe)
239243 - [` ipfs .pubsub .unsubscribe (topic, handler, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubunsubscribe)
240244 - [` ipfs .pubsub .publish (topic, data, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubpublish)
241245 - [` ipfs .pubsub .ls (topic, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubls)
242246 - [` ipfs .pubsub .peers (topic, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubpeers)
243-
247+
244248- [swarm](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md)
245249 - [` ipfs .swarm .addrs ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#addrs)
246250 - [` ipfs .swarm .connect (addr, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#connect)
247251 - [` ipfs .swarm .disconnect (addr, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#disconnect)
248252 - [` ipfs .swarm .peers ([opts] [, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#peers)
249-
253+
250254- [name](https://github.com/ipfs/interface-ipfs-core/tree/master/API/name)
251255 - [` ipfs .name .publish (addr, [options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/NAME.md#publish)
252256 - [` ipfs .name .resolve (addr, [options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/NAME.md#resolve)
@@ -261,17 +265,17 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
261265 - ` ipfs .pingReadableStream (id, [options])`
262266 - [` ipfs .dns (domain, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/MISCELLANEOUS.md#dns)
263267 - [` ipfs .stop ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/MISCELLANEOUS.md#stop). Alias to ` ipfs .shutdown ` .
264-
268+
265269- [config](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md)
266270 - [` ipfs .config .get ([key, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md#configget)
267271 - [` ipfs .config .set (key, value, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md#configset)
268272 - [` ipfs .config .replace (config, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md#configreplace)
269-
273+
270274- [stats](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md)
271275 - [` ipfs .stats .bitswap ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md#bitswap)
272276 - [` ipfs .stats .bw ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md#bw)
273277 - [` ipfs .stats .repo ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md#repo)
274-
278+
275279- log
276280 - ` ipfs .log .ls ([callback])`
277281 - ` ipfs .log .tail ([callback])`
@@ -281,7 +285,7 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
281285 - [` ipfs .repo .gc ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#gc)
282286 - [` ipfs .repo .stat ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#stat)
283287 - [` ipfs .repo .version ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#version)
284-
288+
285289- [key](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md)
286290 - [` ipfs .key .gen (name, options, [callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeygenname-options-callback)
287291 - [` ipfs .key .list ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeylistcallback)
@@ -290,7 +294,7 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
290294 - [` ipfs .key .export (name, password, [callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeyexportname-password-callback)
291295 - [` ipfs .key .import (name, pem, password, [callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeyimportname-pem-password-callback)
292296
293- #### ` Pubsub Caveat`
297+ #### ` Pubsub Caveat`
294298
295299**Currently, the [PubSub API only works in Node.js envinroment](https://github.com/ipfs/js-ipfs-api/issues/518)**
296300
@@ -339,7 +343,7 @@ Complete documentation for these methods is coming with: https://github.com/ipfs
339343Reads a file or folder from ` path` on the filesystem and adds it to IPFS. Options:
340344- **recursive**: If ` path` is a directory, use option ` { recursive: true }` to add the directory and all its sub-directories.
341345 - **ignore**: To exclude fileglobs from the directory, use option ` { ignore: [' ignore/this/folder/**' , ' and/this/file' ] }` .
342- - **hidden**: hidden/dot files (files or folders starting with a ` .` , for example, ` .git / ` ) are not included by default. To add them, use the option ` { hidden: true }` .
346+ - **hidden**: hidden/dot files (files or folders starting with a ` .` , for example, ` .git / ` ) are not included by default. To add them, use the option ` { hidden: true }` .
343347
344348` ` ` JavaScript
345349ipfs .util .addFromFs (' path/to/a/folder' , { recursive: true , ignore: [' subfolder/to/ignore/**' ]}, (err , result ) => {
0 commit comments