braid-text 0.0.7 → 0.0.9

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.
Files changed (2) hide show
  1. package/README.md +12 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -7,7 +7,8 @@ This library provides a simple http route handler, along with client code, enabl
7
7
  - Enables light clients
8
8
  - As little as 50 lines of code!
9
9
  - With zero history overhead on client
10
- - Supports backpressure to run smoothly on constrained servers
10
+ - Supports [backpressure](https://braid.org/meeting-81/simpleton) to run smoothly on constrained servers
11
+ - Sever merges with Diamond-Types
11
12
  - Supports [Diamond Types](https://github.com/josephg/diamond-types) merge-type
12
13
  - Fast / Robust / Extensively fuzz-tested
13
14
  - Developed in [braid.org](https://braid.org)
@@ -42,7 +43,7 @@ Import the request handler into your code, and use it to handle HTTP requests wh
42
43
  ```javascript
43
44
  var braid_text = require("braid-text")
44
45
 
45
- server.on("request", (req, res) => {
46
+ http_server.on("request", (req, res) => {
46
47
  // Your server logic...
47
48
 
48
49
  // Whenever desired, serve braid text for this request/response:
@@ -57,7 +58,7 @@ server.on("request", (req, res) => {
57
58
  - This folder will be created if it doesn't exist.
58
59
  - The files for a resource will all be prefixed with a url-encoding of `key` within this folder.
59
60
 
60
- `braid_text.server(req, res, options)`
61
+ `braid_text.serve(req, res, options)`
61
62
  - `req`: The incoming HTTP request object.
62
63
  - `res`: The HTTP response object to send the response.
63
64
  - `options`: <small style="color:lightgrey">[optional]</small> An object containing additional options:
@@ -105,11 +106,14 @@ server.on("request", (req, res) => {
105
106
  },
106
107
  generate_local_diff_update: (prev_state) => {
107
108
 
108
- // Compute diff between prev_state ^ and the current textarea string,
109
- // which might look like [{
110
- // range: [5:5],
111
- // content: " World"
112
- // }] to insert something after a prev_state of "Hello"
109
+ // Compute diff between prev_state ^ and the current textarea string, such as:
110
+ //
111
+ // var patches = [{
112
+ // range: [5:5],
113
+ // content: " World"
114
+ // }]
115
+ //
116
+ // ...to insert something after a prev_state of "Hello".
113
117
 
114
118
  // Then return the new state (as a string) and the diff (as `patches`)
115
119
  return {new_state, patches}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-text",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Library for collaborative text over http using braid.",
5
5
  "author": "Braid Working Group",
6
6
  "repository": "braid-org/braidjs",