{"id":25543966,"url":"https://github.com/dimitrinicolas/express-mongoose-loader","last_synced_at":"2026-04-09T02:31:09.775Z","repository":{"id":81565195,"uuid":"108307688","full_name":"dimitrinicolas/express-mongoose-loader","owner":"dimitrinicolas","description":"Create MongoDB models loaders scripts for your express app","archived":false,"fork":false,"pushed_at":"2018-09-20T11:50:37.000Z","size":1679,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-06T22:57:53.370Z","etag":null,"topics":["express","middleware","mongoose","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/express-mongoose-loader","language":"JavaScript","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/dimitrinicolas.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":"2017-10-25T18:14:00.000Z","updated_at":"2018-09-18T07:22:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"80bb57c5-c94f-4c44-ace5-53cd9bee508e","html_url":"https://github.com/dimitrinicolas/express-mongoose-loader","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"3ec0203fd2dbe28dd7c09754b209f9b8177b45f3"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dimitrinicolas/express-mongoose-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrinicolas%2Fexpress-mongoose-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrinicolas%2Fexpress-mongoose-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrinicolas%2Fexpress-mongoose-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrinicolas%2Fexpress-mongoose-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimitrinicolas","download_url":"https://codeload.github.com/dimitrinicolas/express-mongoose-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrinicolas%2Fexpress-mongoose-loader/sbom","scorecard":{"id":343397,"data":{"date":"2025-08-11","repo":{"name":"github.com/dimitrinicolas/express-mongoose-loader","commit":"3ec0203fd2dbe28dd7c09754b209f9b8177b45f3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":-1,"reason":"No tokens found","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Code-Review","score":0,"reason":"Found 0/8 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":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"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":"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":"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":"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":"Vulnerabilities","score":0,"reason":"17 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-4jwp-vfvf-657p","Warn: Project is vulnerable to: GHSA-v8w9-2789-6hhr","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-mh5c-679w-hh4r","Warn: Project is vulnerable to: GHSA-8687-vv9j-hgph","Warn: Project is vulnerable to: GHSA-f825-f98c-gj3g","Warn: Project is vulnerable to: GHSA-h8hf-x3f4-xwgp","Warn: Project is vulnerable to: GHSA-9m93-w8w6-76hh","Warn: Project is vulnerable to: GHSA-m7xq-9374-9rvx","Warn: Project is vulnerable to: GHSA-vg7j-7cwx-8wgw","Warn: Project is vulnerable to: GHSA-p92x-r36w-9395","Warn: Project is vulnerable to: GHSA-45q2-34rf-mr94","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"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-18T06:31:06.272Z","repository_id":81565195,"created_at":"2025-08-18T06:31:06.272Z","updated_at":"2025-08-18T06:31:06.272Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31582561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"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","middleware","mongoose","nodejs"],"created_at":"2025-02-20T07:39:55.454Z","updated_at":"2026-04-09T02:31:09.754Z","avatar_url":"https://github.com/dimitrinicolas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express Mongoose Loader\n\nCreate MongoDB models loaders scripts for your express app, saving you thoses\nnumerous database requests.\n\n## Installation\n\n```sh\n$ npm install express-mongoose-loader\n```\n\n## Usage\n\nFirst call for `express-mongoose-loader` to set up loading system.\n\n```js\napp.use(require('express-mongoose-loader'));\n```\n\nThen, create a mongoose model loader by requesting mongoose id list to load\nwith the function `req.requestList(listName)`. Add item's data into the object\n`req.db[listName]` created by `express-mongoose-loader`.\n\n```js\nimport mongoose from 'mongoose';\nimport Article from './model/article';\n\nlet articlesLoaders = (req, res , next) =\u003e {\n  Article.find(\n    {\n      _id: { $in: req.requestList('articles') }\n    },\n    (err, docs) =\u003e {\n      if (!err \u0026\u0026 docs) {\n        for (const doc of docs) {\n          req.db.articles[doc.id] = {\n            title: doc.title,\n            datetime: doc.datetime,\n            content: doc.content\n          };\n        }\n      }\n      next();\n    }\n  );\n}\n```\n\nRequest model's item loading by calling the function `req.load(id)`.\n\n```js\nreq.load('57f0c59a779f68ea0a70a4e2');\n```\n\nAfter requesting a load you must call your model loader middleware.\n\n```js\napp.use(articlesLoaders);\n```\n\n## Example App\n\n```js\n/* Init your express app */\nimport express from 'express';\n\nimport mongooseLoader from 'express-mongoose-loader';\n\nimport mongoose from 'mongoose';\nmongoose.connect(/* DB config */);\n\nconst app = express();\napp.listen(8080);\n\napp.use(mongooseLoader);\n\n/* Create a basic mongoose model */\nvar ArticleSchema = new mongoose.Schema({\n  title: String,\n  datetime: Date,\n  content: String\n});\nconst Article = mongoose.model('article', ArticleSchema);\n\n/* Create a basic mongoose loader */\nlet articlesLoaders = (req, res, next) =\u003e {\n  Article.find(\n    {\n      _id: { $in: req.requestList('articles') }\n    },\n    (err, docs) =\u003e {\n      if (!err \u0026\u0026 docs) {\n        for (const doc of docs) {\n          req.db.articles[doc.id] = {\n          title: doc.title,\n          datetime: doc.datetime,\n          content: doc.content\n          };\n        }\n      }\n      next();\n    }\n  );\n}\n\n/* Create a basic articles loader middleware */\nlet loadArticles = (req, res, next) =\u003e {\n  Article.find(\n    {\n      public: true\n    },\n    (err, articles) =\u003e {\n      if (!err \u0026\u0026 articles) {\n        for (const article of articles) {\n          /* Ask for article data loading */\n          req.load('articles', article.id);\n        }\n      }\n    }\n  );\n}\n\n/* Basic index page */\napp.use([loadArticles, articlesLoaders]);\napp.get('/',\n  (req, res) =\u003e {\n    let content = '';\n    for (const article of req.db.articles) {\n      content += '\u003ch1\u003e' + article.title + '\u003c/h1\u003e\u003cbr /\u003e';\n    }\n    res.send(content);\n  }\n);\n```\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitrinicolas%2Fexpress-mongoose-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimitrinicolas%2Fexpress-mongoose-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitrinicolas%2Fexpress-mongoose-loader/lists"}