1.0.7 • Published 2 years ago

littledb v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

littledb Build Status

littledb is the littlest key-value database possible based on this awesome gist.

littledb consists of simple JavaScript API to put/get and ls to/from database and simple database server.

To run server, simply install package and run

littledb 80 # without passing some available port will be chosen

or in node.js

const port = 80
require('littledb')().listen(port)

Then you can simply access it with curl:

# save key
curl -d "key;value" localhost  
# save array
curl -d "key;value;value;value" localhost  
# show keys
curl -d "ls" localhost  
# get value
curl -d "key" localhost  
# delete key
curl -d "key;" localhost

To create simple client:

const path = './db.json' // this is default path, not required to be passed
const db = require('littledb')(path)

db.put('hello', 'world') // => "world"
db.get('hello')          // => "world"
db.ls()                  // => [ "hello" ]
db.put('hello')          // => undefined
db.get('hello')          // => undefined
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago