{"id":20894862,"url":"https://github.com/skonves/ts-registry-express","last_synced_at":"2026-04-17T03:31:08.526Z","repository":{"id":44051536,"uuid":"218175510","full_name":"skonves/ts-registry-express","owner":"skonves","description":"Custom ts-registry scope provider for Express requests.","archived":false,"fork":false,"pushed_at":"2025-12-01T21:16:21.000Z","size":396,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T21:14:45.296Z","etag":null,"topics":[],"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/skonves.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["skonves"]}},"created_at":"2019-10-29T01:06:08.000Z","updated_at":"2025-05-19T01:57:14.000Z","dependencies_parsed_at":"2025-05-01T11:37:55.010Z","dependency_job_id":"fa50cfb6-b059-494a-8098-79988e23cae7","html_url":"https://github.com/skonves/ts-registry-express","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/skonves/ts-registry-express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skonves%2Fts-registry-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skonves%2Fts-registry-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skonves%2Fts-registry-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skonves%2Fts-registry-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skonves","download_url":"https://codeload.github.com/skonves/ts-registry-express/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skonves%2Fts-registry-express/sbom","scorecard":{"id":829935,"data":{"date":"2025-08-11","repo":{"name":"github.com/skonves/ts-registry-express","commit":"33f2081dcbf566e057c7f010631823c204990235"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/publish.yml:29","Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/version.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/skonves/ts-registry-express/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/skonves/ts-registry-express/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/skonves/ts-registry-express/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/skonves/ts-registry-express/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/skonves/ts-registry-express/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/skonves/ts-registry-express/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/skonves/ts-registry-express/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/version.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/skonves/ts-registry-express/version.yml/master?enable=pin","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:24"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-75v8-2h7p-7m2m"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T17:29:46.075Z","repository_id":44051536,"created_at":"2025-08-23T17:29:46.075Z","updated_at":"2025-08-23T17:29:46.075Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31913567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"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":[],"created_at":"2024-11-18T10:23:15.625Z","updated_at":"2026-04-17T03:31:08.504Z","avatar_url":"https://github.com/skonves.png","language":"TypeScript","funding_links":["https://github.com/sponsors/skonves"],"categories":[],"sub_categories":[],"readme":"[![build](https://img.shields.io/github/actions/workflow/status/skonves/ts-registry-express/build.yml?branch=master)](https://github.com/skonves/ts-registry-express/actions/workflows/build.yml)\n[![coveralls](https://img.shields.io/coveralls/skonves/ts-registry-express.svg)](https://coveralls.io/github/skonves/ts-registry-express)\n[![NPM Version](https://img.shields.io/npm/v/ts-registry-express.svg)](https://npmjs.com/package/ts-registry-express)\n\n# ts-registry-express\n\nCustom [`ts-registry`](https://github.com/ChristianAlexander/ts-registry) scope provider for [Express](https://expressjs.com/) requests.\n\n## Quick Start\n\n```Typescript\nimport * as express from 'express';\nimport { Registry } from 'ts-registry';\nimport { middleware, request } from 'ts-registry-express';\n\n// define a request-scoped service\nconst registry = new Registry();\nregistry\n  .for('my-service')\n  .withScope(request)\n  .use(() =\u003e new MyService())\n\n// use the middleware\nconst app = express();\napp.use(middleware);\n\n// get an instance of the service\napp.get('/', (req, res) =\u003e {\n  // service instance is unique to this request\n  const service = registry.getService('my-service');\n})\n```\n\n## Access to the current Request\n\nThe target scope for this `ScopeProvider` is the current `Request` object and can be accessed via the second parameter of the service initializer.\n\nExample:\n\n```Typescript\nregistry\n  .for('my-service')\n  .withScope(request)\n  .use((_get, req) =\u003e new MyService(req.session))\n```\n\nBecause service instantiation is deferred, request-scoped service initializers can be defined outside of standard Express middleware, routers, or other handlers. However, when the `registry.get()` is called during a request (even if the call is made from another function or module) the service initializer is passed the instance of the current request as the second argument.\n\nNote that if you hold onto a reference of `req` within either the service intializer or other code, it will not be garbage collected and will lead to a memory leak.\n\n## Troubleshooting\n\nIf you encounter the error \"Request not found in context\", it means the middleware hasn't been properly registered. Make sure to:\n\n1. Import and use the `ts-registry-express` middleware\n2. Register them before any routes that need the context\n\n```typescript\nimport express from 'express';\nimport { middleware } from 'ts-registry-express';\n\nconst app = express();\n\n// Register middleware first\napp.use(middleware);\n\n// Then register your routes that get request-scoped services\napp.get('/', (req, res) =\u003e {\n  const service = registry.getService('my-service');\n});\n```\n\nIf you're using multiple routers, remember to register the middleware on each router that needs the context.\n\nIf you're still experiencing issues, please check:\n\n- The order of middleware registration\n- That you're using the latest version of the package\n- Your Node.js version compatibility\n- That all required dependencies are properly installed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskonves%2Fts-registry-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskonves%2Fts-registry-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskonves%2Fts-registry-express/lists"}