0.1.2 • Published 8 years ago

collection-adapter v0.1.2

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

nodejs-collection-adapter

Build Status Test Coverage

Provides a simple interface to collection based data stores

Installation

npm install collection-adapter

Supported Services

Usage

Basic Javascript

var adapter = require('collection-adapter').create('redis');

adapter.set("my-collection", "my-key", "my-value").then(function (reply) {
    console.log("Successfully set key");
});

adapter.get("my-collection", "my-key").then(function (value) {
    console.log(value);
});

Advanced Typescript

var adapterFactory = require('collection-adapter');

var redisConfig = new RedisConfig();
redisConfig.port = process.env.REDIS_PORT;
redisConfig.host = process.env.REDIS_HOST;

var adapter = adapterFactory.create('redis', redisConfig);

adapter.set("my-collection", "my-key", "my-value").then(function (reply) {
    console.log("Successfully set key");
});

adapter.get("my-collection", "my-key").then(function (value) {
    console.log(value);
});