https://github.com/homuchen/leveldb-tcp-server
A redis compatible protocal levelDB tcp server.
https://github.com/homuchen/leveldb-tcp-server
database level leveldb nodejs redis redis-protocol tcp-server
Last synced: 2 months ago
JSON representation
A redis compatible protocal levelDB tcp server.
- Host: GitHub
- URL: https://github.com/homuchen/leveldb-tcp-server
- Owner: HoMuChen
- Created: 2020-04-30T07:39:20.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-27T18:11:40.000Z (about 4 years ago)
- Last Synced: 2025-02-05T08:50:59.434Z (4 months ago)
- Topics: database, level, leveldb, nodejs, redis, redis-protocol, tcp-server
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/leveldb-tcp-server
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# leveldb-tcp-server
A redis compatible protocal levelDB tcp server
## Usage
$ npm install leveldb-tcp-server
```javascript
const Server = require('leveldb-tcp-server');const server = new Server({
port: 2407,
dbPath: './test'
})server.run();
```
or
$ git clone https://github.com/HoMuChen/leveldb-tcp-server.git
$ cd leveldb-tcp-server
$ npm run startthis script will default run a server listening on port 2407 and create a directory test for the leveldb data.
## Client access
Application protocal is compatible with redis protocal, so we can use redis client library to access db.
```javascript
const redis = require('redis')const client = redis.createClient({ port: 2407 });
client.set("key", "123", (err, result) => {
client.get("key", (err, result) => {
console.log(result)
});
});
```For now, I only implement the get, set and del command.
## Author
HoMuchen - [email protected]