nestjs-redis

Redis module for Nest framework (node.js). Support node-redis & ioredis.

MIT License

Downloads
316.3K
Stars
384
Committers
3

Bot releases are visible (Hide)

nestjs-redis - v7.0.0-rc.1

Published by liaoliaots over 2 years ago

7.0.0-rc.1 - 2022-03-10

Changed

  • remove redis-errors from dependencies, use custom errors instead of it
  • remove unnecessary test.ts

Fixed

  • fix a worker process failed to exit when testing

NOTE: This version is deprecated.

nestjs-redis - v7.0.0-alpha.2

Published by liaoliaots over 2 years ago

7.0.0-alpha.2 - 2022-03-10

Fixed

  • fix falsy 0 when using memoryThreshold
  • update messages
  • update code comments
nestjs-redis - v7.0.0-alpha.1

Published by liaoliaots over 2 years ago

7.0.0-alpha.1 - 2022-03-09

BREAKING CHANGES ⚠️

  • refactor health checks
nestjs-redis - v6.0.0

Published by liaoliaots over 2 years ago

6.0.0 - 2022-02-20

BREAKING CHANGES ⚠️

  • remove exports for RedisStatus and ClusterStatus, those should be used internally (#189) (531af150efc4a06e032479123e173650c374bca9)

  • change default namespace from Symbol('default') to 'default' for best readability of the logs. Please note that you shouldn't have multiple client without a namespace, or with the same namespace, otherwise they will get overridden. (#189) (3849b488b3076ead01b9269158ccbc24eb3bacc0)

export const DEFAULT_REDIS_NAMESPACE = 'default'; // redis
export const DEFAULT_CLUSTER_NAMESPACE = 'default'; // cluster

Fixed

  • use correct approach instead of instanceof to prevent some bugs in realms environment (#189) (08d7ede4baed69090e1e152c6fd2573bcd68297d)

Added

  • add isGlobal option as the second param to control whether the module is global-scoped and set its default value to true (#189) (617d204689398fa2e3ca7408864ffd84536b2429)
// redis
static forRoot(options: RedisModuleOptions = {}, isGlobal = true): DynamicModule;
static forRootAsync(options: RedisModuleAsyncOptions, isGlobal = true): DynamicModule;
// cluster
static forRoot(options: ClusterModuleOptions, isGlobal = true): DynamicModule;
static forRootAsync(options: ClusterModuleAsyncOptions, isGlobal = true): DynamicModule;

Security

  • update npm dependencies

Changed

  • update project config: ci, template, eslint, package, docker-compose.yml, etc
  • update code comments for checkHealth
  • extract common utils
  • update messages for health
  • update unit tests and e2e tests
  • docs: add v5 docs, update README.md, update redis, cluster, health
nestjs-redis - v5.2.0

Published by liaoliaots almost 3 years ago

5.2.0 - 2021-12-10

Added

  • add RedisService, this is an alias for RedisManager
  • add ClusterService, this is an alias for ClusterManager

Changed

  • simplify quitClients logic, remove unnecessary async/await
  • update dependencies
  • update 01-testing-inject
  • update docs
  • update tests
nestjs-redis - v5.1.1

Published by liaoliaots almost 3 years ago

5.1.1 - 2021-11-19

From version 5.1.1, the release information follows the keep a changelog format to maintain a human readable changelog.

Fixed

  • fix missing PromiseSettledResult, use polyfill instead of it
  • fix jest does not exit

Changed

  • change nodejs version from 16 to 14
  • change es version from es2021 to es2017
  • update dependencies
  • update hooks
  • update docs
nestjs-redis - v5.1.0

Published by liaoliaots almost 3 years ago

What's Changed

New

  • support nestjs 7.x

Maintenance

  • update docs
  • update ci
nestjs-redis - v5.0.1

Published by liaoliaots almost 3 years ago

What's Changed

Maintenance

  • update comments (#132)
  • update docs
  • update dependencies
nestjs-redis - v5.0.0

Published by liaoliaots about 3 years ago

What's Changed

⚠️ BREAKING CHANGES

  • The default redis client will not be created if you do not specify the config option.

Migration from v4 to v5

If your redis server does not have a password, the host is 127.0.0.1 and the port is 6379:

v4

The default redis client will be created if you do not specify the config option:

import { Module } from '@nestjs/common';
import { RedisModule } from '@liaoliaots/nestjs-redis';

@Module({
    imports: [RedisModule.forRoot()]
})
export class AppModule {}

v5

The default redis client will not be created if you do not specify the config option, so you have to specify the config option:

import { Module } from '@nestjs/common';
import { RedisModule } from '@liaoliaots/nestjs-redis';

@Module({
    imports: [RedisModule.forRoot({ closeClient: true, config: { host: '127.0.0.1', port: 6379 } })]
})
export class AppModule {}

Documentation

  • update readme menu
  • update examples
  • update redis
nestjs-redis - v4.1.3

Published by liaoliaots about 3 years ago

What's Changed

Improvements

  • refactor quit clients

Maintenance

  • add global e2e test
  • remove combination e2e test
  • update README.md
  • update ISSUE_TEMPLATE
  • update dependencies
nestjs-redis - v4.1.2

Published by liaoliaots about 3 years ago

What's Changed

Bug Fixes

  • set default options correctly for useFactory (#129)
  • add missing redis status monitoring (#129)
nestjs-redis - v4.1.1

Published by liaoliaots about 3 years ago

What's Changed

Bug Fixes

  • default config option to object (#128)
nestjs-redis - v4.1.0

Published by liaoliaots about 3 years ago

What's Changed

New

  • add extraProviders async option
  • export RedisStatus and ClusterStatus for some use cases

Bug Fixes

  • await clients quit instead of .catch()

Improvements

  • remove unnecessary wrapper module to increase perf

Maintenance

  • use redis-errors lib instead of custom error
  • add default module options to prevent some possible issues
  • update messages
  • update api comments
  • add engines field
  • update README.md, redis/cluster docs
  • update dependencies
nestjs-redis - v4.0.1

Published by liaoliaots about 3 years ago

What's Changed

Maintenance

  • update code comments (#111)

Documentation

  • update README.md
  • update redis/cluster
nestjs-redis - v4.0.0

Published by liaoliaots about 3 years ago

What's Changed

⚠️ BREAKING CHANGES

  • [redis] rename RedisService to RedisManager for better semantics, no other changes (#110)
  • [cluster] rename ClusterService to ClusterManager for better semantics, no other changes (#110)

Migration from v3 to v4

v3

import { RedisService, ClusterService } from '@liaoliaots/nestjs-redis';

v4

import { RedisManager, ClusterManager } from '@liaoliaots/nestjs-redis';

Documentation

  • update examples

Maintenance

  • update dependencies
  • update github actions
nestjs-redis - v3.1.1

Published by liaoliaots about 3 years ago

What's Changed

Bug Fixes

  • fix error messages typo (#108)

Documentation

  • update redis/cluster
  • update README.md

Maintenance

  • update dependencies
  • update 01-testing-inject sample
nestjs-redis - v3.1.0

Published by liaoliaots about 3 years ago

What's Changed

New

redis

  • add new readyLog option to display a message on client ready (#107)

cluster

  • add new readyLog option to display a message on client ready (#107)

Maintenance

redis

  • change default namespace to Symbol('default') (#107)
  • update message of quitClients (#107)

cluster

  • change default namespace to Symbol('default') (#107)
  • update message of quitClients (#107)

Documentation

  • fix menu links
  • update redis/cluster docs
  • update examples
  • update health checks
nestjs-redis - v3.0.0

Published by liaoliaots about 3 years ago

What's Changed

⚠️ BREAKING CHANGES

  • drop support for @nestjs/terminus@next - please use v8

redis

  • rename DEFAULT_REDIS_CLIENT to DEFAULT_REDIS_NAMESPACE (#66)
  • rename ClientOptions to RedisClientOptions (#98)
  • rename defaultOptions to commonOptions (#98)

cluster

  • rename DEFAULT_CLUSTER_CLIENT to DEFAULT_CLUSTER_NAMESPACE (#66)
  • rename ClientOptions to ClusterClientOptions (#98)

health checks

  • if you don't use health check, you don't have to install @nestjs/terminus
  • rename check to checkHealth

For now, you need to import RedisHealthModule and RedisHealthIndicator via:

import { RedisHealthModule, RedisHealthIndicator } from '@liaoliaots/nestjs-redis/health';
  1. add RedisHealthModule to imports list of @Module() decorator
  2. inject RedisHealthIndicator provider into our service, controller, etc
  3. pass the redis or cluster client to it

Bug Fixes

  • avoid provider overridden (#85) (#95)

New

redis:

  • add getRedisToken to get internal DI token (#95)

cluster:

  • add getClusterToken to get internal DI token (#95)

Maintenance

  • update dependencies
  • preserve code comments
  • update github actions, add unit-testing action
  • update error messages
  • use fastify for e2e testing
  • update unit and e2e tests
  • update config
nestjs-redis - v3.0.0-next.3

Published by liaoliaots over 3 years ago

What's Changed

Bug Fixes

  • make quit promise safe
  • use quit for status ready, otherwise use disconnect (#56)

Documentation

  • update test coverage
  • update menus
  • other updates
nestjs-redis - v3.0.0-next.2

Published by liaoliaots over 3 years ago

What's Changed

Maintenance

  • remove unnecessary packages check

Documentation

  • update test coverage
  • update dependency graph