{"id":18470363,"url":"https://github.com/aliencreations/redistub","last_synced_at":"2026-06-17T16:38:59.732Z","repository":{"id":57349941,"uuid":"46004598","full_name":"AlienCreations/redistub","owner":"AlienCreations","description":null,"archived":false,"fork":false,"pushed_at":"2020-04-16T17:03:55.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-11T00:57:22.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlienCreations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-11T19:27:31.000Z","updated_at":"2020-04-16T17:03:57.000Z","dependencies_parsed_at":"2022-09-16T02:10:15.744Z","dependency_job_id":null,"html_url":"https://github.com/AlienCreations/redistub","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Fredistub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Fredistub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Fredistub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Fredistub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlienCreations","download_url":"https://codeload.github.com/AlienCreations/redistub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253501848,"owners_count":21918326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T10:13:44.026Z","updated_at":"2025-10-26T00:33:12.437Z","avatar_url":"https://github.com/AlienCreations.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redistub\nA Redis shell with no state, meant for testing controllers which check cache before using a model.\n\n[![Build Status](https://travis-ci.org/AlienCreations/redistub.svg?branch=master)](https://travis-ci.org/AlienCreations/redistub) [![Coverage Status](https://coveralls.io/repos/AlienCreations/redistub/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/AlienCreations/redistub?branch=master) [![npm version](http://img.shields.io/npm/v/redistub.svg)](https://npmjs.org/package/redistub) [![Dependency Status](https://david-dm.org/AlienCreations/redistub.svg)](https://david-dm.org/AlienCreations/redistub)\n\n## Install\n\n```\n$ npm install redistub --save\n```\n\nRun the specs\n\n```\n$ npm test\n```\n\n## Supported Redis client API stubs\n\n#### createClient\nCreates a new stateless API.\n\n```js\n\nvar redis       = require('redistub'),\n    redisClient = redis.createClient();\n\n// Now use redisClient as you intend to in production and write your tests to assume redis is offline.\n\n```\n\n#### createClient -\u003e get\nNormally used to get an item from the Redis store, this method will always\nreturn `null` for both `err` and `val`\n\n```js\n\nvar redis       = require('redistub'),\n    redisClient = redis.createClient();\n\nredisClient.get('someCacheKey', function(err, val) {\n  // err will always be null\n  // val will always be null\n});\n\n```\n\n#### createClient -\u003e mget\nNormally used to get an array of items from the Redis store, this method will always\nreturn `null` for both `err` and `val`\n\n```js\n\nvar redis       = require('redistub'),\n    redisClient = redis.createClient();\n\nredisClient.mget(['someCacheKey', 'someOtherCacheKey'], function(err, val) {\n  // err will always be null\n  // val will always be null\n});\n\n```\n\n#### createClient -\u003e set\nNormally used to set an item in the Redis store, this\nmethod will always return `null` for `err` and `OK` for `res`\n\n```js\n\nvar redis       = require('redistub'),\n    redisClient = redis.createClient();\n\nredisClient.set('someCacheKey', 'someVal', function(err, res) {\n  // err will always be null\n  // res will always be OK\n});\n\n```\n\n#### createClient -\u003e expire\nNormally used to set an expiration ttl for an item in the Redis store, this\nmethod will always return `null` for `err` and `1` for `affectedItems`\n\n```js\n\nvar redis       = require('redistub'),\n    redisClient = redis.createClient();\n\nredisClient.expire('someCacheKey', 3600, function(err, affectedItems) {\n  // err will always be null\n  // affectedItems will always be 1\n});\n\n```\n\n#### createClient -\u003e del\nNormally used to remove an item from the Redis store, this\nmethod will always return `null` for `err` and `1` for `affectedItems`\n\n```js\n\nvar redis       = require('redistub'),\n    redisClient = redis.createClient();\n\nredisClient.del('someCacheKey', 'someVal', function(err, affectedItems) {\n  // err will always be null\n  // affectedItems will always be 1\n});\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliencreations%2Fredistub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliencreations%2Fredistub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliencreations%2Fredistub/lists"}