Package Exports
- y-leveldb
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (y-leveldb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
LevelDB database adapter for Yjs
Use the LevelDB database adapter to store your shared data persistently in NodeJs applications. The changes will persist after restart.
Use it!
Install this with bower or npm.
Bower
bower install y-leveldb --saveNPM
npm install y-leveldb --saveExample
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'))
}License
Yjs is licensed under the MIT License.