collection-adapter

0.1.2 • Public • Published

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

Package Sidebar

Install

npm i collection-adapter

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • 21stio