@apihub24/in-memory-sessions
v2.0.0-alpha.0
Published
A Service to store Sessions in Memory.
Readme
InMemory Sessions
A Service to store Sessions in Memory.
Install
npm i --save @apihub24/in-memory-sessionsDependencies
| Exported Injection Keys | | ------------------------- | | @apihub24/session_service |
Usage
// NestJs usage
import { InMemorySessionsModule } from "@apihub24/in-memory-sessions";
@Module({
imports: [InMemorySessionsModule.forRoot()]
})
...
// Other usage
import { InMemorySessionsModule } from "@apihub24/in-memory-sessions";
const sessionService = new InMemorySessionService();| Function | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------------------- | | create(account: IAccount): Promise | Create a new Session from a IAccount and returns it | | getBy(filter: (account: IAccount) => boolean): Promise<ISession[]> | get a ISession by a IAccount filter | | getById(sessionId: string): Promise | get a ISession by a session id. the returned ISession can be null if not exists | | remove(sessionId: string): Promise | remove the ISession by a session id. |
