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