1.7.0 • Published 9 months ago

@xnestjs/redisess v1.7.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

@xnestjs/redisess

NestJS extension library for Redisess

Install

npm install @xnestjs/redisess
# or using yarn
yarn add @xnestjs/redisess

Usage

Register sync

An example of nestjs module that import the @xnestjs/mongodb

// module.ts
import { Module } from '@nestjs/common';
import { RedisessModule } from '@xnestjs/redisess';

const client = new Redis();

@Module({
    imports: [
        RedisessModule.forRoot({
            useValue: {
                client,
                namespace: 'sessions',
            },
        }),
    ],
})
export class MyModule {
}

Register async

An example of nestjs module that import the @xnestjs/mongodb async

// module.ts
import { Module } from '@nestjs/common';
import { RedisessModule } from '@xnestjs/redisess';

const client = new Redis();

@Module({
    imports: [
        RedisessModule.forRootAsync({
            inject: [ConfigModule],
            useFactory: (config: ConfigService) => ({
                client,
                namespace: config.get('SESSION_NAMESPACE'),
            }),
        }),
    ]
})
export class MyModule {
}

Environment Variables

The library supports configuration through environment variables. Environment variables below is accepted. All environment variables starts with prefix (RMQ_). This can be configured while registering the module.

<--- BEGIN env --->

Environment VariableTypeDefaultDescription
SESSION_NAMESPACEString
SESSION_TTLNumber1800Time-To-Live value in seconds
SESSION_WIPE_INTERVALNumber5000Interval in ms to run wipe process

<--- END env --->

1.7.0

9 months ago

1.6.4

9 months ago

1.6.3

9 months ago

1.6.2

9 months ago

1.5.3

9 months ago

1.6.1

9 months ago

1.5.2

9 months ago

1.6.0

9 months ago

1.2.6

9 months ago

1.5.1

9 months ago

1.2.4

9 months ago

1.5.0

9 months ago

1.3.1

9 months ago

1.2.0

11 months ago

1.2.3

11 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.1.0

11 months ago

1.0.2

11 months ago

1.0.1

12 months ago

0.10.4

1 year ago

0.10.0

1 year ago

0.9.0

1 year ago

0.8.2

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.7.1

2 years ago

0.7.0

2 years ago

0.1.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.0.1

3 years ago