Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
jiawei397/deno-nestIt is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
58%
Published
9 months ago (0.0.3)
@nest/redis
This is a redis module for deno_nest
.
The default redis client is npm:@redis/client@^1
.
example
Add import map in deno.json
:
{ "imports": { "@nest/core": "jsr:@nest/core@^0.0.1", "@nest/hono": "jsr:@nest/hono@^0.0.1", "@nest/redis": "jsr:@nest/redis@^0.0.2", } }
app.module.ts:
import { Module } from "@nest/core"; import { createStore, RedisModule } from "@nest/redis"; import { CacheModule } from "@nest/cache"; import { AppController } from "./app.controller.ts"; @Module({ imports: [ RedisModule.forRoot({ url: "redis://default:xxx@10.100.30.65:6379/1", }), CacheModule.register({ ttl: 30, store: createStore, isDebug: true, }), ], controllers: [AppController], }) export class AppModule {}
Then can be used in AppController:
import { Controller, Get, Inject, UseInterceptors } from "@nest/core"; import { CacheInterceptor, SetCacheStore } from "@nest/cache"; import { type Redis, REDIS_KEY, RedisService } from "@nest/redis"; @Controller("") export class AppController { constructor(private readonly redisService: RedisService) {} @Get("/") version() { this.redisService.set("version", "1.0.0"); return this.redisService.get("version"); } }
More can see the example dir.
Built and signed on
GitHub Actions
Add Package
deno add jsr:@nest/redis
Import symbol
import * as redis from "@nest/redis";
Import directly with a jsr specifier
import * as redis from "jsr:@nest/redis";
Add Package
pnpm i jsr:@nest/redis
pnpm dlx jsr add @nest/redis
Import symbol
import * as redis from "@nest/redis";
Add Package
yarn add jsr:@nest/redis
yarn dlx jsr add @nest/redis
Import symbol
import * as redis from "@nest/redis";
Add Package
vlt install jsr:@nest/redis
Import symbol
import * as redis from "@nest/redis";
Add Package
npx jsr add @nest/redis
Import symbol
import * as redis from "@nest/redis";
Add Package
bunx jsr add @nest/redis
Import symbol
import * as redis from "@nest/redis";