{"id":23145831,"url":"https://github.com/devboidesigns/redis-wrapper","last_synced_at":"2026-04-26T12:32:16.562Z","repository":{"id":265675094,"uuid":"896453495","full_name":"DevboiDesigns/redis-wrapper","owner":"DevboiDesigns","description":"This library provides a wrapper around Redis 🔴 to facilitate common operations such as setting and getting values, managing sessions, and handling analytics data. It uses redis for Redis client operations, connect-redis for session store, and express-session for session management.","archived":false,"fork":false,"pushed_at":"2024-12-06T07:51:42.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T22:42:52.881Z","etag":null,"topics":["redis","redis-cache"],"latest_commit_sha":null,"homepage":"https://redis.io","language":"TypeScript","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/DevboiDesigns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-30T12:05:31.000Z","updated_at":"2024-12-06T07:51:45.000Z","dependencies_parsed_at":"2024-12-01T16:49:08.310Z","dependency_job_id":null,"html_url":"https://github.com/DevboiDesigns/redis-wrapper","commit_stats":null,"previous_names":["devboidesigns/redis-wrapper"],"tags_count":1,"template":false,"template_full_name":"DevboiDesigns/NPMTemplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevboiDesigns%2Fredis-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevboiDesigns%2Fredis-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevboiDesigns%2Fredis-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevboiDesigns%2Fredis-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevboiDesigns","download_url":"https://codeload.github.com/DevboiDesigns/redis-wrapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182340,"owners_count":20897379,"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":["redis","redis-cache"],"created_at":"2024-12-17T16:16:44.179Z","updated_at":"2026-04-26T12:32:16.521Z","avatar_url":"https://github.com/DevboiDesigns.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis API Wrapper\n\n## Overview\n\nThis library provides a wrapper around Redis to facilitate common operations such as setting and getting values, managing sessions, and handling analytics data. It uses `redis` for Redis client operations, `connect-redis` for session store, and `express-session` for session management.\n\n## Environment Variables\n\nThe following environment variables are used to configure the Redis client:\n\n- `SESSION_SECRET`: Secret key for session management.\n- `REDIS_PASSWORD`: Password for Redis authentication.\n- `REDIS_HOST`: Hostname for the Redis server.\n- `REDIS_PORT`: Port number for the Redis server.\n- `IS_LOCAL`: Flag to indicate if the environment is local.\n- `IS_CONTAINER`: Flag to indicate if the app is running in a docker container.\n- `REDIS_LOCAL_URL`: URL for the local Redis server.\n\nThese variables are imported from the [env.keys.ts](src/config/env.keys.ts) file.\n\n## Types\n\n### RedisAnalyticsType\n\nDefines the types of analytics data that can be stored in Redis:\n\n- `\"registered\"`\n- `\"signed_in\"`\n- `\"signed_out\"`\n- `\"viewed\"`\n\n### RedisDirectory\n\nDefines the directories (or namespaces) used in Redis:\n\n- `\"view_count\"`\n- `\"logs\"`\n- `\"users\"`\n- `\"posts\"`\n\n## Usage\n\nTo use this library, import the `RedisLib` class and initialize it:\n\n```typescript\nimport RedisLib from \"./libs/redis.lib\"\n\n// Initialize Redis client\nconst redisLib = new RedisLib()\nawait redisLib.initRedisClient()\n```\n\n## Methods\n\n`initRedisClient`\n\n- Initializes the Redis client and sets up session management.\n\n`close`\n\n- Closes the Redis client connection.\n\n`setAnalyticsValue`\n\n- Sets an analytics value in Redis.\n\n`setData`\n\n- Sets a data value in Redis.\n\n`setDataWithExpiry`\n\n- Sets a data value in Redis with an expiry time.\n\n`setValue`\n\n- Sets a string or number value in Redis.\n\n`setValueToExp`\n\n- Sets a string value in Redis with an expiry time.\n\n`getData`\n\n- Gets a data value from Redis.\n\n`getValue`\n\n- Gets a string or number value from Redis.\n\n`removeValue`\n\n- Removes a value from Redis.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevboidesigns%2Fredis-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevboidesigns%2Fredis-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevboidesigns%2Fredis-wrapper/lists"}