@libp2p/floodsub 8.0.10 → 8.0.11-dfbe0cc0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,3 @@
1
- # @libp2p/floodsub <!-- omit in toc -->
2
-
3
1
  [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
4
2
  [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
5
3
  [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p)
@@ -7,31 +5,9 @@
7
5
 
8
6
  > libp2p-floodsub, also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).
9
7
 
10
- ## Table of contents <!-- omit in toc -->
11
-
12
- - [Install](#install)
13
- - [Browser `<script>` tag](#browser-script-tag)
14
- - [Don't use this module](#dont-use-this-module)
15
- - [Usage](#usage)
16
- - [API Docs](#api-docs)
17
- - [License](#license)
18
- - [Contribution](#contribution)
19
-
20
- ## Install
21
-
22
- ```console
23
- $ npm i @libp2p/floodsub
24
- ```
25
-
26
- ### Browser `<script>` tag
27
-
28
- Loading this module through a script tag will make it's exports available as `Libp2pFloodsub` in the global namespace.
29
-
30
- ```html
31
- <script src="https://unpkg.com/@libp2p/floodsub/dist/index.min.js"></script>
32
- ```
8
+ # About
33
9
 
34
- ## Don't use this module
10
+ > Don't use this module
35
11
 
36
12
  This module is a naive implementation of pubsub. It broadcasts all messages to all network peers, cannot provide older messages and has no protection against bad actors.
37
13
 
@@ -39,7 +15,7 @@ It exists for academic purposes only, you should not use it in production.
39
15
 
40
16
  Instead please use [gossipsub](https://www.npmjs.com/package/@chainsafe/libp2p-gossipsub) - a more complete implementation which is also compatible with floodsub.
41
17
 
42
- ## Usage
18
+ ## Example
43
19
 
44
20
  ```JavaScript
45
21
  import { createLibp2pNode } from 'libp2p'
@@ -59,17 +35,31 @@ node.pubsub.addEventListener('message', (evt) => {
59
35
  node.pubsub.publish('fruit', new TextEncoder().encode('banana'))
60
36
  ```
61
37
 
62
- ## API Docs
38
+ # Install
39
+
40
+ ```console
41
+ $ npm i @libp2p/floodsub
42
+ ```
43
+
44
+ ## Browser `<script>` tag
45
+
46
+ Loading this module through a script tag will make it's exports available as `Libp2pFloodsub` in the global namespace.
47
+
48
+ ```html
49
+ <script src="https://unpkg.com/@libp2p/floodsub/dist/index.min.js"></script>
50
+ ```
51
+
52
+ # API Docs
63
53
 
64
54
  - <https://libp2p.github.io/js-libp2p/modules/_libp2p_floodsub.html>
65
55
 
66
- ## License
56
+ # License
67
57
 
68
58
  Licensed under either of
69
59
 
70
60
  - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
71
61
  - MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
72
62
 
73
- ## Contribution
63
+ # Contribution
74
64
 
75
65
  Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.