0.2.1 • Published 5 years ago

tanagra-protobuf-redis-cache v0.2.1

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

tanagra

A simple, lightweight node.js serialization library supporting ES6 classes (including Maps). Currently serializes to both JSON and Google Protobuf formats.

Overview

This helper library saves the serialized output of tanagra-protobuf to redis, including the schema information used in deserializing the data.

Installation

$ npm add --save tanagra-protobuf-redis-cache

Usage

const redis = require('redis')
const protobuf = require('tanagra-protobuf')
const redisCache = require('tanagra-protobuf-redis-cache')

const redisClient = redis.createClient({
  host: 'localhost',
  port: 6379
})

const foo = new Foo()
const encoded = protobuf.encodeEntity(foo)
await redisCache.set(redisClient, 'foo', encoded)

...

const fromRedis = await redisCache.get(redisClient, 'foo')
const decoded = protobuf.decodeEntity(fromRedis, Foo)
0.2.1

5 years ago

0.2.0

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago