Registry / devops / serverless-offline-redis-server

serverless-offline-redis-server

JSON →
library0.0.2jsnpmunverified

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.

npm install serverless-offline-redis-server
INSTALL
IMPORT
SIG · SERVERLESS-OFFLINE
S
serverless-offline-redis-server
devopsjavascriptv0.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Plugin integration
plugins: - serverless-offline-redis-server
import { ServerlessOfflineRedisServer } from 'serverless-offline-redis-server'
This package is a Serverless plugin and is integrated via the `plugins` section in `serverless.yml`, not through JavaScript `import` or `require` statements in application code.
Configuration
custom: redis: port: 8888 # ... other redis-server options
plugins: serverless-offline-redis-server: port: 8888
Configuration for the Redis server is passed via the `custom.redis` property in `serverless.yml`, adhering to the options accepted by the underlying `redis-server` npm package.

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.

npm install --save-dev serverless-offline-redis-server # Ensure Redis server is installed locally via your OS package manager (e.g., 'brew install redis' on macOS). # serverless.yml service: my-redis-service plugins: - serverless-offline - serverless-offline-redis-server custom: redis: port: 6379 # Default Redis port bind: 127.0.0.1 # Bind to localhost # Additional redis-server options can be added here provider: name: aws runtime: nodejs18.x functions: hello: handler: handler.hello events: - http: path: hello method: get # handler.js (example usage) const Redis = require('ioredis'); const redis = new Redis({ port: 6379, host: '127.0.0.1' }); module.exports.hello = async (event) => { await redis.set('mykey', 'myvalue'); const value = await redis.get('mykey'); return { statusCode: 200, body: JSON.stringify({ message: `Redis value: ${value}` }), }; }; # To run: npx serverless offline start
Debug
Known issues
gotchaThis plugin requires a native Redis server executable to be installed on the host machine. It does not bundle or automatically install Redis itself. Failure to install Redis will result in runtime errors when `serverless offline` attempts to start the Redis server.
fix
Ensure Redis server is installed and accessible in your system's PATH. For macOS, `brew install redis` is common. For other OSes, refer to the official Redis documentation.
affects: >=0.0.1
breakingThe plugin is currently at version 0.0.2, indicating an early development stage. APIs and configuration options may be subject to frequent changes without strict adherence to SemVer between minor versions.
fix
Monitor the project's GitHub repository for updates and breaking changes before upgrading. Test thoroughly after any updates.
affects: >=0.0.1
gotchaThis plugin is strictly for local development with `serverless-offline`. It is not intended for deployment to production environments or for managing Redis instances in the cloud. Using it outside of `serverless offline start` will have no effect.
fix
Ensure this plugin is listed under `devDependencies` and only used during local development. For production, use managed Redis services or deploy a Redis cluster appropriately.
affects: >=0.0.1
Errors
Common errors & fixes
Redis server failed to start: Error: spawn redis-server ENOENT
The native Redis server executable is not installed on the system or is not in the system's PATH.
fix
Install Redis server for your operating system (e.g., `brew install redis` on macOS, `apt-get install redis-server` on Debian/Ubuntu, or download from redis.io).
Error: Port 6379 already in use.
Another process is already using the specified Redis port (default 6379).
fix
Change the `port` in your `custom.redis` configuration in `serverless.yml` to an available port, or stop the process currently using the port.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
serverless-offlinerequiredPeer dependency, required for plugin functionality within the Serverless Offline environment.
Redis Server (native)requiredThis plugin requires the native Redis server executable to be installed locally on the development machine.
Agent activity
15 hits · last 30 days
node
12
Meta
1
Amazon
1
Resources
serverless-offline-redis-server — npm install serverless-offline-redis-server · libregistry