Skip to content

Commit

Permalink
just to show some progress
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Jul 7, 2020
1 parent 0bc09f0 commit 6049cdd
Show file tree
Hide file tree
Showing 12 changed files with 3,506 additions and 415 deletions.
10 changes: 2 additions & 8 deletions .gitignore
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
42 changes: 13 additions & 29 deletions README.md
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>
40 changes: 0 additions & 40 deletions gulpfile.js

This file was deleted.

9 changes: 9 additions & 0 deletions index.html
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>
Loading

0 comments on commit 6049cdd

Please sign in to comment.