@atakan75/elysia-redis
TypeScript icon, indicating that this package has built-in type declarations

0.1.8 • Public • Published

@Atakan75/elysia-redis

Redis plugin for Elysia.js

Installation

bun add @atakan75/elysia-redis

Usage

import { Elysia, t } from 'elysia';
import { redis } from '@Atakan75/elysia-redis';

const app = new Elysia()
    .use(redis())
    .get('/', async ({ redis }) => {
        await redis.set('elysia', 'redis', 60);
        const data = await redis.get('elysia');
        if (!data) {
            throw new Error('No data found');
        }
        return data;
    });

console.log(`Listening on http://${app.server!.hostname}:${app.server!.port}`)

Checkout the tests folders on github.

Need To Know

First of all, if you define REDIS_URL in the env file, it will take the value you enter. If you do not define anything, it will connect to the redis server installed in your local.

License

MIT

Package Sidebar

Install

npm i @atakan75/elysia-redis

Weekly Downloads

10

Version

0.1.8

License

MIT

Unpacked Size

8.53 kB

Total Files

8

Last publish

Collaborators

  • atakan75