Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit c67c760

Browse files
authored
readme: add sub-modules usage instructions.
1 parent 1ff19bf commit c67c760

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ipfs-api
2525
- [Install](#install)
2626
- [Running the daemon with the right port](#running-the-daemon-with-the-right-port)
2727
- [Importing the module and usage](#importing-the-module-and-usage)
28+
- [Importing a sub-module and usage](#importing-a-sub-module-and-usage)
2829
- [In a web browser through Browserify](#in-a-web-browser-through-browserify)
2930
- [In a web browser from CDN](#in-a-web-browser-from-cdn)
3031
- [CORS](#cors)
@@ -74,6 +75,14 @@ var ipfs = ipfsAPI('/ip4/127.0.0.1/tcp/5001')
7475
// or using options
7576
var ipfs = ipfsAPI({host: 'localhost', port: '5001', protocol: 'http'})
7677
```
78+
### Importing a sub-module and usage
79+
```javascript
80+
const bitswap = require('ipfs-api/bitswap')('/ip4/127.0.0.1/tcp/5001')
81+
82+
bitswap.unwant(key, (err) => {
83+
// ...
84+
}
85+
```
7786
7887
### In a web browser through Browserify
7988

0 commit comments

Comments
 (0)