{"library":"serverless-offline-redis-server","title":"Serverless Offline Redis Server","description":"serverless-offline-redis-server is a Serverless Framework plugin designed to launch a local Redis server specifically for local development workflows using `serverless-offline`. The package, currently at version 0.0.2, integrates with the `serverless offline start` command to automatically manage a Redis instance alongside your serverless functions. Its primary differentiation lies in simplifying the setup of a local Redis instance within the Serverless Offline ecosystem, eliminating the need for manual Redis server management during development. It acts as a wrapper for the `redis-server` npm package, allowing users to configure Redis properties like port directly in their `serverless.yml`. The release cadence appears to be infrequent given its early version.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install serverless-offline-redis-server"],"cli":null},"imports":["plugins:\n    - serverless-offline-redis-server","custom:\n  redis:\n    port: 8888\n    # ... other redis-server options"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"npm install --save-dev serverless-offline-redis-server\n\n# Ensure Redis server is installed locally via your OS package manager (e.g., 'brew install redis' on macOS).\n\n# serverless.yml\nservice: my-redis-service\n\nplugins:\n  - serverless-offline\n  - serverless-offline-redis-server\n\ncustom:\n  redis:\n    port: 6379 # Default Redis port\n    bind: 127.0.0.1 # Bind to localhost\n    # Additional redis-server options can be added here\n\nprovider:\n  name: aws\n  runtime: nodejs18.x\n\nfunctions:\n  hello:\n    handler: handler.hello\n    events:\n      - http:\n          path: hello\n          method: get\n\n# handler.js (example usage)\nconst Redis = require('ioredis');\nconst redis = new Redis({ port: 6379, host: '127.0.0.1' });\n\nmodule.exports.hello = async (event) => {\n  await redis.set('mykey', 'myvalue');\n  const value = await redis.get('mykey');\n  return {\n    statusCode: 200,\n    body: JSON.stringify({ message: `Redis value: ${value}` }),\n  };\n};\n\n# To run:\nnpx serverless offline start","lang":"javascript","description":"This quickstart demonstrates how to install the plugin, configure it in `serverless.yml` to launch a local Redis server, and connect to it from a Serverless function during local development.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}