{"id":17949550,"url":"https://github.com/mrtenz/typeorm-store","last_synced_at":"2025-07-28T19:41:04.919Z","repository":{"id":31997512,"uuid":"131332384","full_name":"Mrtenz/typeorm-store","owner":"Mrtenz","description":"A TypeORM-based store for express-session.","archived":false,"fork":false,"pushed_at":"2024-02-27T17:21:32.000Z","size":417,"stargazers_count":16,"open_issues_count":6,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-02T06:11:21.305Z","etag":null,"topics":["express","express-session","nodejs","typeorm","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mrtenz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-27T18:35:09.000Z","updated_at":"2024-07-09T14:05:01.000Z","dependencies_parsed_at":"2023-12-01T22:27:10.493Z","dependency_job_id":"0a0e69fa-ea30-4e51-ac9f-6a580cf2e303","html_url":"https://github.com/Mrtenz/typeorm-store","commit_stats":{"total_commits":40,"total_committers":5,"mean_commits":8.0,"dds":0.35,"last_synced_commit":"a008b777fd0aa1d2b04dcaca2d7800cf1858bcf5"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Mrtenz/typeorm-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mrtenz%2Ftypeorm-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mrtenz%2Ftypeorm-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mrtenz%2Ftypeorm-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mrtenz%2Ftypeorm-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mrtenz","download_url":"https://codeload.github.com/Mrtenz/typeorm-store/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mrtenz%2Ftypeorm-store/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267576722,"owners_count":24110318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","express-session","nodejs","typeorm","typescript"],"created_at":"2024-10-29T09:26:47.180Z","updated_at":"2025-07-28T19:41:04.893Z","avatar_url":"https://github.com/Mrtenz.png","language":"TypeScript","readme":"# typeorm-store\nA TypeORM-based store for [express-session](https://github.com/expressjs/session).\n\n## Installation\n```bash\n$ yarn add typeorm-store\n```\n\n## Usage\nFirst, make a new `Session` entity. Make sure to synchronize the entity to the database. `typeorm-store` will not do this for you.\n```typescript\nimport { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm';\nimport { SessionEntity } from 'typeorm-store';\n\n@Entity()\nexport class Session extends BaseEntity implements SessionEntity {\n    @PrimaryColumn()\n    id: string;\n\n    @Column()\n    expiresAt: number;\n\n    @Column()\n    data: string;\n}\n```\n\nUse `TypeormStore` as store in `express-session`, specifying the repository of the new `Session` entity.\n```typescript\nimport * as express from 'express';\nimport * as session from 'express-session';\nimport { getConnection } from 'typeorm';\nimport { TypeormStore } from 'typeorm-store';\nimport { Session } from './entities/session';\n\nconst app = express();\n\n// Make sure the connection is ready before doing this\nconst repository = getConnection().getRepository(Session);\n\napp.use(session({\n   secret: 'secret',\n   resave: false,\n   saveUninitialized: false,\n   store: new TypeormStore({ repository })\n}))\n```\n\n# API\n`new TypeormStore(options)`\n\n## Options\n* `repository` (required) - The repository of the session entity.\n* `ttl` (optional) - The time to live for the session in seconds. Defaults to 86400 (1 day).\n* `expirationInterval` (optional) - The interval in seconds to check for expired sessions.\n   Defaults to 86400 (1 minute).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrtenz%2Ftypeorm-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrtenz%2Ftypeorm-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrtenz%2Ftypeorm-store/lists"}