-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
3,506 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
/node_modules/ | ||
bower_components | ||
.directory | ||
.c9 | ||
.codio | ||
.settings | ||
build | ||
.vscode | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,23 @@ | ||
# LevelDB database adapter for [Yjs](https://github.com/y-js/yjs) | ||
# LevelDB database adapter for [Yjs](https://github.com/yjs/yjs) | ||
|
||
Use the LevelDB database adapter to store your shared data persistently in NodeJs applications. The changes will persist after restart. | ||
Use the IndexedDB database adapter to store your shared data persistently in | ||
the browser. The next time you join the session, your changes will still be | ||
there. | ||
|
||
## Use it! | ||
Install this with bower or npm. | ||
* Minimizes the amount of data exchanged between server and client | ||
* Makes offline editing possible | ||
* Not supported by all browsers (see [mdn](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)) | ||
|
||
##### NPM | ||
``` | ||
npm install y-leveldb --save | ||
``` | ||
## Use it | ||
|
||
### Example | ||
Install this with bower or npm. | ||
|
||
``` | ||
Y({ | ||
db: { | ||
name: 'leveldb', | ||
namespace: 'textarea-example' (optional - defaults to connector.room), | ||
dir: './db' // where the database is created, | ||
cleanStart: false // (if true, overwrite existing content - great for debugging) | ||
}, | ||
connector: { | ||
name: 'websockets-client', // use the websockets connector | ||
room: 'textarea-example' | ||
}, | ||
share: { | ||
textarea: 'Text' // y.share.textarea is of type Y.Text | ||
} | ||
}).then(function (y) { | ||
// bind the textarea to a shared text element | ||
y.share.textarea.bind(document.getElementById('textfield')) | ||
} | ||
```sh | ||
npm install y-leveldb --save | ||
``` | ||
|
||
## License | ||
|
||
Yjs is licensed under the [MIT License](./LICENSE). | ||
|
||
<kevin.jahns@rwth-aachen.de> | ||
<kevin.jahns@protonmail.com> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Testing y-indexeddb</title> | ||
</head> | ||
<body> | ||
<script type="module" src="./dist/test.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.