@@ -82,6 +82,10 @@ var ipfs = ipfsAPI('/ip4/127.0.0.1/tcp/5001')
82
82
83
83
// or using options
84
84
var ipfs = ipfsAPI ({host: ' localhost' , port: ' 5001' , protocol: ' http' })
85
+
86
+ // or specifying a specific API path
87
+ var ipfs = ipfsAPI ({host: ' 1.1.1.1' , port: ' 80' , ' api-path' : ' /ipfs/api/v0' })
88
+
85
89
```
86
90
### Importing a sub-module and usage
87
91
``` javascript
@@ -193,7 +197,7 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
193
197
- [` ipfs .dag .put (dagNode, options, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DAG.md#dagput)
194
198
- [` ipfs .dag .get (cid [, path, options], callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DAG.md#dagget)
195
199
- [` ipfs .dag .tree (cid [, path, options], callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DAG.md#dagtree)
196
-
200
+
197
201
- [object](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/OBJECT.md).
198
202
- [` ipfs .object .new ([template][, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/OBJECT.md#objectnew)
199
203
- [` ipfs .object .put (obj, [options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/OBJECT.md#objectput)
@@ -219,30 +223,30 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
219
223
- ` ipfs .bootstrap .list `
220
224
- ` ipfs .bootstrap .add `
221
225
- ` ipfs .bootstrap .rm `
222
-
226
+
223
227
- [bitswap](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/)
224
228
- ` ipfs .bitswap .wantlist ()`
225
229
- ` ipfs .bitswap .stat ()`
226
230
- ` ipfs .bitswap .unwant ()`
227
-
231
+
228
232
- [dht](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/)
229
233
- [` ipfs .dht .findprovs ()` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DHT.md#findprovs)
230
234
- [` ipfs .dht .get ()` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DHT.md#get)
231
235
- [` ipfs .dht .put ()` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DHT.md#put)
232
-
236
+
233
237
- [pubsub](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md)
234
238
- [` ipfs .pubsub .subscribe (topic, options, handler, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubsubscribe)
235
239
- [` ipfs .pubsub .unsubscribe (topic, handler)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubunsubscribe)
236
240
- [` ipfs .pubsub .publish (topic, data, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubpublish)
237
241
- [` ipfs .pubsub .ls (topic, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubls)
238
242
- [` ipfs .pubsub .peers (topic, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubpeers)
239
-
243
+
240
244
- [swarm](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md)
241
245
- [` ipfs .swarm .addrs ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#addrs)
242
246
- [` ipfs .swarm .connect (addr, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#connect)
243
247
- [` ipfs .swarm .disconnect (addr, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#disconnect)
244
248
- [` ipfs .swarm .peers ([opts] [, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#peers)
245
-
249
+
246
250
- [name](https://github.com/ipfs/interface-ipfs-core/tree/master/API/name)
247
251
- [` ipfs .name .publish (addr, [options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/NAME.md#publish)
248
252
- [` ipfs .name .resolve (addr, [options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/NAME.md#resolve)
@@ -257,17 +261,17 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
257
261
- ` ipfs .pingReadableStream (id, [options])`
258
262
- [` ipfs .dns (domain, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/MISCELLANEOUS.md#dns)
259
263
- [` ipfs .stop ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/MISCELLANEOUS.md#stop). Alias to ` ipfs .shutdown ` .
260
-
264
+
261
265
- [config](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md)
262
266
- [` ipfs .config .get ([key, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md#configget)
263
267
- [` ipfs .config .set (key, value, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md#configset)
264
268
- [` ipfs .config .replace (config, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md#configreplace)
265
-
269
+
266
270
- [stats](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md)
267
271
- [` ipfs .stats .bitswap ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md#bitswap)
268
272
- [` ipfs .stats .bw ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md#bw)
269
273
- [` ipfs .stats .repo ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md#repo)
270
-
274
+
271
275
- log
272
276
- ` ipfs .log .ls ([callback])`
273
277
- ` ipfs .log .tail ([callback])`
@@ -277,7 +281,7 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
277
281
- [` ipfs .repo .gc ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#gc)
278
282
- [` ipfs .repo .stat ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#stat)
279
283
- [` ipfs .repo .version ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#version)
280
-
284
+
281
285
- [key](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md)
282
286
- [` ipfs .key .gen (name, options, [callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeygenname-options-callback)
283
287
- [` ipfs .key .list ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeylistcallback)
@@ -286,7 +290,7 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
286
290
- [` ipfs .key .export (name, password, [callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeyexportname-password-callback)
287
291
- [` ipfs .key .import (name, pem, password, [callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeyimportname-pem-password-callback)
288
292
289
- #### ` Pubsub Caveat`
293
+ #### ` Pubsub Caveat`
290
294
291
295
**Currently, the [PubSub API only works in Node.js envinroment](https://github.com/ipfs/js-ipfs-api/issues/518)**
292
296
@@ -335,7 +339,7 @@ Complete documentation for these methods is coming with: https://github.com/ipfs
335
339
Reads a file or folder from ` path` on the filesystem and adds it to IPFS. Options:
336
340
- **recursive**: If ` path` is a directory, use option ` { recursive: true }` to add the directory and all its sub-directories.
337
341
- **ignore**: To exclude fileglobs from the directory, use option ` { ignore: [' ignore/this/folder/**' , ' and/this/file' ] }` .
338
- - **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 }` .
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 }` .
339
343
340
344
` ` ` JavaScript
341
345
ipfs .util .addFromFs (' path/to/a/folder' , { recursive: true , ignore: [' subfolder/to/ignore/**' ]}, (err , result ) => {
0 commit comments