Skip to content

Data storage using Redis, file-system or local-storage (for client side).

Notifications You must be signed in to change notification settings

Colored-Coins/datastorage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datastorage

Build Status Coverage Status npm version

js-standard-style

Installation

$ npm i data-storage

Usage

var DataStorage = require('data-storage')
var ds = new DataStorage()
ds.once('connect', function () {
  console.log('data-storage is now initialized')
})
ds.init()

API

Constructor:

DataStorage(settings)

where settings is an object of these properties:

{
  redisPort: 6379,
  redisHost: '127.0.0.1',
  redisUrl: '127.0.0.1:6379'  // if specified, redisPort and redisHost are ignored
}

Member methods:

DataStorage.prototype.set(key, value)
DataStorage.prototype.get(key, callback)
DataStorage.prototype.hset(hash, key, callback)
DataStorage.prototype.hget(hash, key, callback)
DataStorage.prototype.hkeys(hash, callback)

Testing

$ mocha

License

Apache-2.0

About

Data storage using Redis, file-system or local-storage (for client side).

Resources

Stars

Watchers

Forks

Packages

No packages published