Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/no9/node-leveldown-gap
A leveldown implementation for Phonegap - mothballed please see localstorage-down
https://github.com/no9/node-leveldown-gap
Last synced: about 2 months ago
JSON representation
A leveldown implementation for Phonegap - mothballed please see localstorage-down
- Host: GitHub
- URL: https://github.com/no9/node-leveldown-gap
- Owner: No9
- Created: 2013-04-17T21:10:28.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-30T02:59:24.000Z (almost 11 years ago)
- Last Synced: 2024-10-14T00:19:41.832Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 2.21 MB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-leveldown-gap (mothballed)
This repo is dormant and is *NOT* being actively maintained.
For reasons see [this issue](https://github.com/No9/node-leveldown-gap/issues/1)
The functioning localstorage code is at [https://github.com/No9/localstorage-down](https://github.com/No9/localstorage-down)
and is being maintained for mobile and desktop browsers.A leveldown implementation for Phonegap and the browser.
The idea is to be able to use the sync technology in the level stack on a phone.The scenarios envisaged are :
1. Occasionally connected clients
2. Adhoc Networks where clients need to sync directly with each other.
This project is standalone but fits well with [fija](https://github.com/No9/fija) and [levelup](https://github.com/rvagg/node-levelup)
## Status
[![browser support](https://ci.testling.com/no9/node-leveldown-gap.png)](https://ci.testling.com/no9/node-leveldown-gap)
## Install
```
npm install leveldown-gap
```## Example
At the command prompt in your chosen directory :
```
npm install leveldown-gap
npm install levelup
npm install beefy -g
npm install browserify -g
```Create a file called index.js and enter the following:
```
var leveldowngap = require('leveldown-gap')
, levelup = require('levelup')
, factory = function (location) { return new leveldowngap(location) }
, db = levelup('/does/not/matter', { db: factory })db.put('name', 'Yuri Irsenovich Kim')
db.put('dob', '16 February 1941')
db.put('spouse', 'Kim Young-sook')
db.put('occupation', 'Clown')db.readStream()
.on('data', function (data) {
if(typeof data.value !== 'undefined')
console.log(data.key, '=', data.value)
})
.on('error', function (err) {
console.log('Oh my!', err)
})
.on('close', function () {
console.log('Stream closed')
})
.on('end', function () {
console.log('Stream ended')
})
```Publish the site :
```
beefy index.js
```See the output :
(http://localhost:9966)[http://localhost:9966]
Listen to John Cage :
http://www.youtube.com/watch?v=ExUosomc8Uc
## Tests
```
beefy tests/test
```Browse to http://localhost:9966/
View console logs in the browser to see test output.## License
(The MIT License)
Copyright (c) 2013 Anthony Whalley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.