JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q48779F
  • License LGPL-3.0

RDB warm cache module based upon https://gist.github.com/threepointone/62dd587d42819fc72284

Package Exports

  • rethinkdb-cache

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rethinkdb-cache) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rethinkdb-cache

RDB warm cache module based upon https://gist.github.com/threepointone/62dd587d42819fc72284

How to use?

Simple, just install it, require it and use it

  • Install it:

npm install rethinkdb-cache

  • Require it:
    /**
     * @params {object} rdbSettings (optional)
     * @params {string} tableName (optional)
     *
     */
    var rdbCache = require('rethinkdb-cache'),
        CACHE = new rdbCache(rdbSettings, tableName);
  • rdbSettings: RethinkDB connection settings

  • tableName: Name of the table you want to use as cache table

  • Usage:

      if (!CACHE.retrieve("some-key")) {
        // Not-in-cache-logic goes here...
        CACHE.send("some-key", data);

      }
      else {
        // Return from cache
        var myData = JSON.parse(CACHE.retrieve("some-key")).val;
      }