All Projects → CapacitorSet → Rebridge

CapacitorSet / Rebridge

Licence: mit
A transparent Javascript interface to Redis.

Programming Languages

javascript
184084 projects - #8 most used programming language
es6
455 projects

Projects that are alternatives of or similar to Rebridge

Crystal Redis
Full featured Redis client for Crystal
Stars: ✭ 345 (-5.99%)
Mutual labels:  redis
Stacker
Stacker - The environment for local web development, ready for use.
Stars: ✭ 356 (-3%)
Mutual labels:  redis
Ledisdb
A high performance NoSQL Database Server powered by Go
Stars: ✭ 3,770 (+927.25%)
Mutual labels:  redis
Dokit
基于 Spring Boot2、 Jpa、 Spring Security、JWT、redis、Vue的前后端分离的后台管理系统开发平台, 用户管理、菜单管理、角色管理、字典管理、权限控制的方式为RBAC,操作日志、异常日志、接口限流、项目支持数据权限管理,支持一键生成前后端代码(支持在线预览及打包下载),支持前端菜单动态路由 可一键部署服务器应用,数据库。系统中活跃用户状态监控,监视当前系统CPU、内存、磁盘、堆栈等相关信息,基于Element UI在线表单设计及生成Vue代码。
Stars: ✭ 348 (-5.18%)
Mutual labels:  redis
Ssm booksystem
ssm demo,ssm详细教程,SSM简明教程:简单的十步教你搭建人生第一个SSM框架[ SSM框架整合教程(spring+spring mvc+mybatis+redis+maven+idea+bootstrap) ]
Stars: ✭ 355 (-3.27%)
Mutual labels:  redis
Redis
Redis commands for Elixir
Stars: ✭ 357 (-2.72%)
Mutual labels:  redis
Hibernate Redis
hibernate 2nd level cache privder using redis
Stars: ✭ 345 (-5.99%)
Mutual labels:  redis
React Component Caching
Speedier server-side rendering with component caching in React 16
Stars: ✭ 365 (-0.54%)
Mutual labels:  redis
Predis Async
Asynchronous PHP client library for Redis built on top of ReactPHP
Stars: ✭ 354 (-3.54%)
Mutual labels:  redis
Phper
一个PHPer的升级之路
Stars: ✭ 362 (-1.36%)
Mutual labels:  redis
Kache
A simple in memory cache written using go
Stars: ✭ 349 (-4.9%)
Mutual labels:  redis
Swapdb
https://github.com/JingchengLi/swapdb/wiki
Stars: ✭ 355 (-3.27%)
Mutual labels:  redis
Interviewguide
计算机校招、社招面试八股文整理,也是《逆袭进大厂》唯一仓库,目前已收录 C/C++ 、操作系统、数据结构、计算机网络、MySQL、Redis等面试资料,未来打算继续收录Java、Python、Go等面试常见问题,坚持将此仓库维护下去。
Stars: ✭ 288 (-21.53%)
Mutual labels:  redis
Ibase4j Springboot
Spring,SpringBoot,SpringMVC,Mybatis,mybatis-plus,motan/dubbo分布式,Redis缓存,Shiro权限管理,Spring-Session单点登录,Quartz分布式集群调度,Restful服务,QQ/微信登录,App token登录,微信/支付宝支付;日期转换、数据类型转换、序列化、汉字转拼音、身份证号码验证、数字转人民币、发送短信、发送邮件、加密解密、图片处理、excel导入导出、FTP/SFTP/fastDFS上传下载、二维码、XML读写、高精度计算、系统配置工具类等等。
Stars: ✭ 348 (-5.18%)
Mutual labels:  redis
Ratelimitj
A Java library for Rate-Limiting, providing extensible storage and application framework adaptors.
Stars: ✭ 362 (-1.36%)
Mutual labels:  redis
Dbngin
DB Engine
Stars: ✭ 344 (-6.27%)
Mutual labels:  redis
Zenko
Zenko is the open source multi-cloud data controller: own and keep control of your data on any cloud.
Stars: ✭ 353 (-3.81%)
Mutual labels:  redis
Node Tutorial
☺️Some of the node tutorial -《Node学习笔记》
Stars: ✭ 364 (-0.82%)
Mutual labels:  redis
Full Stack Notes
全栈工程师手册
Stars: ✭ 366 (-0.27%)
Mutual labels:  redis
His
HIS英文全称 hospital information system(医院信息系统http://59.110.234.89:9999/swagger-ui.html ),医疗信息就诊系统,系统主要功能按照数据流量、流向及处理过程分为临床诊疗、药品管理、财务管理、患者管理。诊疗活动由各工作站配合完成,并将临床信息进行整理、处理、汇总、统计、分析等。本系统包括以下工作站:门诊医生工作站、药房医生工作站、医技医生工作站、收费员工作站、对帐员工作站、管理员工作站。需求为东软提供的云医院。
Stars: ✭ 359 (-2.18%)
Mutual labels:  redis

Rebridge

npm Build Status

Rebridge is a transparent Javascript-Redis bridge. You can use it to create JavaScript objects that are automatically synchronized to a Redis database.

Install

npm install rebridge

Usage

Synchronous, non-blocking usage

const Rebridge = require("rebridge");
const redis = require("redis");

const client = redis.createClient();
const db = new Rebridge(client, {
    mode: "deasync"
});

db.users = [];
db.users.push({
    username: "johndoe",
    email: "[email protected]"
});
db.users.push({
    username: "foobar",
    email: "[email protected]"
});
db.users.push({
    username: "CapacitorSet",
    email: "[email protected]"
});
console.log("Users:", db.users._value); // Prints the list of users
const [me] = db.users.filter(user => user.username === "CapacitorSet");
console.log("Me:", me); // Prints [{username: "CapacitorSet", email: "..."}]
client.quit();

Asynchronous usage

const Rebridge = require("rebridge");
const redis = require("redis");

const client = redis.createClient();
const db = new Rebridge(client);

db.users.set([])
    .then(() => Promise.all([
        db.users.push({
            username: "johndoe",
            email: "[email protected]"
        }),
        db.users.push({
            username: "foobar",
            email: "[email protected]"
        }),
        db.users.push({
            username: "CapacitorSet",
            email: "[email protected]"
        })
    ]))
    .then(() => db.users._promise)
    .then(arr => console.log("Users:", arr)) // Prints the list of users
    .then(() => db.users.filter(user => user.username === "CapacitorSet"))
    .then(([me]) => console.log("Me:", me)) // Prints [{username: "CapacitorSet", email: "..."}]
    .then(() => client.quit())
    .catch(err => console.log("An error occurred:", err));

Requirements

Rebridge uses ES6 Proxy objects, so it requires at least Node 6.

Limitations

  • By default, Rebridge objects can't contain functions, circular references, and in general everything for which x === JSON.parse(JSON.stringify(x)) doesn't hold true. However, you can use a custom serialization function (see below).

  • Obviously, you cannot write directly to db (i.e. you can't do var db = Rebridge(); db = {"name": "foo"}).

Custom serialization

By default, Rebridge serializes to JSON, but you can pass a custom serialization function. For instance, if you wanted to serialize to YAML, you would do something like this:

const yaml = require("js-yaml");
const db = new Rebridge(client, {
    serialize: yaml.dump,
    deserialize: yaml.load
});

How it works

Rebridge() returns an ES6 Proxy object around {}. When you try to read one of its properties, the getter intercepts the call, retrieves and deserializes the result from the database, and returns that instead; the same happens when you write to it.

The Proxy will forward the native methods and properties transparently, so that the objects it returns should behave the same as native objects; if this is not the case, file an issue on GitHub.

First-level objects (eg. db.foo) correspond to keys in the Redis database; they are serialized using JSON. When requesting deeper objects (eg. db.foo.bar.baz), the first-level object (db.foo) is deserialized to a native object, which is then accessed in the standard way.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].