An open API service indexing awesome lists of open source software.

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.

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 start

this 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]