colllection-adapter

0.1.1 • Public • Published

nodejs-collection-adapter

Build Status Test Coverage

Provides a simple interface to collection based data stores

Currently supports

Basic usage

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);
});

Typescript usage

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);
});

/colllection-adapter/

    Package Sidebar

    Install

    npm i colllection-adapter

    Weekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • 21stio