Coder Social home page Coder Social logo

ovyerus / redite Goto Github PK

View Code? Open in Web Editor NEW
25.0 3.0 0.0 398 KB

A Redis wrapper for Node.JS, using ES6 Proxies & native Redis data types.

License: MIT License

JavaScript 100.00%
redis es6-proxies tree redis-connection hash wrapper es6 js node rebridge

redite's Introduction

big nerd

redite's People

Contributors

dependabot[bot] avatar ovyerus avatar sapphicmoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

redite's Issues

Custom inspection to hide sensitive information

This was brought up while working on Clara the other day, where I was made aware that evalling the Redite instance attached to the bot whould reveal the URI for the Redis connection (if supplied). This is due to the bot running util.inspect on all output from the command.

It is possible to override the result of inspecting an object in Node, and we should do so in order to not expose potentially sensitive data.

Convert to async/await syntax

Currently, Redite uses pure promises, which does increase its compatibility with older version of Node (4.x.x without a polyfill such as Bluebird or when), but does make its code flow quite messy to go through. I could try to redo some of the code with promises, however I feel that moving to the new async/await syntax would be a lot easier, as well as making future maintainability much easier, and if a user does need to use/support an earlier version of Node, they can always use something like Babel to transpile it.

Roadmap

I'm pretty happy with where Redite is in terms of functionality and API design however there's a bit of housekeeping I wish to do.

  • Split up some functionality into easy to understand functions to make code base more readable and to enable better unit testing.
  • Benchmarks against Rebridge and maybe the native ioredis/node_redis clients to see where I can speed stuff up (of particular note is my handling in ChildWrapper, probably don't need to make a new one every single time)

I had another idea but I forgot, maybe I'll remember.

Deeply nested setting breaks.

Recently, the method used to set a deeply nested key in a list or hash, broke.

(redite.js, lines 243-249)

stack.slice(2, -1).forEach(key => {
    if (!ref.hasOwnProperty(key)) ref[key] = /^[0-9]+$/.test(key) ? [] : {};
    ref = ref[key];
});

ref[stack.slice(-1)[0]] = value; // Set the final nested value.

This ends up with TypeError: Cannot read property 'bar' of null.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.