Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

Commit 718e01b

Browse files
authored
docs: publish api docs (#411)
Updates project config to publish api docs
1 parent ae23926 commit 718e01b

File tree

3 files changed

+28
-45
lines changed

3 files changed

+28
-45
lines changed

.gitignore

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,8 @@
1-
**/node_modules/
2-
**/*.log
3-
test/repo-tests*
4-
**/bundle.js
5-
docs
6-
7-
# Logs
8-
logs
9-
*.log
10-
11-
coverage
12-
13-
# Runtime data
14-
pids
15-
*.pid
16-
*.seed
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
.coverage
23-
24-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
25-
.grunt
26-
27-
# node-waf configuration
28-
.lock-wscript
29-
30-
build
31-
32-
# Dependency directory
33-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
341
node_modules
35-
36-
lib
2+
build
373
dist
38-
test/test-data/go-ipfs-repo/LOCK
39-
test/test-data/go-ipfs-repo/LOG
40-
test/test-data/go-ipfs-repo/LOG.old
41-
42-
# while testing npm5
4+
.docs
5+
.coverage
6+
node_modules
437
package-lock.json
448
yarn.lock
45-
.nyc_output

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
44
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
55
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-kad-dht.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-kad-dht)
6-
[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-kad-dht/actions/workflows/js-test-and-release.yml)
6+
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-kad-dht/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p-kad-dht/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
77

88
> JavaScript implementation of the Kad-DHT for libp2p
99
1010
## Table of contents <!-- omit in toc -->
1111

1212
- [Install](#install)
13+
- [Browser `<script>` tag](#browser-script-tag)
1314
- [Use in Node.js](#use-in-nodejs)
1415
- [API](#api)
1516
- [Custom secondary DHT in libp2p](#custom-secondary-dht-in-libp2p)
@@ -18,6 +19,7 @@
1819
- [Peer Discovery](#peer-discovery)
1920
- [Spec](#spec)
2021
- [Contribute](#contribute)
22+
- [API Docs](#api-docs)
2123
- [License](#license)
2224
- [Contribute](#contribute-1)
2325

@@ -27,6 +29,14 @@
2729
$ npm i @libp2p/kad-dht
2830
```
2931

32+
### Browser `<script>` tag
33+
34+
Loading this module through a script tag will make it's exports available as `Libp2pKadDht` in the global namespace.
35+
36+
```html
37+
<script src="https://unpkg.com/@libp2p/kad-dht/dist/index.min.js"></script>
38+
```
39+
3040
```sh
3141
> npm i @libp2p/kad-dht
3242
```
@@ -86,6 +96,10 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c
8696

8797
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
8898

99+
## API Docs
100+
101+
- <https://libp2p.github.io/js-libp2p-kad-dht>
102+
89103
## License
90104

91105
Licensed under either of

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"types": "./dist/src/index.d.ts",
2323
"files": [
2424
"src",
25-
"dist/src",
25+
"dist",
2626
"!dist/test",
2727
"!**/*.tsbuildinfo"
2828
],
@@ -138,7 +138,8 @@
138138
"test:firefox": "aegir test -t browser -- --browser firefox",
139139
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
140140
"dep-check": "aegir dep-check",
141-
"release": "aegir release"
141+
"release": "aegir release",
142+
"docs": "aegir docs"
142143
},
143144
"dependencies": {
144145
"@libp2p/crypto": "^1.0.4",
@@ -196,7 +197,7 @@
196197
"@types/lodash.range": "^3.2.6",
197198
"@types/varint": "^6.0.0",
198199
"@types/which": "^2.0.1",
199-
"aegir": "^37.3.0",
200+
"aegir": "^37.7.7",
200201
"datastore-level": "^9.0.0",
201202
"delay": "^5.0.0",
202203
"execa": "^6.0.0",
@@ -214,5 +215,10 @@
214215
},
215216
"browser": {
216217
"./dist/src/routing-table/generated-prefix-list.js": "./dist/src/routing-table/generated-prefix-list-browser.js"
218+
},
219+
"typedocs": {
220+
"KadDHTComponents": "https://libp2p.github.io/js-libp2p-kad-dht/interfaces/KadDHTComponents.html",
221+
"KadDHTInit": "https://libp2p.github.io/js-libp2p-kad-dht/interfaces/KadDHTInit.html",
222+
"kadDHT": "https://libp2p.github.io/js-libp2p-kad-dht/functions/kadDHT.html"
217223
}
218224
}

0 commit comments

Comments
 (0)